Commit 11f0d83b by 无尘

add: 增加修改密码退出登录,跳转登录页

parent 77a14626
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "@gic-test/vue-gic-header", "name": "@gic-test/vue-gic-header",
"description": "vue-gic-header Plugin", "description": "vue-gic-header Plugin",
"author": "fairyly <498745097@qq.com>", "author": "fairyly <498745097@qq.com>",
"version": "1.3.33", "version": "1.3.35",
"license": "MIT", "license": "MIT",
"private": false, "private": false,
"main": "dist/vue-gic-header.js", "main": "dist/vue-gic-header.js",
......
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,7 @@
return false; return false;
} }
if (that.passwordForm.newPassword.trim() != that.passwordForm.confirmNewPassword.trim()) { if (that.passwordForm.newPassword.trim() != that.passwordForm.confirmNewPassword.trim()) {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: "两次密码输入不一致!" message: "两次密码输入不一致!"
...@@ -428,12 +428,12 @@ ...@@ -428,12 +428,12 @@
// console.log(res,res.data,res.data.errorCode) // console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
that.passFormVisible = false; that.passFormVisible = false;
that.$message({ that.$message({
message: '修改成功', message: '修改成功',
type: 'success' type: 'success'
}) })
that.postLoginOut();
return; return;
} }
that.$message.error({ that.$message.error({
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
if (!valid) { if (!valid) {
return; return;
} }
that. modifyUserPassword() that.modifyUserPassword()
}) })
}, },
...@@ -483,20 +483,29 @@ ...@@ -483,20 +483,29 @@
//退出登录 //退出登录
toLoginOut() { toLoginOut() {
var that = this; var that = this;
// var para = {
// requestProject: that.repProjectName
// }
that.$confirm('确认退出吗?', '提示', { that.$confirm('确认退出吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
that.postLoginOut()
}).catch(() => {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
},
that.axios.post(that.baseUrl+'/api-auth/do-logout',{}) // 退出请求
postLoginOut() {
const that = this;
that.axios.post(that.baseUrl+'/api-auth/do-logout',{})
.then((res) => { .then((res) => {
// console.log(res,res.data,res.data.errorCode) // console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
// console.log(that.cliqueFlag) // console.log(that.cliqueFlag)
that.$message({ that.$message({
message: '退出成功', message: '退出成功',
type: 'success' type: 'success'
...@@ -508,7 +517,6 @@ ...@@ -508,7 +517,6 @@
// if (that.cliqueFlag == false) { // if (that.cliqueFlag == false) {
// window.location.href = window.location.origin + '/gic-clique'; // window.location.href = window.location.origin + '/gic-clique';
// } // }
return; return;
} }
that.$message.error({ that.$message.error({
...@@ -519,21 +527,11 @@ ...@@ -519,21 +527,11 @@
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: error.message message: error.message
}) })
}); });
}).catch(() => {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
}, },
// 判断当前商户是否是集团关联商户 // 判断当前商户是否是集团关联商户
...@@ -554,11 +552,9 @@ ...@@ -554,11 +552,9 @@
duration: 1000, duration: 1000,
message: resData.message message: resData.message
}) })
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: error.message message: error.message
...@@ -590,7 +586,6 @@ ...@@ -590,7 +586,6 @@
// console.log(res,res.data,res.data.errorCode) // console.log(res,res.data,res.data.errorCode)
var resData = res.data var resData = res.data
if (resData.errorCode == 0) { if (resData.errorCode == 0) {
that.userInfo.realName = resData.result.realName; that.userInfo.realName = resData.result.realName;
that.userInfo.gender = resData.result.clerkGender; that.userInfo.gender = resData.result.clerkGender;
that.userInfo.clerkCode = resData.result.clerkCode; that.userInfo.clerkCode = resData.result.clerkCode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment