Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
Support
提交反馈
为 GitLab 提交贡献
登录/注册
切换导航
M
mcep-h5
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
jiangzaicheng
mcep-h5
提交
e044929d
提交
e044929d
编写于
11月 09, 2022
作者:
“grape”
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化 登录注册与密码修改
上级
68d1b995
变更
4
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
124 行增加
和
25 行删除
+124
-25
forget-pass-mgt.ts
src/constants/api/login/forget-pass-mgt.ts
+1
-1
LoginView.vue
src/views/authentication/LoginView.vue
+47
-10
ForgetPassView.vue
src/views/login/ForgetPassView.vue
+37
-8
Register.vue
src/views/login/Register.vue
+39
-6
未找到文件。
src/constants/api/login/forget-pass-mgt.ts
浏览文件 @
e044929d
...
@@ -21,7 +21,7 @@ const prefix = process.env.VUE_APP_MS_GATEWAY_API + "/ms-system/api/v1/cust-logi
...
@@ -21,7 +21,7 @@ const prefix = process.env.VUE_APP_MS_GATEWAY_API + "/ms-system/api/v1/cust-logi
const
forgetPassAPI
=
{
const
forgetPassAPI
=
{
ForgetPass
:
{
ForgetPass
:
{
url
:
prefix
+
"
/
change
Password
"
,
url
:
prefix
+
"
/
forget
Password
"
,
method
:
MethodType
.
POST
.
code
,
method
:
MethodType
.
POST
.
code
,
header
:
HeaderType
.
AUTH
.
code
,
header
:
HeaderType
.
AUTH
.
code
,
},
},
...
...
src/views/authentication/LoginView.vue
浏览文件 @
e044929d
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
</van-field>
</van-field>
</van-col>
</van-col>
<van-col
span=
"8"
style=
"height:24px; border-bottom: 1px solid #f5f5f5;"
><a
style=
" color:#3672F1; display:inline-block;font-size:12px;line-height:24px; margin-left: 25%;"
@
click=
"getPhonePost()"
>
{{ getCmstotal }}
</a></van-col>
<van-col
span=
"8"
style=
"height:24px; border-bottom: 1px solid #f5f5f5;"
><a
:class=
"smsCss"
style=
" color:#3672F1; display:inline-block;font-size:12px;line-height:24px; margin-left: 25%;"
@
click=
"getPhonePost()"
>
{{ getCmstotal }}
</a></van-col>
</van-row>
</van-row>
</div>
</div>
...
@@ -120,6 +120,8 @@ import { log } from "mathjs";
...
@@ -120,6 +120,8 @@ import { log } from "mathjs";
[
VanImage
.
name
]:
VanImage
,
[
VanImage
.
name
]:
VanImage
,
})
})
export
default
class
LoginView
extends
Vue
{
export
default
class
LoginView
extends
Vue
{
smsCss
=
""
getCmstotal
=
"
获取验证码
"
;
getCmstotal
=
"
获取验证码
"
;
tatleName
=
"
用户登录
"
;
tatleName
=
"
用户登录
"
;
loginNo
:
string
=
""
;
//登录账号
loginNo
:
string
=
""
;
//登录账号
...
@@ -135,8 +137,20 @@ export default class LoginView extends Vue {
...
@@ -135,8 +137,20 @@ export default class LoginView extends Vue {
//方法
//方法
created
(){
created
(){
//获取保存的登录账号
if
(
localStorage
.
getItem
(
"
loginNo
"
)
!=
null
)
if
(
localStorage
.
getItem
(
"
loginNo
"
)
!=
null
)
this
.
loginNo
=
String
(
localStorage
.
getItem
(
"
loginNo
"
));
this
.
loginNo
=
String
(
localStorage
.
getItem
(
"
loginNo
"
));
//获取验证码剩余时间,并启动倒计时 ,禁用超链接
if
(
localStorage
.
getItem
(
"
smsTime
"
)
!=
null
){
this
.
time
=
Number
(
localStorage
.
getItem
(
"
smsTime
"
));
this
.
changeCmstotal
();
this
.
smsCss
=
"
smsCss
"
this
.
noChange
(
this
.
loginNo
);
}
}
}
noChange
(
s
:
string
){
noChange
(
s
:
string
){
...
@@ -173,38 +187,57 @@ export default class LoginView extends Vue {
...
@@ -173,38 +187,57 @@ export default class LoginView extends Vue {
}
}
});
});
}
}
//计时器
//计时器TODO 多次点击
changeCmstotal
()
{
changeCmstotal
()
{
localStorage
.
setItem
(
"
smsTime
"
,
String
(
this
.
time
))
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
time
--
;
this
.
time
--
;
//倒计时存入localStorage 防止刷新页面 丢失
localStorage
.
setItem
(
"
smsTime
"
,
String
(
this
.
time
))
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
if
(
this
.
time
<
0
)
{
if
(
this
.
time
<
0
)
{
clearInterval
(
this
.
time
)
localStorage
.
removeItem
(
"
smsTime
"
);
this
.
getCmstotal
=
"
获取短信验证码
"
;
this
.
smsCss
=
""
clearInterval
(
this
.
timer
)
this
.
getCmstotal
=
"
获取验证码
"
;
}
}
},
1000
)
},
1000
)
}
}
//获取短信验证码
//获取短信验证码
getPhonePost
()
{
getPhonePost
()
{
let
param
=
{
let
param
=
{
phoneCode
:
this
.
loginNo
phoneCode
:
this
.
loginNo
}
}
//禁用 超链接并设置倒计时时间
this
.
smsCss
=
"
smsCss
"
this
.
time
=
60
;
apiService
.
general
(
commonApi
.
getPicCode
,
param
,
undefined
,
undefined
).
then
((
response
:
RestfulResponse
)
=>
{
apiService
.
general
(
commonApi
.
getPicCode
,
param
,
undefined
,
undefined
).
then
((
response
:
RestfulResponse
)
=>
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
Toast
(
'
短信发送成功,5分钟有效
'
);
Toast
(
'
短信发送成功,5分钟有效
'
);
//开始倒计时
this
.
changeCmstotal
()
this
.
changeCmstotal
()
}
else
{
}
else
{
Toast
(
'
短信发送失败,请重试
'
);
Toast
(
'
短信发送失败,请重试
'
);
//取消不可点击
this
.
smsCss
=
""
//删除缓存
localStorage
.
removeItem
(
"
smsTime
"
)
//删除定时任务
clearInterval
(
this
.
timer
)
}
}
})
})
}
}
loginSystem
()
{
loginSystem
()
{
//TODO
//登录失败刷新
//验证码失败刷新
//this._updatePicCode();
//this._updatePicCode();
let
param
=
{
let
param
=
{
loginNo
:
this
.
loginNo
,
loginNo
:
this
.
loginNo
,
...
@@ -231,10 +264,10 @@ export default class LoginView extends Vue {
...
@@ -231,10 +264,10 @@ export default class LoginView extends Vue {
}
}
})
})
//登录成功后保存账号
//登录成功后保存账号
localStorage
.
setItem
(
'
loginNo
'
,
this
.
loginNo
);
//
localStorage.setItem('loginNo', this.loginNo);
}
else
{
}
else
{
// this._updatePicCode();
// this._updatePicCode();
Toast
(
response
.
msg
+
""
);
//
Toast(response.msg + "");
}
}
});
});
}
}
...
@@ -330,6 +363,10 @@ export default class LoginView extends Vue {
...
@@ -330,6 +363,10 @@ export default class LoginView extends Vue {
background-color
:
#fff
;
background-color
:
#fff
;
}
}
::v-deep
.smsCss
{
cursor
:
pointer
;
pointer-events
:
none
;
}
// .login{
// .login{
// margin-top: 20%;
// margin-top: 20%;
// }
// }
...
...
src/views/login/ForgetPassView.vue
浏览文件 @
e044929d
...
@@ -130,6 +130,7 @@ import forgetPassAPI from "@/constants/api/login/forget-pass-mgt";
...
@@ -130,6 +130,7 @@ import forgetPassAPI from "@/constants/api/login/forget-pass-mgt";
[
VanImage
.
name
]:
VanImage
,
[
VanImage
.
name
]:
VanImage
,
})
})
export
default
class
ForgetPassView
extends
Vue
{
export
default
class
ForgetPassView
extends
Vue
{
smsCss
=
""
password
=
"
password
"
;
password
=
"
password
"
;
passwordType
=
"
password
"
passwordType
=
"
password
"
passwordTypeNext
=
"
password
"
passwordTypeNext
=
"
password
"
...
@@ -173,20 +174,33 @@ export default class ForgetPassView extends Vue {
...
@@ -173,20 +174,33 @@ export default class ForgetPassView extends Vue {
}
}
//计时器
//计时器
changeCmstotal
()
{
changeCmstotal
()
{
localStorage
.
setItem
(
"
smsTime
"
,
String
(
this
.
time
))
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
time
--
;
this
.
time
--
;
//倒计时存入localStorage 防止刷新页面 丢失
localStorage
.
setItem
(
"
smsTime
"
,
String
(
this
.
time
))
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
if
(
this
.
time
<
0
)
{
if
(
this
.
time
<
0
)
{
clearInterval
(
this
.
time
);
localStorage
.
removeItem
(
"
smsTime
"
);
this
.
smsCss
=
""
clearInterval
(
this
.
timer
)
this
.
getCmstotal
=
"
获取验证码
"
;
this
.
getCmstotal
=
"
获取验证码
"
;
}
}
},
1000
);
},
1000
)
}
}
getPhonePost
()
{
getPhonePost
()
{
let
param
=
{
let
param
=
{
phoneCode
:
this
.
loginNo
,
phoneCode
:
this
.
loginNo
,
};
};
//禁用 超链接并设置倒计时时间
this
.
smsCss
=
"
smsCss
"
this
.
time
=
60
;
apiService
apiService
.
general
(
commonApi
.
getPicCode
,
param
,
undefined
,
undefined
)
.
general
(
commonApi
.
getPicCode
,
param
,
undefined
,
undefined
)
.
then
((
response
:
RestfulResponse
)
=>
{
.
then
((
response
:
RestfulResponse
)
=>
{
...
@@ -194,23 +208,30 @@ export default class ForgetPassView extends Vue {
...
@@ -194,23 +208,30 @@ export default class ForgetPassView extends Vue {
Toast
(
"
短信发送成功,5分钟有效
"
);
Toast
(
"
短信发送成功,5分钟有效
"
);
this
.
changeCmstotal
();
this
.
changeCmstotal
();
}
else
{
}
else
{
Toast
(
"
短信发送失败,请重试
"
);
Toast
(
String
(
response
.
msg
));
this
.
getCmstotal
=
"
获取验证码
"
;
//取消不可点击
this
.
smsCss
=
""
//删除缓存
localStorage
.
removeItem
(
"
smsTime
"
)
//删除定时任务
clearInterval
(
this
.
timer
)
}
}
});
});
}
}
onSubmit
(
values
:
any
)
{
onSubmit
(
values
:
any
)
{
let
param
=
{
let
param
=
{
loginNo
:
this
.
loginNo
,
phone
:
this
.
loginNo
,
newPassword
:
this
.
newpassword
,
newPassword
:
this
.
newpassword
,
phoneVerifyCode
:
this
.
sms
,
phoneVerifyCode
:
this
.
sms
,
requirePassword
:
this
.
restpassword
requirePassword
:
this
.
restpassword
};
};
apiService
apiService
.
general
(
forgetPassAPI
.
ForgetPass
,
param
,
undefined
,
undefined
)
.
general
(
forgetPassAPI
.
ForgetPass
,
undefined
,
param
,
undefined
)
.
then
((
response
:
RestfulResponse
)
=>
{
.
then
((
response
:
RestfulResponse
)
=>
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
this
.
$router
.
push
({
this
.
$router
.
replace
({
name
:
`Mianview
`
,
path
:
`/login
`
,
params
:
{
params
:
{
data
:
response
.
data
data
:
response
.
data
}
}
...
@@ -220,6 +241,14 @@ export default class ForgetPassView extends Vue {
...
@@ -220,6 +241,14 @@ export default class ForgetPassView extends Vue {
}
}
created
()
{
created
()
{
this
.
$nextTick
(()
=>
this
.
_updatePicCode
());
this
.
$nextTick
(()
=>
this
.
_updatePicCode
());
//获取验证码剩余时间,并启动倒计时 ,禁用超链接
if
(
localStorage
.
getItem
(
"
smsTime
"
)
!=
null
){
this
.
time
=
Number
(
localStorage
.
getItem
(
"
smsTime
"
));
this
.
changeCmstotal
();
this
.
smsCss
=
"
smsCss
"
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/login/Register.vue
浏览文件 @
e044929d
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</van-field>
</van-field>
</van-col>
</van-col>
<van-col
span=
"8"
style=
"height:24px; border-bottom: 1px solid #f5f5f5;"
><a
style=
" color:#3672F1; display:inline-block;font-size:12px;line-height:24px; margin-left: 25%;"
@
click=
"getPhonePost()"
>
{{
getCmstotal
}}
</a></van-col>
<van-col
span=
"8"
style=
"height:24px; border-bottom: 1px solid #f5f5f5;"
><a
:class=
"smsCss"
style=
" color:#3672F1; display:inline-block;font-size:12px;line-height:24px; margin-left: 25%;"
@
click=
"getPhonePost()"
>
{{
getCmstotal
}}
</a></van-col>
</van-row>
</van-row>
<!--
<van-divider
:style=
"
{ margin: 0 }">
</van-divider>
-->
<!--
<van-divider
:style=
"
{ margin: 0 }">
</van-divider>
-->
</div>
</div>
...
@@ -122,6 +122,7 @@ import { Toast } from "vant";
...
@@ -122,6 +122,7 @@ import { Toast } from "vant";
name
:
"
ForgetPassView
"
,
name
:
"
ForgetPassView
"
,
})
})
export
default
class
ForgetPassView
extends
Vue
{
export
default
class
ForgetPassView
extends
Vue
{
smsCss
=
""
tatleName
=
"
用户注册
"
tatleName
=
"
用户注册
"
idCard
=
""
idCard
=
""
phone
:
string
=
""
//电话
phone
:
string
=
""
//电话
...
@@ -139,6 +140,8 @@ export default class ForgetPassView extends Vue {
...
@@ -139,6 +140,8 @@ export default class ForgetPassView extends Vue {
showCode
=
false
;
showCode
=
false
;
//方法
//方法
noChange
(
s
:
string
){
noChange
(
s
:
string
){
if
(
this
.
verifyPhone
(
s
)){
if
(
this
.
verifyPhone
(
s
)){
this
.
showCode
=
true
;
this
.
showCode
=
true
;
...
@@ -177,7 +180,7 @@ export default class ForgetPassView extends Vue {
...
@@ -177,7 +180,7 @@ export default class ForgetPassView extends Vue {
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
`Mianview
`
,
path
:
`/login
`
,
params
:
{
params
:
{
data
:
response
.
data
data
:
response
.
data
}
}
...
@@ -187,31 +190,49 @@ export default class ForgetPassView extends Vue {
...
@@ -187,31 +190,49 @@ export default class ForgetPassView extends Vue {
});
});
}
}
}
}
//计时器
//计时器
changeCmstotal
()
{
changeCmstotal
()
{
localStorage
.
setItem
(
"
smsTime
"
,
String
(
this
.
time
))
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
time
--
;
this
.
time
--
;
//倒计时存入localStorage 防止刷新页面 丢失
localStorage
.
setItem
(
"
smsTime
"
,
String
(
this
.
time
))
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
this
.
getCmstotal
=
this
.
time
+
"
s重发验证码
"
;
if
(
this
.
time
<
0
)
{
if
(
this
.
time
<
0
)
{
clearInterval
(
this
.
time
)
localStorage
.
removeItem
(
"
smsTime
"
);
this
.
smsCss
=
""
clearInterval
(
this
.
timer
)
this
.
getCmstotal
=
"
获取验证码
"
;
this
.
getCmstotal
=
"
获取验证码
"
;
}
}
},
1000
)
},
1000
)
}
}
getPhonePost
()
{
getPhonePost
()
{
let
param
=
{
let
param
=
{
phoneCode
:
this
.
phone
phoneCode
:
this
.
phone
}
}
//禁用 超链接并设置倒计时时间
this
.
smsCss
=
"
smsCss
"
this
.
time
=
60
;
apiService
.
general
(
commonApi
.
getPicCode
,
param
,
undefined
,
undefined
).
then
((
response
:
RestfulResponse
)
=>
{
apiService
.
general
(
commonApi
.
getPicCode
,
param
,
undefined
,
undefined
).
then
((
response
:
RestfulResponse
)
=>
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
if
(
response
.
code
==
Code
.
SUCCESS
.
code
)
{
Toast
(
'
短信发送成功,5分钟有效
'
);
Toast
(
'
短信发送成功,5分钟有效
'
);
//开始倒计时
this
.
changeCmstotal
()
this
.
changeCmstotal
()
}
else
{
}
else
{
Toast
(
'
短信发送失败,请重试
'
);
Toast
(
'
短信发送失败,请重试
'
);
//取消不可点击
this
.
smsCss
=
""
//删除缓存
localStorage
.
removeItem
(
"
smsTime
"
)
//删除定时任务
clearInterval
(
this
.
timer
)
}
}
})
})
...
@@ -220,6 +241,14 @@ export default class ForgetPassView extends Vue {
...
@@ -220,6 +241,14 @@ export default class ForgetPassView extends Vue {
created
()
{
created
()
{
//获取验证码剩余时间,并启动倒计时 ,禁用超链接
if
(
localStorage
.
getItem
(
"
smsTime
"
)
!=
null
){
this
.
time
=
Number
(
localStorage
.
getItem
(
"
smsTime
"
));
this
.
changeCmstotal
();
this
.
smsCss
=
"
smsCss
"
}
}
}
returen
()
{
returen
()
{
...
@@ -289,6 +318,10 @@ export default class ForgetPassView extends Vue {
...
@@ -289,6 +318,10 @@ export default class ForgetPassView extends Vue {
background-color
:
#fff
;
background-color
:
#fff
;
}
}
::v-deep
.smsCss
{
cursor
:
pointer
;
pointer-events
:
none
;
}
// .login{
// .login{
// margin-top: 20%;
// margin-top: 20%;
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录