diff --git a/internal/web/actions/default/users/user.go b/internal/web/actions/default/users/user.go index 86547c44..52e59244 100644 --- a/internal/web/actions/default/users/user.go +++ b/internal/web/actions/default/users/user.go @@ -97,6 +97,7 @@ func (this *UserAction) RunGet(params struct { "username": user.Username, "fullname": user.Fullname, "email": user.Email, + "verifiedEmail": user.VerifiedEmail, "tel": user.Tel, "remark": user.Remark, "mobile": user.Mobile, diff --git a/web/public/js/components/senders/email-sender.js b/web/public/js/components/senders/email-sender.js new file mode 100644 index 00000000..5cd115df --- /dev/null +++ b/web/public/js/components/senders/email-sender.js @@ -0,0 +1,102 @@ +Vue.component("email-sender", { + props: ["value", "name"], + data: function () { + let value = this.value + if (value == null) { + value = { + isOn: false, + smtpHost: "", + smtpPort: 0, + username: "", + password: "", + fromEmail: "", + fromName: "" + } + } + let smtpPortString = value.smtpPort.toString() + if (smtpPortString == "0") { + smtpPortString = "" + } + + return { + config: value, + smtpPortString: smtpPortString + } + }, + watch: { + smtpPortString: function (v) { + let port = parseInt(v) + if (!isNaN(port)) { + this.config.smtpPort = port + } + } + }, + methods: { + test: function () { + window.TESTING_EMAIL_CONFIG = this.config + teaweb.popup("/users/setting/emailTest", { + height: "36em" + }) + } + }, + template: `
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
启用
SMTP地址 * + +

SMTP主机地址,比如smtp.qq.com,目前仅支持TLS协议,如不清楚,请查询对应邮件服务商文档。

+
SMTP端口 * + +

SMTP主机端口,比如587465,如不清楚,请查询对应邮件服务商文档。

+
用户名 * + +

通常为发件人邮箱地址。

+
密码 * + +

邮箱登录密码或授权码,如不清楚,请查询对应邮件服务商文档。。

+
发件人Email * + +

使用的发件人邮箱地址,通常和发件用户名一致。

+
发件人名称 + +

使用的发件人名称,默认使用系统设置的产品名称

+
发送测试[点此测试]
+
+
` +}) \ No newline at end of file diff --git a/web/views/@default/users/user.html b/web/views/@default/users/user.html index 17c669a5..058604b9 100644 --- a/web/views/@default/users/user.html +++ b/web/views/@default/users/user.html @@ -33,35 +33,42 @@ 关联集群 {{user.cluster.name}} - - + 没有设置。 手机号 {{user.mobile}} - - + 没有设置。 联系电话 {{user.tel}} - - + 没有设置。 - 电子邮箱 + 常用电子邮箱 {{user.email}} - - + 没有设置。 + + + + 已绑定电子邮箱 + + {{user.verifiedEmail}} + 没有设置。 备注 {{user.remark}} - - + 没有设置。