mirror of https://github.com/bjdgyc/anylink.git
优化邮件配置页面-密码为空时则不修改
This commit is contained in:
parent
7b83154245
commit
ec1cf3fcda
|
@ -16,6 +16,11 @@ func setOtherGet(data interface{}, w http.ResponseWriter) {
|
||||||
RespError(w, RespInternalErr, err)
|
RespError(w, RespInternalErr, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 不明文输出SMTP的密码
|
||||||
|
switch dbdata.StructName(data) {
|
||||||
|
case "SettingSmtp":
|
||||||
|
data.(*dbdata.SettingSmtp).Password = ""
|
||||||
|
}
|
||||||
RespSucess(w, data)
|
RespSucess(w, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +39,15 @@ func setOtherEdit(data interface{}, w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// fmt.Println(data)
|
// fmt.Println(data)
|
||||||
|
switch dbdata.StructName(data) {
|
||||||
|
case "SettingSmtp":
|
||||||
|
// 密码为空时则不修改
|
||||||
|
smtp := &dbdata.SettingSmtp{}
|
||||||
|
err := dbdata.SettingGet(smtp)
|
||||||
|
if err == nil && data.(*dbdata.SettingSmtp).Password == "" {
|
||||||
|
data.(*dbdata.SettingSmtp).Password = smtp.Password
|
||||||
|
}
|
||||||
|
}
|
||||||
err = dbdata.SettingSet(data)
|
err = dbdata.SettingSet(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
RespError(w, RespInternalErr, err)
|
RespError(w, RespInternalErr, err)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<el-input v-model="dataSmtp.username"></el-input>
|
<el-input v-model="dataSmtp.username"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="密码" prop="password">
|
<el-form-item label="密码" prop="password">
|
||||||
<el-input v-model="dataSmtp.password"></el-input>
|
<el-input type="password" v-model="dataSmtp.password" placeholder="密码为空则不修改"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="加密类型" prop="encryption">
|
<el-form-item label="加密类型" prop="encryption">
|
||||||
<el-radio-group v-model="dataSmtp.encryption">
|
<el-radio-group v-model="dataSmtp.encryption">
|
||||||
|
|
Loading…
Reference in New Issue