From b322b2bad8b2f9b88521c9ffbbe7e77282b9fe2e Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期四, 08 七月 2021 18:06:45 +0800 Subject: [PATCH] 头像修改 --- src/pages/desktop/index/components/Tools.vue | 62 ++++++++++-------------------- 1 files changed, 21 insertions(+), 41 deletions(-) diff --git a/src/pages/desktop/index/components/Tools.vue b/src/pages/desktop/index/components/Tools.vue index f968873..19faa18 100644 --- a/src/pages/desktop/index/components/Tools.vue +++ b/src/pages/desktop/index/components/Tools.vue @@ -73,10 +73,10 @@ <script> import html2canvas from 'html2canvas'; -import { logout,updatePwd } from "@/api/login"; +import { logout, updatePwd } from "@/api/login"; export default { name: "Tools", - data () { + data() { var validatePass = (rule, value, callback) => { if (value === '') { callback(new Error('璇疯緭鍏ュ瘑鐮�')); @@ -104,9 +104,9 @@ maxOrderOne: '', userInfo: {}, showPasswdForm: false, - rules:{ + rules: { oldPwd: [ - {required: true, message: '璇疯緭鍏ユ棫瀵嗙爜', trigger: 'blur'} + { required: true, message: '璇疯緭鍏ユ棫瀵嗙爜', trigger: 'blur' } ], newPwd: [ { required: true, validator: validatePass, trigger: 'blur' } @@ -123,37 +123,19 @@ }; }, - created () { + created() { let _that = this; this.userInfo = sessionStorage.getItem("userInfo") && JSON.parse(sessionStorage.getItem("userInfo")); console.log(this.userInfo) if (window.toolIntervalArr) { window.toolIntervalArr.forEach(item => clearInterval(item)); } - window.toolIntervalArr = [ setInterval(function () { _that.notificationCenterMessageCount += 1; }, 600) ]; }, - // watch:{ - // '$store.state.desktop.frames':{ - // handler(n,o){ - // if(n){ - // ; - // n.forEach((item,index) => { - // if(item.order >= this.maxOrder){ - // this.maxOrderOne = item.id; - // } - // }); - // } - // }, - // deep: true - // } - // }, - - methods: { submitForm(formName) { this.$refs[formName].validate((valid) => { @@ -162,13 +144,13 @@ oldPwd: this.passwdForm.oldPwd, newPwd: this.passwdForm.checkPwd } - updatePwd(json).then(res=>{ - console.log(res,'淇敼瀵嗙爜') + updatePwd(json).then(res => { + console.log(res, '淇敼瀵嗙爜') this.$notify({ - type:res.success?'success':'error', - message:res.msg + type: res.success ? 'success' : 'error', + message: res.msg }) - if(res.success){ + if (res.success) { this.showPasswdForm = false // this.$nextTick(_=>{ // this.toLogout('淇敼瀵嗙爜鎴愬姛锛岃閲嶆柊鐧诲綍锛�') @@ -198,7 +180,7 @@ ); }, - togglePreference () { + togglePreference() { //this.$store.commit("desktop/togglePreference"); //鏄剧ず妗岄潰,鏈�灏忓寲宸叉墦寮�鐨勫簲鐢� ; @@ -212,7 +194,7 @@ }); }) }, - dockClick (dock) { + dockClick(dock) { if (dock.type === "1") { window.open(dock.url); @@ -229,11 +211,11 @@ this.$store.commit("desktop/refreshFrame", dock); } }, - toolHover (dock) { + toolHover(dock) { //this.$parent.screenShot(dock) }, - toLogout () { + toLogout() { let _this = this; this.$confirm("鎻愮ず锛氱‘瀹氶��鍑哄悧锛�", { center: true, @@ -241,15 +223,13 @@ confirmButtonClass: "comfirm-class-sure" }).then(_ => { logout().then(res => { - if (res === "閫�鍑烘垚鍔�") { - sessionStorage.removeItem("userInfo"); - _this.userInfo = {}; + if (res.success) { + this.$notify.success(res.msg); location.assign('/view/index'); - this.$notify({ - title: "鎻愮ず", - type: "success", - message: "閫�鍑烘垚鍔燂紒" - }); + sessionStorage.removeItem("userInfo"); + // 鎵嬪姩閫�鍑�, 鍙栨秷鑷姩鐧诲綍 + sessionStorage.removeItem("autoLogin"); + _this.userInfo = {}; } else { this.$notify({ title: "鎻愮ず", @@ -297,7 +277,7 @@ .tools .tools-middle::before { width: 1px; height: 20px; - content: ''; + content: ""; position: absolute; top: 10px; left: 0; -- Gitblit v1.8.0