build: 新增删除账户功能

This commit is contained in:
韦荣超 2022-07-13 18:44:05 +08:00
parent 1ea5bfa807
commit 64d34deb6b
8 changed files with 6 additions and 5 deletions

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

1
public/js/build/0.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/build/100.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[100],{52100:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s});const a={data:function(){return{loadIng:0,formDatum:{newEmail:"",code:""},ruleDatum:{},count:0,isSendButtonShow:!0,isRegVerify:0,sendBtnText:""}},mounted:function(){this.getRegVerify()},methods:{initLanguage:function(){var t=this;this.sendBtnText=this.$L("发送验证码"),this.ruleDatum={newEmail:[{validator:function(e,n,a){""===n.trim()?a(new Error(t.$L("请输入新邮箱地址!"))):$A.isEmail(n.trim())?a():a(new Error(t.$L("请输入正确的邮箱地址!")))},required:!0,trigger:"change"}]}},sendEmailCode:function(){var t=this;this.$store.dispatch("call",{url:"users/send/email",data:{type:2,email:this.formDatum.newEmail}}).then((function(e){!function(t){if(null==t)throw new TypeError("Cannot destructure undefined")}(e),t.isSendButtonShow=!1,t.count=120;var n=setInterval((function(){t.count--,t.sendBtnText=t.count+" 秒",t.count<=0&&(t.sendBtnText=t.$L("发送验证码"),clearInterval(n))}),1e3)})).catch((function(t){var e=t.msg;$A.messageError(e)}))},submitForm:function(){var t=this;this.$refs.formDatum.validate((function(e){e&&(t.loadIng++,t.$store.dispatch("call",{url:"users/edit/email",data:t.formDatum}).then((function(e){var n=e.data;$A.messageSuccess("修改成功"),t.$store.dispatch("saveUserInfo",n),t.$refs.formDatum.resetFields(),t.isSendButtonShow=!0})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.loadIng--})))}))},resetForm:function(){this.$refs.formDatum.resetFields()},getRegVerify:function(){var t=this;this.$store.dispatch("call",{url:"system/get/regverify"}).then((function(e){var n=e.data;t.isRegVerify=n})).catch((function(){}))}}};const s=(0,n(51900).Z)(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"setting-item submit"},[e("Form",{ref:"formDatum",attrs:{model:t.formDatum,rules:t.ruleDatum,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{label:t.$L("新邮箱地址"),prop:"newEmail"}},[e("div",{staticClass:"setting-email"},[1==t.isRegVerify?e("Input",{class:t.count>0?"setting-send-input":"setting-input",attrs:{search:"","enter-button":t.$L(t.sendBtnText),placeholder:t.$L("输入新邮箱地址")},on:{"on-search":t.sendEmailCode},model:{value:t.formDatum.newEmail,callback:function(e){t.$set(t.formDatum,"newEmail",e)},expression:"formDatum.newEmail"}}):e("Input",{staticClass:"setting-input",attrs:{placeholder:t.$L("输入新邮箱地址")},model:{value:t.formDatum.newEmail,callback:function(e){t.$set(t.formDatum,"newEmail",e)},expression:"formDatum.newEmail"}})],1)]),t._v(" "),1==t.isRegVerify?e("FormItem",{attrs:{label:t.$L("验证码"),prop:"code"}},[e("Input",{attrs:{placeholder:t.$L("输入邮箱验证码")},model:{value:t.formDatum.code,callback:function(e){t.$set(t.formDatum,"code",e)},expression:"formDatum.code"}})],1):t._e()],1),t._v(" "),e("div",{staticClass:"setting-footer"},[e("Button",{attrs:{loading:t.loadIng>0,type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$L("提交")))]),t._v(" "),e("Button",{staticStyle:{"margin-left":"8px"},attrs:{loading:t.loadIng>0},on:{click:t.resetForm}},[t._v(t._s(t.$L("重置")))])],1)],1)}),[],!1,null,null,null).exports}}]);

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[134],{61134:(t,e,a)=>{a.r(e),a.d(e,{default:()=>n});const r={data:function(){return{loadIng:0,formDatum:{newEmail:"",code:""},ruleDatum:{},count:0,isUpdateShow:!0,codeShow:!1,isRegVerify:0}},mounted:function(){this.getRegVerify()},methods:{initLanguage:function(){var t=this;this.ruleDatum={newEmail:[{validator:function(e,a,r){""===a.trim()?r(new Error(t.$L("请输入新邮箱地址!"))):$A.isEmail(a.trim())?r():r(new Error(t.$L("请输入正确的邮箱地址!")))},required:!0,trigger:"change"}]}},sendEmailCode:function(){var t=this;this.$store.dispatch("call",{url:"users/send/email",data:{type:2,email:this.formDatum.newEmail}}).then((function(e){!function(t){if(null==t)throw new TypeError("Cannot destructure undefined")}(e),t.isUpdateShow=!1,t.count=120;var a=setInterval((function(){t.count--,t.count<=0&&(t.isUpdateShow=!0,clearInterval(a))}),1e3)})).catch((function(t){var e=t.msg;$A.messageError(e)}))},submitForm:function(){var t=this;this.$refs.formDatum.validate((function(e){e&&(t.loadIng++,t.$store.dispatch("call",{url:"users/editemail",data:t.formDatum}).then((function(e){var a=e.data;$A.messageSuccess("修改成功"),t.$store.dispatch("saveUserInfo",a),t.$refs.formDatum.resetFields(),t.isUpdateShow=!0})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.loadIng--})))}))},resetForm:function(){this.$refs.formDatum.resetFields()},getRegVerify:function(){var t=this;this.$store.dispatch("call",{url:"system/get/regverify"}).then((function(e){var a=e.data;t.isRegVerify=a})).catch((function(){}))}}};const n=(0,a(51900).Z)(r,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"setting-item submit"},[e("Form",{ref:"formDatum",attrs:{model:t.formDatum,rules:t.ruleDatum,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{label:t.$L("新邮箱地址"),prop:"newEmail"}},[e("Row",[e("Col",{attrs:{span:"6"}},[e("Input",{model:{value:t.formDatum.newEmail,callback:function(e){t.$set(t.formDatum,"newEmail",e)},expression:"formDatum.newEmail"}})],1),t._v(" "),1==t.isRegVerify?e("Col",{attrs:{span:"6"}},[t.isUpdateShow?e("Button",{attrs:{type:"primary"},on:{click:t.sendEmailCode}},[t._v(t._s(t.$L("发送验证码")))]):t._e(),t._v(" "),t.isUpdateShow?t._e():e("Button",{attrs:{disabled:""}},[e("span",[t._v(t._s(t.count))]),t._v(t._s(t.$L("秒")))])],1):t._e()],1)],1),t._v(" "),1==t.isRegVerify?e("FormItem",{attrs:{label:t.$L("验证码"),prop:"code"}},[e("Input",{attrs:{placeholder:t.$L("输入邮箱验证码")},model:{value:t.formDatum.code,callback:function(e){t.$set(t.formDatum,"code",e)},expression:"formDatum.code"}})],1):t._e()],1),t._v(" "),e("div",{staticClass:"setting-footer"},[e("Button",{attrs:{loading:t.loadIng>0,type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$L("提交")))]),t._v(" "),e("Button",{staticStyle:{"margin-left":"8px"},attrs:{loading:t.loadIng>0},on:{click:t.resetForm}},[t._v(t._s(t.$L("重置")))])],1)],1)}),[],!1,null,null,null).exports}}]);

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[513],{39513:(t,e,n)=>{n.r(e),n.d(e,{default:()=>p});var a=n(20629),i=n(80641),s=n(9669),o=n.n(s);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const l={data:function(){return{version:window.systemInfo.version}},mounted:function(){},computed:c(c({},(0,a.rn)(["userInfo","userIsAdmin","clientNewVersion"])),{},{routeName:function(){return this.$route.name},show768Menu:function(){return"manage-setting"===this.routeName},menu:function(){var t=[{path:"personal",name:"个人设置"},{path:"language",name:"语言设置"},{path:"password",name:"密码设置"},{path:"email",name:"修改邮箱"}];return["127.0.0.1:2222","t.hitosea.com","dootask.com","www.dootask.com"].includes($A.getDomain($A.apiUrl("../")))&&this.$isEEUiApp&&t.push({path:"privacy",name:"隐私政策"}),this.windowSmall&&t.push({path:"clearCache",name:"清除缓存"}),this.userIsAdmin?t.push.apply(t,[{path:"system",name:"系统设置",divided:!0},{path:"logout",name:"退出登录"}]):t.push.apply(t,[{path:"logout",name:"退出登录",divided:!0}]),t},titleNameRoute:function(){var t=this.routeName,e=this.menu,n="";return e.some((function(e){if(t==="manage-setting-".concat(e.path))return n=e.name,!0})),n||"设置"}}),watch:{routeName:{handler:function(t){"manage-setting"===t&&this.windowLarge&&this.goForward({name:"manage-setting-personal"},!0)},immediate:!0}},methods:{toggleRoute:function(t){var e=this;switch(t){case"clearCache":this.$store.dispatch("handleClearCache",null).then((function(){$A.setStorage("clearCache",$A.randomString(6)),$A.reloadUrl()})).catch((function(){$A.reloadUrl()}));break;case"logout":$A.modalConfirm({title:"退出登录",content:"你确定要登出系统?",onOk:function(){e.$store.dispatch("logout",!1)}});break;case"version":i.Store.set("updateNotification",null);break;case"privacy":this.openPrivacy();break;case"index":this.goForward({name:"manage-setting"});break;default:this.goForward({name:"manage-setting-"+t})}},openPrivacy:function(){var t=$A.apiUrl("../privacy.html");this.$isEEUiApp?$A.eeuiAppOpenPage({pageType:"app",pageTitle:" ",url:"web.js",params:{url:t,browser:!0,showProgress:!0}}):window.open(t)},classNameRoute:function(t,e){return{active:this.windowLarge&&this.routeName==="manage-setting-".concat(t),divided:!!e}},onVersion:function(){var t=this;this.$Electron&&o().get($A.apiUrl("system/version")).then((function(e){var n=e.status,a=e.data;if(200===n){var i="".concat(t.$L("服务器"),": ").concat($A.getDomain($A.apiUrl("../")));i+="<br/>".concat(t.$L("服务器版本"),": v").concat(a.version),i+="<br/>".concat(t.$L("客户端版本"),": v").concat(t.version),$A.modalInfo({content:i})}})).catch((function(t){}))}}};const p=(0,n(51900).Z)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-setting"},[e("PageTitle",{attrs:{title:t.$L(t.titleNameRoute)}}),t._v(" "),e("div",{staticClass:"setting-head"},[e("div",{staticClass:"setting-titbox"},[e("div",{staticClass:"setting-title"},[e("h1",[t._v(t._s(t.$L("设置")))]),t._v(" "),t.show768Menu?t._e():e("div",{staticClass:"setting-more",on:{click:function(e){return t.toggleRoute("index")}}},[e("Icon",{attrs:{type:"md-close"}})],1)])])]),t._v(" "),e("div",{staticClass:"setting-box"},[e("div",{staticClass:"setting-menu",class:{"show768-menu":t.show768Menu}},[e("ul",[t._l(t.menu,(function(n,a){return e("li",{key:a,class:t.classNameRoute(n.path,n.divided),on:{click:function(e){return t.toggleRoute(n.path)}}},[t._v(t._s(t.$L(n.name)))])})),t._v(" "),t.clientNewVersion?e("li",{class:t.classNameRoute("version",!0),on:{click:function(e){return t.toggleRoute("version")}}},[e("AutoTip",{attrs:{disabled:""}},[t._v(t._s(t.$L("版本"))+": "+t._s(t.version))]),t._v(" "),e("Badge",{attrs:{text:t.clientNewVersion}})],1):e("li",{staticClass:"version divided",on:{click:t.onVersion}},[e("AutoTip",[t._v(t._s(t.$L("版本"))+": "+t._s(t.version))])],1)],2)]),t._v(" "),e("div",{staticClass:"setting-content"},[e("div",{staticClass:"setting-content-title"},[t._v(t._s(t.$L(t.titleNameRoute)))]),t._v(" "),e("div",{staticClass:"setting-content-view"},[e("router-view",{staticClass:"setting-router-view"})],1)])])],1)}),[],!1,null,null,null).exports}}]);

1
public/js/build/67.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[67],{16067:(t,e,n)=>{n.r(e),n.d(e,{default:()=>p});var a=n(20629),i=n(80641),s=n(9669),o=n.n(s);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const l={data:function(){return{version:window.systemInfo.version}},mounted:function(){},computed:c(c({},(0,a.rn)(["userInfo","userIsAdmin","clientNewVersion"])),{},{routeName:function(){return this.$route.name},show768Menu:function(){return"manage-setting"===this.routeName},menu:function(){var t=[{path:"personal",name:"个人设置"},{path:"language",name:"语言设置"},{path:"password",name:"密码设置"},{path:"email",name:"修改邮箱"}];return["127.0.0.1:2222","t.hitosea.com","dootask.com","www.dootask.com"].includes($A.getDomain($A.apiUrl("../")))&&this.$isEEUiApp&&t.push({path:"privacy",name:"隐私政策"}),this.windowSmall&&t.push({path:"clearCache",name:"清除缓存"}),this.userIsAdmin?t.push.apply(t,[{path:"system",name:"系统设置",divided:!0},{path:"logout",name:"退出登录"},{path:"delete",name:"删除账户"}]):t.push.apply(t,[{path:"logout",name:"退出登录",divided:!0},{path:"delete",name:"删除账户"}]),t},titleNameRoute:function(){var t=this.routeName,e=this.menu,n="";return e.some((function(e){if(t==="manage-setting-".concat(e.path))return n=e.name,!0})),n||"设置"}}),watch:{routeName:{handler:function(t){"manage-setting"===t&&this.windowLarge&&this.goForward({name:"manage-setting-personal"},!0)},immediate:!0}},methods:{toggleRoute:function(t){var e=this;switch(t){case"clearCache":this.$store.dispatch("handleClearCache",null).then((function(){$A.setStorage("clearCache",$A.randomString(6)),$A.reloadUrl()})).catch((function(){$A.reloadUrl()}));break;case"logout":$A.modalConfirm({title:"退出登录",content:"你确定要登出系统?",onOk:function(){e.$store.dispatch("logout",!1)}});break;case"version":i.Store.set("updateNotification",null);break;case"privacy":this.openPrivacy();break;case"index":this.goForward({name:"manage-setting"});break;default:this.goForward({name:"manage-setting-"+t})}},openPrivacy:function(){var t=$A.apiUrl("../privacy.html");this.$isEEUiApp?$A.eeuiAppOpenPage({pageType:"app",pageTitle:" ",url:"web.js",params:{url:t,browser:!0,showProgress:!0}}):window.open(t)},classNameRoute:function(t,e){return{active:this.windowLarge&&this.routeName==="manage-setting-".concat(t),divided:!!e}},onVersion:function(){var t=this;this.$Electron&&o().get($A.apiUrl("system/version")).then((function(e){var n=e.status,a=e.data;if(200===n){var i="".concat(t.$L("服务器"),": ").concat($A.getDomain($A.apiUrl("../")));i+="<br/>".concat(t.$L("服务器版本"),": v").concat(a.version),i+="<br/>".concat(t.$L("客户端版本"),": v").concat(t.version),$A.modalInfo({content:i})}})).catch((function(t){}))}}};const p=(0,n(51900).Z)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-setting"},[e("PageTitle",{attrs:{title:t.$L(t.titleNameRoute)}}),t._v(" "),e("div",{staticClass:"setting-head"},[e("div",{staticClass:"setting-titbox"},[e("div",{staticClass:"setting-title"},[e("h1",[t._v(t._s(t.$L("设置")))]),t._v(" "),t.show768Menu?t._e():e("div",{staticClass:"setting-more",on:{click:function(e){return t.toggleRoute("index")}}},[e("Icon",{attrs:{type:"md-close"}})],1)])])]),t._v(" "),e("div",{staticClass:"setting-box"},[e("div",{staticClass:"setting-menu",class:{"show768-menu":t.show768Menu}},[e("ul",[t._l(t.menu,(function(n,a){return e("li",{key:a,class:t.classNameRoute(n.path,n.divided),on:{click:function(e){return t.toggleRoute(n.path)}}},[t._v(t._s(t.$L(n.name)))])})),t._v(" "),t.clientNewVersion?e("li",{class:t.classNameRoute("version",!0),on:{click:function(e){return t.toggleRoute("version")}}},[e("AutoTip",{attrs:{disabled:""}},[t._v(t._s(t.$L("版本"))+": "+t._s(t.version))]),t._v(" "),e("Badge",{attrs:{text:t.clientNewVersion}})],1):e("li",{staticClass:"version divided",on:{click:t.onVersion}},[e("AutoTip",[t._v(t._s(t.$L("版本"))+": "+t._s(t.version))])],1)],2)]),t._v(" "),e("div",{staticClass:"setting-content"},[e("div",{staticClass:"setting-content-title"},[t._v(t._s(t.$L(t.titleNameRoute)))]),t._v(" "),e("div",{staticClass:"setting-content-view"},[e("router-view",{staticClass:"setting-router-view"})],1)])])],1)}),[],!1,null,null,null).exports}}]);

View File

@ -1 +1 @@
bdee5a74d6a7beb9
1f2b0c39a064ac6b