Browse Source

feature: support use ssl in smtp config (#58)

* feat: support config use ssl

* feat: update frontend resources
master
vran 3 years ago
committed by GitHub
parent
commit
890414deb1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      api/src/main/resources/static/css/596.b144be0e.css
  2. 2
      api/src/main/resources/static/index.html
  3. 2
      api/src/main/resources/static/js/243-legacy.92016c20.js
  4. 1
      api/src/main/resources/static/js/243-legacy.92016c20.js.map
  5. 2
      api/src/main/resources/static/js/243.e2c9f564.js
  6. 1
      api/src/main/resources/static/js/243.e2c9f564.js.map
  7. 2
      api/src/main/resources/static/js/596-legacy.6bd184a8.js
  8. 1
      api/src/main/resources/static/js/596-legacy.6bd184a8.js.map
  9. 4
      api/src/main/resources/static/js/596-legacy.b305a8fd.js
  10. 2
      api/src/main/resources/static/js/596-legacy.b305a8fd.js.map
  11. 2
      api/src/main/resources/static/js/596.a8ef0977.js
  12. 1
      api/src/main/resources/static/js/596.a8ef0977.js.map
  13. 4
      api/src/main/resources/static/js/596.b510e94b.js
  14. 2
      api/src/main/resources/static/js/596.b510e94b.js.map
  15. 4
      api/src/main/resources/static/js/app-legacy.89421156.js
  16. 2
      api/src/main/resources/static/js/app-legacy.89421156.js.map
  17. 4
      api/src/main/resources/static/js/app.ccfb747d.js
  18. 2
      api/src/main/resources/static/js/app.ccfb747d.js.map
  19. 2
      core/src/main/java/com/databasir/core/domain/system/data/SystemEmailResponse.java
  20. 3
      core/src/main/java/com/databasir/core/domain/system/data/SystemEmailUpdateRequest.java
  21. 1
      core/src/main/java/com/databasir/core/domain/system/service/SystemService.java
  22. 6
      core/src/main/java/com/databasir/core/infrastructure/mail/MailSender.java
  23. 4
      dao/build.gradle
  24. 13
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/SysMail.java
  25. 19
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/SysMailPojo.java
  26. 82
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/SysMailRecord.java
  27. 1
      dao/src/main/resources/db/migration/V1__init.sql

0
api/src/main/resources/static/css/355.b144be0e.css → api/src/main/resources/static/css/596.b144be0e.css

2
api/src/main/resources/static/index.html

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.98e14a99.js"></script><script defer="defer" type="module" src="/js/app.4f290695.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.2897f987.js" nomodule></script><script defer="defer" src="/js/app-legacy.40dd2314.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> <!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.98e14a99.js"></script><script defer="defer" type="module" src="/js/app.ccfb747d.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.2897f987.js" nomodule></script><script defer="defer" src="/js/app-legacy.89421156.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

2
api/src/main/resources/static/js/243-legacy.92016c20.js

@ -0,0 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[243],{1243:function(e,t,n){n.r(t),n.d(t,{default:function(){return W}});var r=n(6252),u=(0,r.Uk)(" 系统邮箱设置 "),o=(0,r.Uk)(" : "),l=(0,r.Uk)("保存"),a=(0,r.Uk)("重置");function s(e,t,n,s,i,m){var f=(0,r.up)("box"),d=(0,r.up)("el-icon"),p=(0,r.up)("el-divider"),c=(0,r.up)("el-input"),w=(0,r.up)("el-form-item"),h=(0,r.up)("el-col"),g=(0,r.up)("el-switch"),W=(0,r.up)("el-button"),V=(0,r.up)("el-form"),S=(0,r.up)("el-card"),_=(0,r.up)("el-main"),b=(0,r.up)("el-container");return(0,r.wg)(),(0,r.j4)(b,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(_,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(S,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(d,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(f)]})),_:1}),u]})),_:1}),(0,r.Wm)(V,{model:i.form,"label-position":"top",rules:i.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(w,{label:"邮箱账号",prop:"username"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.username,"onUpdate:modelValue":t[0]||(t[0]=function(e){return i.form.username=e}),placeholder:"请输入邮箱账号"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"邮箱密码",prop:"password"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.password,"onUpdate:modelValue":t[1]||(t[1]=function(e){return i.form.password=e}),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"SMTP",prop:"smtpHost"},{default:(0,r.w5)((function(){return[(0,r.Wm)(h,{span:12},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.smtpHost,"onUpdate:modelValue":t[2]||(t[2]=function(e){return i.form.smtpHost=e}),placeholder:"SMTP Host"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(h,{span:1,style:{"text-align":"center"}},{default:(0,r.w5)((function(){return[o]})),_:1}),(0,r.Wm)(h,{span:6},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.smtpPort,"onUpdate:modelValue":t[3]||(t[3]=function(e){return i.form.smtpPort=e}),placeholder:"SMTP Port"},null,8,["modelValue"])]})),_:1})]})),_:1}),(0,r.Wm)(w,{label:"启用 SSL",prop:"useSSL"},{default:(0,r.w5)((function(){return[(0,r.Wm)(g,{modelValue:i.form.useSSL,"onUpdate:modelValue":t[4]||(t[4]=function(e){return i.form.useSSL=e})},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{style:{"margin-top":"38px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(W,{type:"primary",onClick:t[5]||(t[5]=function(e){return m.onSubmit("formRef")})},{default:(0,r.w5)((function(){return[l]})),_:1}),(0,r.Wm)(W,{type:"danger",onClick:t[6]||(t[6]=function(e){return m.onReset()})},{default:(0,r.w5)((function(){return[a]})),_:1})]})),_:1})]})),_:1},8,["model","rules"])]})),_:1})]})),_:1})]})),_:1})}var i=n(8534),m=(n(5666),n(3872)),f="/api/v1.0/settings",d=function(){return m.Z.get(f+"/sys_email")},p=function(e){return m.Z.post(f+"/sys_email",e)},c=function(){return m.Z["delete"](f+"/sys_email")},w={data:function(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null,useSSL:!1},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted:function(){this.fetchSysMail()},methods:{requiredInputValidRule:function(e){return{required:!0,message:e,trigger:"blur"}},fetchSysMail:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,d().then((function(e){return e.data}));case 2:n=t.sent,n&&(e.form=n);case 4:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;this.$refs.formRef.validate((function(t){return t?(p(e.form).then((function(t){t.errCode||e.$message.success("更新成功")})),!0):(e.$message.error("请完善表单相关信息!"),!1)}))},onReset:function(){var e=this;this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){c().then((function(t){t.errCode||(e.form={},e.$message.success("重置成功"))}))}))}}},h=n(3744);const g=(0,h.Z)(w,[["render",s]]);var W=g}}]);
//# sourceMappingURL=243-legacy.92016c20.js.map

1
api/src/main/resources/static/js/243-legacy.92016c20.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/243.e2c9f564.js

@ -0,0 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[243],{1243:function(e,l,t){t.r(l),t.d(l,{default:function(){return W}});var a=t(6252);const s=(0,a.Uk)(" 系统邮箱设置 "),r=(0,a.Uk)(" : "),u=(0,a.Uk)("保存"),o=(0,a.Uk)("重置");function m(e,l,t,m,n,d){const p=(0,a.up)("box"),i=(0,a.up)("el-icon"),f=(0,a.up)("el-divider"),c=(0,a.up)("el-input"),h=(0,a.up)("el-form-item"),w=(0,a.up)("el-col"),W=(0,a.up)("el-switch"),V=(0,a.up)("el-button"),g=(0,a.up)("el-form"),S=(0,a.up)("el-card"),_=(0,a.up)("el-main"),b=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(b,null,{default:(0,a.w5)((()=>[(0,a.Wm)(_,null,{default:(0,a.w5)((()=>[(0,a.Wm)(S,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(i,null,{default:(0,a.w5)((()=>[(0,a.Wm)(p)])),_:1}),s])),_:1}),(0,a.Wm)(g,{model:n.form,"label-position":"top",rules:n.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{label:"邮箱账号",prop:"username"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.username,"onUpdate:modelValue":l[0]||(l[0]=e=>n.form.username=e),placeholder:"请输入邮箱账号"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"邮箱密码",prop:"password"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.password,"onUpdate:modelValue":l[1]||(l[1]=e=>n.form.password=e),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"SMTP",prop:"smtpHost"},{default:(0,a.w5)((()=>[(0,a.Wm)(w,{span:12},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.smtpHost,"onUpdate:modelValue":l[2]||(l[2]=e=>n.form.smtpHost=e),placeholder:"SMTP Host"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(w,{span:1,style:{"text-align":"center"}},{default:(0,a.w5)((()=>[r])),_:1}),(0,a.Wm)(w,{span:6},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.smtpPort,"onUpdate:modelValue":l[3]||(l[3]=e=>n.form.smtpPort=e),placeholder:"SMTP Port"},null,8,["modelValue"])])),_:1})])),_:1}),(0,a.Wm)(h,{label:"启用 SSL",prop:"useSSL"},{default:(0,a.w5)((()=>[(0,a.Wm)(W,{modelValue:n.form.useSSL,"onUpdate:modelValue":l[4]||(l[4]=e=>n.form.useSSL=e)},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{style:{"margin-top":"38px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(V,{type:"primary",onClick:l[5]||(l[5]=e=>d.onSubmit("formRef"))},{default:(0,a.w5)((()=>[u])),_:1}),(0,a.Wm)(V,{type:"danger",onClick:l[6]||(l[6]=e=>d.onReset())},{default:(0,a.w5)((()=>[o])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])),_:1})}var n=t(3872);const d="/api/v1.0/settings",p=()=>n.Z.get(d+"/sys_email"),i=e=>n.Z.post(d+"/sys_email",e),f=()=>n.Z["delete"](d+"/sys_email");var c={data(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null,useSSL:!1},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted(){this.fetchSysMail()},methods:{requiredInputValidRule(e){return{required:!0,message:e,trigger:"blur"}},async fetchSysMail(){const e=await p().then((e=>e.data));e&&(this.form=e)},onSubmit(){this.$refs.formRef.validate((e=>e?(i(this.form).then((e=>{e.errCode||this.$message.success("更新成功")})),!0):(this.$message.error("请完善表单相关信息!"),!1)))},onReset(){this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{f().then((e=>{e.errCode||(this.form={},this.$message.success("重置成功"))}))}))}}},h=t(3744);const w=(0,h.Z)(c,[["render",m]]);var W=w}}]);
//# sourceMappingURL=243.e2c9f564.js.map

1
api/src/main/resources/static/js/243.e2c9f564.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/596-legacy.6bd184a8.js

@ -1,2 +0,0 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[596],{2631:function(e,t,n){n.r(t),n.d(t,{default:function(){return W}});var r=n(6252),u=(0,r.Uk)(" 系统邮箱设置 "),o=(0,r.Uk)(" : "),l=(0,r.Uk)("保存"),a=(0,r.Uk)("重置");function s(e,t,n,s,i,m){var f=(0,r.up)("box"),d=(0,r.up)("el-icon"),c=(0,r.up)("el-divider"),p=(0,r.up)("el-input"),w=(0,r.up)("el-form-item"),h=(0,r.up)("el-col"),g=(0,r.up)("el-button"),W=(0,r.up)("el-form"),_=(0,r.up)("el-card"),V=(0,r.up)("el-main"),b=(0,r.up)("el-container");return(0,r.wg)(),(0,r.j4)(b,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(V,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(_,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(d,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(f)]})),_:1}),u]})),_:1}),(0,r.Wm)(W,{model:i.form,"label-position":"top",rules:i.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(w,{label:"邮箱账号",prop:"username"},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,{modelValue:i.form.username,"onUpdate:modelValue":t[0]||(t[0]=function(e){return i.form.username=e}),placeholder:"请输入邮箱账号"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"邮箱密码",prop:"password"},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,{modelValue:i.form.password,"onUpdate:modelValue":t[1]||(t[1]=function(e){return i.form.password=e}),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"SMTP",prop:"smtpHost"},{default:(0,r.w5)((function(){return[(0,r.Wm)(h,{span:12},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,{modelValue:i.form.smtpHost,"onUpdate:modelValue":t[2]||(t[2]=function(e){return i.form.smtpHost=e}),placeholder:"SMTP Host"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(h,{span:1,style:{"text-align":"center"}},{default:(0,r.w5)((function(){return[o]})),_:1}),(0,r.Wm)(h,{span:6},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,{modelValue:i.form.smtpPort,"onUpdate:modelValue":t[3]||(t[3]=function(e){return i.form.smtpPort=e}),placeholder:"SMTP Port"},null,8,["modelValue"])]})),_:1})]})),_:1}),(0,r.Wm)(w,{style:{"margin-top":"38px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(g,{type:"primary",onClick:t[4]||(t[4]=function(e){return m.onSubmit("formRef")})},{default:(0,r.w5)((function(){return[l]})),_:1}),(0,r.Wm)(g,{type:"danger",onClick:t[5]||(t[5]=function(e){return m.onReset()})},{default:(0,r.w5)((function(){return[a]})),_:1})]})),_:1})]})),_:1},8,["model","rules"])]})),_:1})]})),_:1})]})),_:1})}var i=n(8534),m=(n(5666),n(3872)),f="/api/v1.0/settings",d=function(){return m.Z.get(f+"/sys_email")},c=function(e){return m.Z.post(f+"/sys_email",e)},p=function(){return m.Z["delete"](f+"/sys_email")},w={data:function(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted:function(){this.fetchSysMail()},methods:{requiredInputValidRule:function(e){return{required:!0,message:e,trigger:"blur"}},fetchSysMail:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,d().then((function(e){return e.data}));case 2:n=t.sent,n&&(e.form=n);case 4:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;this.$refs.formRef.validate((function(t){return t?(c(e.form).then((function(t){t.errCode||e.$message.success("更新成功")})),!0):(e.$message.error("请完善表单相关信息!"),!1)}))},onReset:function(){var e=this;this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){p().then((function(t){t.errCode||(e.form={},e.$message.success("重置成功"))}))}))}}},h=n(3744);const g=(0,h.Z)(w,[["render",s]]);var W=g}}]);
//# sourceMappingURL=596-legacy.6bd184a8.js.map

1
api/src/main/resources/static/js/596-legacy.6bd184a8.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/355-legacy.ae661cca.js → api/src/main/resources/static/js/596-legacy.b305a8fd.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/355-legacy.ae661cca.js.map → api/src/main/resources/static/js/596-legacy.b305a8fd.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/596.a8ef0977.js

@ -1,2 +0,0 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[596],{2631:function(e,l,t){t.r(l),t.d(l,{default:function(){return g}});var a=t(6252);const r=(0,a.Uk)(" 系统邮箱设置 "),s=(0,a.Uk)(" : "),o=(0,a.Uk)("保存"),u=(0,a.Uk)("重置");function m(e,l,t,m,n,d){const p=(0,a.up)("box"),i=(0,a.up)("el-icon"),f=(0,a.up)("el-divider"),c=(0,a.up)("el-input"),h=(0,a.up)("el-form-item"),w=(0,a.up)("el-col"),g=(0,a.up)("el-button"),W=(0,a.up)("el-form"),_=(0,a.up)("el-card"),V=(0,a.up)("el-main"),y=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(y,null,{default:(0,a.w5)((()=>[(0,a.Wm)(V,null,{default:(0,a.w5)((()=>[(0,a.Wm)(_,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(i,null,{default:(0,a.w5)((()=>[(0,a.Wm)(p)])),_:1}),r])),_:1}),(0,a.Wm)(W,{model:n.form,"label-position":"top",rules:n.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{label:"邮箱账号",prop:"username"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.username,"onUpdate:modelValue":l[0]||(l[0]=e=>n.form.username=e),placeholder:"请输入邮箱账号"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"邮箱密码",prop:"password"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.password,"onUpdate:modelValue":l[1]||(l[1]=e=>n.form.password=e),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"SMTP",prop:"smtpHost"},{default:(0,a.w5)((()=>[(0,a.Wm)(w,{span:12},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.smtpHost,"onUpdate:modelValue":l[2]||(l[2]=e=>n.form.smtpHost=e),placeholder:"SMTP Host"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(w,{span:1,style:{"text-align":"center"}},{default:(0,a.w5)((()=>[s])),_:1}),(0,a.Wm)(w,{span:6},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.smtpPort,"onUpdate:modelValue":l[3]||(l[3]=e=>n.form.smtpPort=e),placeholder:"SMTP Port"},null,8,["modelValue"])])),_:1})])),_:1}),(0,a.Wm)(h,{style:{"margin-top":"38px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(g,{type:"primary",onClick:l[4]||(l[4]=e=>d.onSubmit("formRef"))},{default:(0,a.w5)((()=>[o])),_:1}),(0,a.Wm)(g,{type:"danger",onClick:l[5]||(l[5]=e=>d.onReset())},{default:(0,a.w5)((()=>[u])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])),_:1})}var n=t(3872);const d="/api/v1.0/settings",p=()=>n.Z.get(d+"/sys_email"),i=e=>n.Z.post(d+"/sys_email",e),f=()=>n.Z["delete"](d+"/sys_email");var c={data(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted(){this.fetchSysMail()},methods:{requiredInputValidRule(e){return{required:!0,message:e,trigger:"blur"}},async fetchSysMail(){const e=await p().then((e=>e.data));e&&(this.form=e)},onSubmit(){this.$refs.formRef.validate((e=>e?(i(this.form).then((e=>{e.errCode||this.$message.success("更新成功")})),!0):(this.$message.error("请完善表单相关信息!"),!1)))},onReset(){this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{f().then((e=>{e.errCode||(this.form={},this.$message.success("重置成功"))}))}))}}},h=t(3744);const w=(0,h.Z)(c,[["render",m]]);var g=w}}]);
//# sourceMappingURL=596.a8ef0977.js.map

1
api/src/main/resources/static/js/596.a8ef0977.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/355.259a00ae.js → api/src/main/resources/static/js/596.b510e94b.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/355.259a00ae.js.map → api/src/main/resources/static/js/596.b510e94b.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/app-legacy.40dd2314.js → api/src/main/resources/static/js/app-legacy.89421156.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app-legacy.40dd2314.js.map → api/src/main/resources/static/js/app-legacy.89421156.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/app.4f290695.js → api/src/main/resources/static/js/app.ccfb747d.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app.4f290695.js.map → api/src/main/resources/static/js/app.ccfb747d.js.map

File diff suppressed because one or more lines are too long

2
core/src/main/java/com/databasir/core/domain/system/data/SystemEmailResponse.java

@ -13,5 +13,7 @@ public class SystemEmailResponse {
private Integer smtpPort; private Integer smtpPort;
private Boolean useSSL;
private LocalDateTime createAt; private LocalDateTime createAt;
} }

3
core/src/main/java/com/databasir/core/domain/system/data/SystemEmailUpdateRequest.java

@ -21,4 +21,7 @@ public class SystemEmailUpdateRequest {
@Max(65535L) @Max(65535L)
private Integer smtpPort; private Integer smtpPort;
@NotNull
private Boolean useSSL;
} }

1
core/src/main/java/com/databasir/core/domain/system/service/SystemService.java

@ -79,6 +79,7 @@ public class SystemService {
response.setSmtpPort(mail.getSmtpPort()); response.setSmtpPort(mail.getSmtpPort());
response.setUsername(mail.getUsername()); response.setUsername(mail.getUsername());
response.setCreateAt(mail.getCreateAt()); response.setCreateAt(mail.getCreateAt());
response.setUseSSL(mail.getUseSsl());
return response; return response;
}); });
} }

6
core/src/main/java/com/databasir/core/infrastructure/mail/MailSender.java

@ -30,7 +30,11 @@ public class MailSender {
} }
sender.setUsername(properties.getUsername()); sender.setUsername(properties.getUsername());
sender.setPassword(properties.getPassword()); sender.setPassword(properties.getPassword());
sender.setProtocol("smtp"); if (properties.getUseSsl()) {
sender.setProtocol("smtps");
} else {
sender.setProtocol("smtp");
}
sender.setDefaultEncoding(StandardCharsets.UTF_8.name()); sender.setDefaultEncoding(StandardCharsets.UTF_8.name());
return sender; return sender;
} }

4
dao/build.gradle

@ -52,7 +52,7 @@ jooq {
forcedTypes { forcedTypes {
forcedType { forcedType {
name = 'BOOLEAN' name = 'BOOLEAN'
includeExpression = 'deleted|enabled|is.*' includeExpression = 'deleted|enabled|is.*|use_ssl'
includeTypes = '.*' includeTypes = '.*'
} }
forcedType { forcedType {
@ -62,7 +62,7 @@ jooq {
} }
forcedType { forcedType {
userType = 'com.databasir.dao.enums.OAuthAppType' userType = 'com.databasir.dao.enums.OAuthAppType'
converter = 'com.databasir.dao.converter.OAuthAppTypeConverter' converter = 'com.databasir.dao.converter.OAuthAppTypeConverter'
includeExpression = 'app_type' includeExpression = 'app_type'
includeTypes = '.*' includeTypes = '.*'
} }

13
dao/generated-src/jooq/main/java/com/databasir/dao/tables/SysMail.java

@ -15,7 +15,7 @@ import org.jooq.ForeignKey;
import org.jooq.Identity; import org.jooq.Identity;
import org.jooq.Name; import org.jooq.Name;
import org.jooq.Record; import org.jooq.Record;
import org.jooq.Row7; import org.jooq.Row8;
import org.jooq.Schema; import org.jooq.Schema;
import org.jooq.Table; import org.jooq.Table;
import org.jooq.TableField; import org.jooq.TableField;
@ -72,6 +72,11 @@ public class SysMail extends TableImpl<SysMailRecord> {
*/ */
public final TableField<SysMailRecord, Integer> SMTP_PORT = createField(DSL.name("smtp_port"), SQLDataType.INTEGER.nullable(false), this, ""); public final TableField<SysMailRecord, Integer> SMTP_PORT = createField(DSL.name("smtp_port"), SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>databasir.sys_mail.use_ssl</code>.
*/
public final TableField<SysMailRecord, Boolean> USE_SSL = createField(DSL.name("use_ssl"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.inline("0", SQLDataType.BOOLEAN)), this, "");
/** /**
* The column <code>databasir.sys_mail.update_at</code>. * The column <code>databasir.sys_mail.update_at</code>.
*/ */
@ -157,11 +162,11 @@ public class SysMail extends TableImpl<SysMailRecord> {
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Row7 type methods // Row8 type methods
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@Override @Override
public Row7<Integer, String, String, String, Integer, LocalDateTime, LocalDateTime> fieldsRow() { public Row8<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row7) super.fieldsRow(); return (Row8) super.fieldsRow();
} }
} }

19
dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/SysMailPojo.java

@ -21,6 +21,7 @@ public class SysMailPojo implements Serializable {
private String password; private String password;
private String smtpHost; private String smtpHost;
private Integer smtpPort; private Integer smtpPort;
private Boolean useSsl;
private LocalDateTime updateAt; private LocalDateTime updateAt;
private LocalDateTime createAt; private LocalDateTime createAt;
@ -32,6 +33,7 @@ public class SysMailPojo implements Serializable {
this.password = value.password; this.password = value.password;
this.smtpHost = value.smtpHost; this.smtpHost = value.smtpHost;
this.smtpPort = value.smtpPort; this.smtpPort = value.smtpPort;
this.useSsl = value.useSsl;
this.updateAt = value.updateAt; this.updateAt = value.updateAt;
this.createAt = value.createAt; this.createAt = value.createAt;
} }
@ -42,6 +44,7 @@ public class SysMailPojo implements Serializable {
String password, String password,
String smtpHost, String smtpHost,
Integer smtpPort, Integer smtpPort,
Boolean useSsl,
LocalDateTime updateAt, LocalDateTime updateAt,
LocalDateTime createAt LocalDateTime createAt
) { ) {
@ -50,6 +53,7 @@ public class SysMailPojo implements Serializable {
this.password = password; this.password = password;
this.smtpHost = smtpHost; this.smtpHost = smtpHost;
this.smtpPort = smtpPort; this.smtpPort = smtpPort;
this.useSsl = useSsl;
this.updateAt = updateAt; this.updateAt = updateAt;
this.createAt = createAt; this.createAt = createAt;
} }
@ -124,6 +128,20 @@ public class SysMailPojo implements Serializable {
this.smtpPort = smtpPort; this.smtpPort = smtpPort;
} }
/**
* Getter for <code>databasir.sys_mail.use_ssl</code>.
*/
public Boolean getUseSsl() {
return this.useSsl;
}
/**
* Setter for <code>databasir.sys_mail.use_ssl</code>.
*/
public void setUseSsl(Boolean useSsl) {
this.useSsl = useSsl;
}
/** /**
* Getter for <code>databasir.sys_mail.update_at</code>. * Getter for <code>databasir.sys_mail.update_at</code>.
*/ */
@ -161,6 +179,7 @@ public class SysMailPojo implements Serializable {
sb.append(", ").append(password); sb.append(", ").append(password);
sb.append(", ").append(smtpHost); sb.append(", ").append(smtpHost);
sb.append(", ").append(smtpPort); sb.append(", ").append(smtpPort);
sb.append(", ").append(useSsl);
sb.append(", ").append(updateAt); sb.append(", ").append(updateAt);
sb.append(", ").append(createAt); sb.append(", ").append(createAt);

82
dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/SysMailRecord.java

@ -11,8 +11,8 @@ import java.time.LocalDateTime;
import org.jooq.Field; import org.jooq.Field;
import org.jooq.Record1; import org.jooq.Record1;
import org.jooq.Record7; import org.jooq.Record8;
import org.jooq.Row7; import org.jooq.Row8;
import org.jooq.impl.UpdatableRecordImpl; import org.jooq.impl.UpdatableRecordImpl;
@ -20,7 +20,7 @@ import org.jooq.impl.UpdatableRecordImpl;
* This class is generated by jOOQ. * This class is generated by jOOQ.
*/ */
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) @SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements Record7<Integer, String, String, String, Integer, LocalDateTime, LocalDateTime> { public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements Record8<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -94,32 +94,46 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
return (Integer) get(4); return (Integer) get(4);
} }
/**
* Setter for <code>databasir.sys_mail.use_ssl</code>.
*/
public void setUseSsl(Boolean value) {
set(5, value);
}
/**
* Getter for <code>databasir.sys_mail.use_ssl</code>.
*/
public Boolean getUseSsl() {
return (Boolean) get(5);
}
/** /**
* Setter for <code>databasir.sys_mail.update_at</code>. * Setter for <code>databasir.sys_mail.update_at</code>.
*/ */
public void setUpdateAt(LocalDateTime value) { public void setUpdateAt(LocalDateTime value) {
set(5, value); set(6, value);
} }
/** /**
* Getter for <code>databasir.sys_mail.update_at</code>. * Getter for <code>databasir.sys_mail.update_at</code>.
*/ */
public LocalDateTime getUpdateAt() { public LocalDateTime getUpdateAt() {
return (LocalDateTime) get(5); return (LocalDateTime) get(6);
} }
/** /**
* Setter for <code>databasir.sys_mail.create_at</code>. * Setter for <code>databasir.sys_mail.create_at</code>.
*/ */
public void setCreateAt(LocalDateTime value) { public void setCreateAt(LocalDateTime value) {
set(6, value); set(7, value);
} }
/** /**
* Getter for <code>databasir.sys_mail.create_at</code>. * Getter for <code>databasir.sys_mail.create_at</code>.
*/ */
public LocalDateTime getCreateAt() { public LocalDateTime getCreateAt() {
return (LocalDateTime) get(6); return (LocalDateTime) get(7);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -132,17 +146,17 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Record7 type implementation // Record8 type implementation
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@Override @Override
public Row7<Integer, String, String, String, Integer, LocalDateTime, LocalDateTime> fieldsRow() { public Row8<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row7) super.fieldsRow(); return (Row8) super.fieldsRow();
} }
@Override @Override
public Row7<Integer, String, String, String, Integer, LocalDateTime, LocalDateTime> valuesRow() { public Row8<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime> valuesRow() {
return (Row7) super.valuesRow(); return (Row8) super.valuesRow();
} }
@Override @Override
@ -171,12 +185,17 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
} }
@Override @Override
public Field<LocalDateTime> field6() { public Field<Boolean> field6() {
return SysMail.SYS_MAIL.UPDATE_AT; return SysMail.SYS_MAIL.USE_SSL;
} }
@Override @Override
public Field<LocalDateTime> field7() { public Field<LocalDateTime> field7() {
return SysMail.SYS_MAIL.UPDATE_AT;
}
@Override
public Field<LocalDateTime> field8() {
return SysMail.SYS_MAIL.CREATE_AT; return SysMail.SYS_MAIL.CREATE_AT;
} }
@ -206,12 +225,17 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
} }
@Override @Override
public LocalDateTime component6() { public Boolean component6() {
return getUpdateAt(); return getUseSsl();
} }
@Override @Override
public LocalDateTime component7() { public LocalDateTime component7() {
return getUpdateAt();
}
@Override
public LocalDateTime component8() {
return getCreateAt(); return getCreateAt();
} }
@ -241,12 +265,17 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
} }
@Override @Override
public LocalDateTime value6() { public Boolean value6() {
return getUpdateAt(); return getUseSsl();
} }
@Override @Override
public LocalDateTime value7() { public LocalDateTime value7() {
return getUpdateAt();
}
@Override
public LocalDateTime value8() {
return getCreateAt(); return getCreateAt();
} }
@ -281,19 +310,25 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
} }
@Override @Override
public SysMailRecord value6(LocalDateTime value) { public SysMailRecord value6(Boolean value) {
setUpdateAt(value); setUseSsl(value);
return this; return this;
} }
@Override @Override
public SysMailRecord value7(LocalDateTime value) { public SysMailRecord value7(LocalDateTime value) {
setUpdateAt(value);
return this;
}
@Override
public SysMailRecord value8(LocalDateTime value) {
setCreateAt(value); setCreateAt(value);
return this; return this;
} }
@Override @Override
public SysMailRecord values(Integer value1, String value2, String value3, String value4, Integer value5, LocalDateTime value6, LocalDateTime value7) { public SysMailRecord values(Integer value1, String value2, String value3, String value4, Integer value5, Boolean value6, LocalDateTime value7, LocalDateTime value8) {
value1(value1); value1(value1);
value2(value2); value2(value2);
value3(value3); value3(value3);
@ -301,6 +336,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
value5(value5); value5(value5);
value6(value6); value6(value6);
value7(value7); value7(value7);
value8(value8);
return this; return this;
} }
@ -318,7 +354,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
/** /**
* Create a detached, initialised SysMailRecord * Create a detached, initialised SysMailRecord
*/ */
public SysMailRecord(Integer id, String username, String password, String smtpHost, Integer smtpPort, LocalDateTime updateAt, LocalDateTime createAt) { public SysMailRecord(Integer id, String username, String password, String smtpHost, Integer smtpPort, Boolean useSsl, LocalDateTime updateAt, LocalDateTime createAt) {
super(SysMail.SYS_MAIL); super(SysMail.SYS_MAIL);
setId(id); setId(id);
@ -326,6 +362,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
setPassword(password); setPassword(password);
setSmtpHost(smtpHost); setSmtpHost(smtpHost);
setSmtpPort(smtpPort); setSmtpPort(smtpPort);
setUseSsl(useSsl);
setUpdateAt(updateAt); setUpdateAt(updateAt);
setCreateAt(createAt); setCreateAt(createAt);
} }
@ -342,6 +379,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
setPassword(value.getPassword()); setPassword(value.getPassword());
setSmtpHost(value.getSmtpHost()); setSmtpHost(value.getSmtpHost());
setSmtpPort(value.getSmtpPort()); setSmtpPort(value.getSmtpPort());
setUseSsl(value.getUseSsl());
setUpdateAt(value.getUpdateAt()); setUpdateAt(value.getUpdateAt());
setCreateAt(value.getCreateAt()); setCreateAt(value.getCreateAt());
} }

1
dao/src/main/resources/db/migration/V1__init.sql

@ -19,6 +19,7 @@ CREATE TABLE IF NOT EXISTS sys_mail
password TEXT NOT NULL, password TEXT NOT NULL,
smtp_host VARCHAR(512) NOT NULL, smtp_host VARCHAR(512) NOT NULL,
smtp_port INT NOT NULL, smtp_port INT NOT NULL,
use_ssl BOOLEAN NOT NULL DEFAULT FALSE,
update_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, update_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
) CHARSET utf8mb4 ) CHARSET utf8mb4

Loading…
Cancel
Save