Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
d2458369
提交
d2458369
编写于
11月 18, 2019
作者:
yi.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
登录成功后增加协议校验功能
上级
b493ea94
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
54 行增加
和
8 行删除
+54
-8
accountApi.js
src/utils/account/accountApi.js
+11
-0
login.vue
src/views/login.vue
+43
-8
未找到文件。
src/utils/account/accountApi.js
浏览文件 @
d2458369
...
@@ -74,4 +74,15 @@ export const handleResetPWD = data => {
...
@@ -74,4 +74,15 @@ export const handleResetPWD = data => {
})
})
}
}
// 判断是否同意协议
export
const
handleAgreement
=
data
=>
{
return
fetch
({
headers
,
url
:
getBaseUrl
(
`api-ws/agreements/consent`
),
method
:
'get'
,
params
:
data
,
description
:
'检查用户同意的协议'
,
})
}
src/views/login.vue
浏览文件 @
d2458369
...
@@ -98,9 +98,10 @@
...
@@ -98,9 +98,10 @@
<
script
>
<
script
>
let
vm
=
null
let
vm
=
null
import
{
ssoLogin2
,
getDeviceInfo
}
from
'@/utils/utils'
;
import
{
ssoLogin2
,
getDeviceInfo
}
from
'@/utils/utils'
;
import
{
getSaasDomain
}
from
'@/utils/index'
;
import
{
mapActions
}
from
'vuex'
;
import
{
mapActions
}
from
'vuex'
;
import
md5
from
'js-md5'
;
import
md5
from
'js-md5'
;
import
{
handleLogin
,
handleGetCaptcha
,
handleGetAuthCode
,
handleResetPWD
}
from
'@/utils/account/accountApi'
;
import
{
handleLogin
,
handleGetCaptcha
,
handleGetAuthCode
,
handleResetPWD
,
handleAgreement
,
handleLogout
}
from
'@/utils/account/accountApi'
;
export
default
{
export
default
{
...
@@ -233,7 +234,7 @@
...
@@ -233,7 +234,7 @@
this
.
resetMobileErr
=
false
;
this
.
resetMobileErr
=
false
;
this
.
resetMobileErrText
=
''
;
this
.
resetMobileErrText
=
''
;
}
}
if
(
!
this
.
resetPassword
.
captchaAnswer
){
if
(
!
this
.
resetPassword
.
captchaAnswer
){
this
.
resetCaptchaErr
=
true
;
this
.
resetCaptchaErr
=
true
;
this
.
resetCaptchaErrText
=
'请输入图形验证码'
;
this
.
resetCaptchaErrText
=
'请输入图形验证码'
;
...
@@ -312,7 +313,7 @@
...
@@ -312,7 +313,7 @@
},
1000
)
},
1000
)
}
}
}
}
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
$message
({
this
.
$message
({
message
:
'系统错误!'
,
message
:
'系统错误!'
,
...
@@ -324,7 +325,7 @@
...
@@ -324,7 +325,7 @@
// ------------------------ New End-------------------------------
// ------------------------ New End-------------------------------
},
},
login
()
{
login
()
{
if
(
!
this
.
loginData
.
mobile
)
{
if
(
!
this
.
loginData
.
mobile
)
{
this
.
loginMobileErr
=
true
;
this
.
loginMobileErr
=
true
;
...
@@ -421,8 +422,11 @@
...
@@ -421,8 +422,11 @@
localStorage
.
setItem
(
'doctorId'
,
res
.
data
.
userId
);
localStorage
.
setItem
(
'doctorId'
,
res
.
data
.
userId
);
localStorage
.
setItem
(
"mobilePhone"
,
paramsObj
.
mobile
);
localStorage
.
setItem
(
"mobilePhone"
,
paramsObj
.
mobile
);
sessionStorage
.
setItem
(
"mobile"
,
paramsObj
.
mobile
);
sessionStorage
.
setItem
(
"mobile"
,
paramsObj
.
mobile
);
this
.
$router
.
push
(
'/'
);
//
this.$router.push('/');
alert
(
'登录成功'
)
//新增协议校验
this
.
checkAgreement
();
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
$message
({
this
.
$message
({
message
:
'系统错误!'
,
message
:
'系统错误!'
,
...
@@ -484,7 +488,7 @@
...
@@ -484,7 +488,7 @@
}
}
// ------------------------ Old Start-------------------------------
// ------------------------ Old Start-------------------------------
// let para = {
// let para = {
// mobile: this.resetPassword.mobile,
// mobile: this.resetPassword.mobile,
// authCode: this.resetPassword.authCode
// authCode: this.resetPassword.authCode
...
@@ -543,7 +547,7 @@
...
@@ -543,7 +547,7 @@
type
:
'error'
type
:
'error'
});
});
}
}
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
$message
({
this
.
$message
({
message
:
'系统错误!'
,
message
:
'系统错误!'
,
...
@@ -554,7 +558,38 @@
...
@@ -554,7 +558,38 @@
this
.
sendEncryptRequest
(
paramsObj
,
resetPWDCB
)
this
.
sendEncryptRequest
(
paramsObj
,
resetPWDCB
)
// ------------------------ New End-------------------------------
// ------------------------ New End-------------------------------
}
},
//新增协议校验
checkAgreement
()
{
let
mobilePhone
=
localStorage
.
getItem
(
"mobilePhone"
);
if
(
mobilePhone
)
{
let
para
=
{
mobilePhone
:
mobilePhone
,
agreementType
:
1
};
handleAgreement
(
para
).
then
(
res
=>
{
if
(
res
.
code
==
'000000'
)
{
const
arr
=
res
.
data
;
if
(
arr
.
length
&&
arr
.
length
==
1
)
{
window
.
location
.
href
=
getSaasDomain
(
`pica-base/pica_do_agree.html?agreementType=
${
arr
[
0
]}
`
);
}
else
if
(
arr
.
length
&&
arr
.
length
==
2
)
{
window
.
location
.
href
=
getSaasDomain
(
`pica-base/pica_do_agree.html?agreementType=
${
arr
[
0
]}
&agreementType2=
${
arr
[
1
]}
`
);
}
else
{
this
.
$router
.
push
(
'/'
);
}
}
else
{
// 新增 调用后端退出登录接口
handleLogout
();
localStorage
.
removeItem
(
'storageToken'
)
}
}).
catch
(
err
=>
{
this
.
$message
({
message
:
'系统错误!'
,
type
:
'error'
});
})
}
},
}
}
}
}
</
script
>
</
script
>
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录