|
@@ -13,10 +13,10 @@
|
|
|
placeholder="请输入用户名"
|
|
placeholder="请输入用户名"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="新密码" prop="newPassword">
|
|
|
|
|
|
|
+ <el-form-item label="邮箱密码" prop="password">
|
|
|
<el-input
|
|
<el-input
|
|
|
class="w500"
|
|
class="w500"
|
|
|
- v-model="ruleForm.newPassword"
|
|
|
|
|
|
|
+ v-model="ruleForm.password"
|
|
|
placeholder="请输入新密码"
|
|
placeholder="请输入新密码"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -72,7 +72,6 @@ const ruleFormRef = ref(null);
|
|
|
const ruleForm = ref({
|
|
const ruleForm = ref({
|
|
|
username: "",
|
|
username: "",
|
|
|
from: "",
|
|
from: "",
|
|
|
- newPassword: "",
|
|
|
|
|
password: "",
|
|
password: "",
|
|
|
smtpHost: "",
|
|
smtpHost: "",
|
|
|
smtpPort: 0,
|
|
smtpPort: 0,
|
|
@@ -82,7 +81,6 @@ const rules = ref({});
|
|
|
async function getEmailConfig() {
|
|
async function getEmailConfig() {
|
|
|
let { data } = await api.getEmailConfig();
|
|
let { data } = await api.getEmailConfig();
|
|
|
ruleForm.value = data.result;
|
|
ruleForm.value = data.result;
|
|
|
- console.log(data);
|
|
|
|
|
}
|
|
}
|
|
|
async function updateEmailConfig() {
|
|
async function updateEmailConfig() {
|
|
|
ElMessageBox.confirm("确认更新邮箱配置", "提示", {
|
|
ElMessageBox.confirm("确认更新邮箱配置", "提示", {
|
|
@@ -90,20 +88,21 @@ async function updateEmailConfig() {
|
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
type: "warning",
|
|
|
}).then(async () => {
|
|
}).then(async () => {
|
|
|
- if (
|
|
|
|
|
- md5(md5(ruleForm.value.newPassword)) === ruleForm.value.password ||
|
|
|
|
|
- ruleForm.value.newPassword === ""
|
|
|
|
|
- ) {
|
|
|
|
|
- delete ruleForm.value.password;
|
|
|
|
|
- delete ruleForm.value.newPassword;
|
|
|
|
|
- } else {
|
|
|
|
|
- ruleForm.value.password = md5(md5(ruleForm.value.newPassword));
|
|
|
|
|
- delete ruleForm.value.newPassword;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const loading = ElLoading.service({
|
|
|
|
|
+ text: "正在更新邮箱配置...",
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
+ fullscreen: true,
|
|
|
|
|
+ });
|
|
|
let { data } = await api.updateEmailConfig({
|
|
let { data } = await api.updateEmailConfig({
|
|
|
...ruleForm.value,
|
|
...ruleForm.value,
|
|
|
});
|
|
});
|
|
|
- console.log(data);
|
|
|
|
|
|
|
+ ElNotification({
|
|
|
|
|
+ title: "提示",
|
|
|
|
|
+ message: data.msg,
|
|
|
|
|
+ });
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ ruleForm.value = data.result;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|