From 1947b1a7911ec3b12feedfbdb292030a3af44d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyiyousong=E2=80=9D?= <鈥測ousong_yi@foxmail.com鈥�> Date: Thu, 14 Sep 2023 17:26:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=E4=BF=AE=E6=94=B9=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- portal-manager-ui/admin/src/main.js | 2 +- .../views/home/components/changePassword.vue | 86 +++++++++++++++---- .../permissionsModel/components/EditPwd.vue | 14 +-- .../permissionsModel/components/EditUser.vue | 4 +- .../permissionsModel/components/addUser.vue | 6 +- 5 files changed, 83 insertions(+), 29 deletions(-) diff --git a/portal-manager-ui/admin/src/main.js b/portal-manager-ui/admin/src/main.js index 61d517ee..4acb20f3 100644 --- a/portal-manager-ui/admin/src/main.js +++ b/portal-manager-ui/admin/src/main.js @@ -62,7 +62,7 @@ Vue.prototype.$bus = new Vue(); import "swiper/css/swiper.min.css"; Vue.config.productionTip = false; -// 鍥剧墖棰勭害 +// 鍥剧墖棰勮 import Viewer from "v-viewer"; import "viewerjs/dist/viewer.css"; Vue.use(Viewer); diff --git a/portal-manager-ui/admin/src/views/home/components/changePassword.vue b/portal-manager-ui/admin/src/views/home/components/changePassword.vue index 3735cbfc..7ffe1db6 100644 --- a/portal-manager-ui/admin/src/views/home/components/changePassword.vue +++ b/portal-manager-ui/admin/src/views/home/components/changePassword.vue @@ -5,26 +5,74 @@ :destroyOnClose="true" :visible="visibleEditPwd" @cancel="handleClose" - width="480px" + width="600px" > <a-form-model :model="form" :rules="rules" ref="formData" - :label-col="{ span: 5 }" - :wrapper-col="{ span: 19 }" + :label-col="{ span: 4 }" + :wrapper-col="{ span: 20 }" > <a-form-model-item label="鍘熷瘑鐮�" prop="oldPwd"> - <a-input-password v-model="form.oldPwd" placeholder="璇疯緭鍏ュ師瀵嗙爜" /> + <a-input + :type="oldPwd" + v-model="form.oldPwd" + placeholder="璇疯緭鍏ュ師瀵嗙爜" + > + <template slot="suffix"> + <i + v-if="oldPwd == 'password'" + class="iconfont icon-hidden cursor-pointer" + @click="oldPwd = 'text'" + ></i> + <i + v-else + class="iconfont icon-show cursor-pointer" + @click="oldPwd = 'password'" + ></i> + </template> + </a-input> </a-form-model-item> <a-form-model-item label="鏂板瘑鐮�" prop="newPwd"> - <a-input-password v-model="form.newPwd" placeholder="璇疯緭鍏ユ柊瀵嗙爜" /> + <a-input + :type="newPwd" + v-model="form.newPwd" + placeholder="璇疯緭鍏ユ柊瀵嗙爜" + > + <template slot="suffix"> + <i + v-if="newPwd == 'password'" + class="iconfont icon-hidden cursor-pointer" + @click="newPwd = 'text'" + ></i> + <i + v-else + class="iconfont icon-show cursor-pointer" + @click="newPwd = 'password'" + ></i> + </template> + </a-input> </a-form-model-item> <a-form-model-item label="纭鏂板瘑鐮�" prop="newPwdAgain"> - <a-input-password + <a-input + :type="newPwdAgain" v-model="form.newPwdAgain" placeholder="璇峰啀娆¤緭鍏ユ柊瀵嗙爜" - /> + > + <template slot="suffix"> + <i + v-if="newPwdAgain == 'password'" + class="iconfont icon-hidden cursor-pointer" + @click="newPwdAgain = 'text'" + ></i> + <i + v-else + class="iconfont icon-show cursor-pointer" + @click="newPwdAgain = 'password'" + ></i> + </template> + </a-input> </a-form-model-item> </a-form-model> @@ -41,7 +89,7 @@ import { changePassWord } from "@/utils/js/validate"; import { changePassword, LogoutInterface } from "@/api/user"; import { mapMutations } from "vuex"; -// import { encrypt } from "@/utils"; +import { encrypt } from "@/utils"; import storage from "@/utils/js/Storage"; export default { props: { @@ -61,6 +109,9 @@ export default { } }; return { + oldPwd: "password", + newPwd: "password", + newPwdAgain: "password", form: { loginName: "", oldPwd: "", @@ -99,16 +150,16 @@ export default { let _this = this; this.$refs.formData.validate(async (valid) => { if (valid) { - // let obj = { - // loginName: encrypt(this.form.loginName), - // oldPwd: encrypt(this.form.oldPwd), - // newPwd: encrypt(this.form.newPwd), - // }; let obj = { - loginName: this.form.loginName, - oldPwd: this.form.oldPwd, - newPwd: this.form.newPwd, + loginName: encrypt(this.form.loginName), + oldPwd: encrypt(this.form.oldPwd), + newPwd: encrypt(this.form.newPwd), }; + // let obj = { + // loginName: this.form.loginName, + // oldPwd: this.form.oldPwd, + // newPwd: this.form.newPwd, + // }; let res = await changePassword(obj); let { code } = res; if (code === 1) { @@ -128,6 +179,9 @@ export default { }); }, handleClose() { + this.oldPwd = "password"; + this.newPwd = "password"; + this.newPwdAgain = "password"; this.$refs.formData.resetFields(); this.Visible = false; }, diff --git a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditPwd.vue b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditPwd.vue index 142d9460..46808caf 100644 --- a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditPwd.vue +++ b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditPwd.vue @@ -47,7 +47,7 @@ <script> import { changeAccount, changePassWord } from "@/utils/js/validate"; import { editPassword } from "@/api/user"; -// import { encrypt } from "@/utils"; +import { encrypt } from "@/utils"; export default { props: { visibleEditPwd: { @@ -101,14 +101,14 @@ export default { handleOk() { this.$refs.formData.validate(async (valid) => { if (valid) { - // let obj = { - // loginName: encrypt(this.form.loginName), - // newPwd: encrypt(this.form.newPwd), - // }; let obj = { - loginName: this.form.loginName, - newPwd: this.form.newPwd, + loginName: encrypt(this.form.loginName), + newPwd: encrypt(this.form.newPwd), }; + // let obj = { + // loginName: this.form.loginName, + // newPwd: this.form.newPwd, + // }; let res = await editPassword(obj); if (res.code === 1) { this.$message.success("瀵嗙爜淇敼鎴愬姛"); diff --git a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditUser.vue b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditUser.vue index bfb267c0..26163512 100644 --- a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditUser.vue +++ b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/EditUser.vue @@ -69,7 +69,7 @@ import { getListByParentId } from "@/api/area.js"; import { userSave } from "@/api/userManagement.js"; import { TreeSelect } from "ant-design-vue"; const SHOW_PARENT = TreeSelect.SHOW_PARENT; //SHOW_ALL, SHOW_PARENT, SHOW_CHILD -// import { encrypt } from "@/utils"; +import { encrypt } from "@/utils"; export default { data() { return { @@ -181,7 +181,7 @@ export default { ...this.form, areaNames: JSON.stringify(this.form.areaNames), areaCodes: this.form.areaNames.map((v) => v.areaCode).join(","), - // loginName: encrypt(this.form.loginName), + loginName: encrypt(this.form.loginName), }); let { code, msg } = res; if (code === 1) { diff --git a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/addUser.vue b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/addUser.vue index c8ae2122..eede923f 100644 --- a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/addUser.vue +++ b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/components/addUser.vue @@ -93,7 +93,7 @@ import { changeAccount, changePassWord } from "@/utils/js/validate"; import { getListByParentId } from "@/api/area.js"; import { userSave } from "@/api/userManagement.js"; import { TreeSelect } from "ant-design-vue"; -// import { encrypt } from "@/utils"; +import { encrypt } from "@/utils"; const SHOW_PARENT = TreeSelect.SHOW_PARENT; //SHOW_ALL, SHOW_PARENT, SHOW_CHILD export default { data() { @@ -192,8 +192,8 @@ export default { ...this.form, areaCodes: this.form.areaCodes.join(","), areaNames: JSON.stringify(this.changeSelect), - // loginName: encrypt(this.form.loginName), - // loginPwd: encrypt(this.form.loginPwd), + loginName: encrypt(this.form.loginName), + loginPwd: encrypt(this.form.loginPwd), }); let { code, msg } = res; if (code === 1) { -- 2.24.3