提交 e0862d0a 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

login out

上级 45e6f108
...@@ -86,14 +86,27 @@ export default { ...@@ -86,14 +86,27 @@ export default {
vm.$router.push({ path: 'home' }) vm.$router.push({ path: 'home' })
} else { } else {
if(!localStorage.getItem('storageToken')) { if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面 console.log('域名',window.location.host)
return if(window.location.host.indexOf("work.yunqueyi") != -1) {
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面
return;
} else {
this.$router.push('/login')
return;
}
} }
} }
}else { }else {
if(!localStorage.getItem('storageToken')) { if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面 if(window.location.host.indexOf("work.yunqueyi") != -1) {
return
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面
return;
} else {
this.$router.push('/login');
return;
}
} }
} }
vm.changeToken(vm.token) vm.changeToken(vm.token)
......
...@@ -55,7 +55,12 @@ export default { ...@@ -55,7 +55,12 @@ export default {
if(vm.idType == 1) { // 内部 if(vm.idType == 1) { // 内部
window.location.href = getInnerLoginUrl() window.location.href = getInnerLoginUrl()
} else { } else {
window.location.href = getLoginUrl('?from=work&type=logout') if(window.location.host.indexOf("work.yunqueyi") != -1) {
window.location.href = getLoginUrl('?from=work&type=logout')
} else {
this.$router.push('/login')
}
} }
} }
if(command === 'forward') { if(command === 'forward') {
......
...@@ -147,9 +147,16 @@ ...@@ -147,9 +147,16 @@
}, },
goToLogin() { goToLogin() {
this.loginFlag = true this.loginFlag = true
this.resetMobileErr = false;
this.resetCodeErr = false;
this.resetPWDErr = false
this.resetPassword = {}
}, },
goToResetPassword() { goToResetPassword() {
this.loginFlag = false this.loginFlag = false;
this.loginMobileErr = false;
this.loginPWDErr = false
this.loginData = {}
}, },
showVR() { showVR() {
this.showVRCode = true; this.showVRCode = true;
...@@ -184,7 +191,6 @@ ...@@ -184,7 +191,6 @@
deviceInfo: getDeviceInfo() deviceInfo: getDeviceInfo()
}; };
this.saasPOST('/mobiles/sendCaptchaNew',params, 'application/x-www-form-urlencoded;charset=UTF-8').then(data => { this.saasPOST('/mobiles/sendCaptchaNew',params, 'application/x-www-form-urlencoded;charset=UTF-8').then(data => {
console.log('返回结果', data)
if (data.mobileFlag == 2) { if (data.mobileFlag == 2) {
this.resetMobileErr = true; this.resetMobileErr = true;
this.resetMobileErrText = '该手机号尚未注册!'; this.resetMobileErrText = '该手机号尚未注册!';
...@@ -243,10 +249,8 @@ ...@@ -243,10 +249,8 @@
ipAddress: localStorage.getItem("ipAddress"), ipAddress: localStorage.getItem("ipAddress"),
password: md5(this.loginData.password).toUpperCase(), password: md5(this.loginData.password).toUpperCase(),
token: localStorage.getItem("token"), token: localStorage.getItem("token"),
} };
console.log('params',params)
this.saasGET('/registers/saasLogin',params).then(data => { this.saasGET('/registers/saasLogin',params).then(data => {
console.log('返回结果', data)
if (data.mobileFlag == 1) { if (data.mobileFlag == 1) {
/*this.$message({ /*this.$message({
message: '手机号或密码不正确!', message: '手机号或密码不正确!',
...@@ -266,6 +270,7 @@ ...@@ -266,6 +270,7 @@
return; return;
} }
localStorage.setItem("token", data.token); localStorage.setItem("token", data.token);
localStorage.setItem("storageToken", data.token);
localStorage.setItem('doctorId',data.picapDoctor.id); localStorage.setItem('doctorId',data.picapDoctor.id);
localStorage.setItem("mobilePhone", params.mobile); localStorage.setItem("mobilePhone", params.mobile);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册