Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
f46166a5
Commit
f46166a5
authored
Aug 28, 2021
by
季圣华
Browse files
优化登录和注册页面
parent
dc516d43
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/views/user/Login.vue
View file @
f46166a5
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
size=
"large"
size=
"large"
v-decorator=
"['loginName',
{initialValue:'', rules: validatorRules.loginName.rules}]"
v-decorator=
"['loginName',
{initialValue:'', rules: validatorRules.loginName.rules}]"
type="text"
type="text"
placeholder="请输入
帐
户名">
placeholder="请输入
用
户名">
<a-icon
slot=
"prefix"
type=
"user"
:style=
"
{ color: 'rgba(0,0,0,.25)' }"/>
<a-icon
slot=
"prefix"
type=
"user"
:style=
"
{ color: 'rgba(0,0,0,.25)' }"/>
</a-input>
</a-input>
</a-form-item>
</a-form-item>
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
<a-form-item>
<a-form-item>
<a-checkbox
v-decorator=
"['rememberMe',
{initialValue: true, valuePropName: 'checked'}]" >自动登陆
</a-checkbox>
<a-checkbox
v-decorator=
"['rememberMe',
{initialValue: true, valuePropName: 'checked'}]" >自动登陆
</a-checkbox>
<router-link
:to=
"
{ name: 'register'}" class="forge-password" style="float: right;margin-right: 10px" >
<router-link
:to=
"
{ name: 'register'}" class="forge-password" style="float: right;margin-right: 10px
;
" >
注册
账
户
注册
租
户
</router-link>
</router-link>
</a-form-item>
</a-form-item>
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
//loginParams.remember_me = values.rememberMe
//loginParams.remember_me = values.rememberMe
console
.
log
(
"
登录参数
"
,
loginParams
)
console
.
log
(
"
登录参数
"
,
loginParams
)
that
.
Login
(
loginParams
).
then
((
res
)
=>
{
that
.
Login
(
loginParams
).
then
((
res
)
=>
{
this
.
departConfirm
(
res
)
this
.
departConfirm
(
res
,
loginParams
.
loginName
)
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
that
.
requestFailed
(
err
);
that
.
requestFailed
(
err
);
});
});
...
@@ -157,9 +157,6 @@
...
@@ -157,9 +157,6 @@
if
(
res
.
data
.
user
.
loginName
===
'
admin
'
){
if
(
res
.
data
.
user
.
loginName
===
'
admin
'
){
let
desc
=
'
admin只是平台运维用户,真正的管理员是租户(测试账号为jsh),admin不能编辑任何业务数据,只能配置平台菜单和创建租户
'
let
desc
=
'
admin只是平台运维用户,真正的管理员是租户(测试账号为jsh),admin不能编辑任何业务数据,只能配置平台菜单和创建租户
'
this
.
$message
.
info
(
desc
,
30
)
this
.
$message
.
info
(
desc
,
30
)
}
else
if
(
res
.
data
.
user
.
loginName
===
'
jsh
'
){
let
desc
=
'
当前为测试用户,数据会被重置,正式体验请注册!
'
this
.
$message
.
info
(
desc
,
10
)
}
}
}
}
this
.
initMPropertyShort
();
this
.
initMPropertyShort
();
...
@@ -182,7 +179,7 @@
...
@@ -182,7 +179,7 @@
generateCode
(
value
){
generateCode
(
value
){
this
.
verifiedCode
=
value
.
toLowerCase
()
this
.
verifiedCode
=
value
.
toLowerCase
()
},
},
departConfirm
(
res
){
departConfirm
(
res
,
loginName
){
if
(
res
.
code
==
200
){
if
(
res
.
code
==
200
){
let
err
=
{};
let
err
=
{};
if
(
res
.
data
.
msgTip
==
'
user can login
'
){
if
(
res
.
data
.
msgTip
==
'
user can login
'
){
...
@@ -202,7 +199,11 @@
...
@@ -202,7 +199,11 @@
this
.
requestFailed
(
err
)
this
.
requestFailed
(
err
)
this
.
Logout
();
this
.
Logout
();
}
else
if
(
res
.
data
.
msgTip
==
'
tenant is black
'
){
}
else
if
(
res
.
data
.
msgTip
==
'
tenant is black
'
){
err
.
message
=
'
用户所属的租户被禁用
'
;
if
(
loginName
===
'
jsh
'
)
{
err
.
message
=
'
jsh用户已停用,请注册租户进行体验!
'
;
}
else
{
err
.
message
=
'
用户所属的租户被禁用
'
;
}
this
.
requestFailed
(
err
)
this
.
requestFailed
(
err
)
this
.
Logout
();
this
.
Logout
();
}
else
if
(
res
.
data
.
msgTip
==
'
tenant is expire
'
){
}
else
if
(
res
.
data
.
msgTip
==
'
tenant is expire
'
){
...
@@ -272,6 +273,7 @@
...
@@ -272,6 +273,7 @@
.forge-password {
.forge-password {
font-size: 14px;
font-size: 14px;
font-weight: bolder;
}
}
button.login-button {
button.login-button {
...
...
jshERP-web/src/views/user/Register.vue
View file @
f46166a5
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<a-form
ref=
"formRegister"
:autoFormCreate=
"(form)=>
{this.form = form}" id="formRegister">
<a-form
ref=
"formRegister"
:autoFormCreate=
"(form)=>
{this.form = form}" id="formRegister">
<a-form-item
<a-form-item
fieldDecoratorId=
"username"
fieldDecoratorId=
"username"
:fieldDecoratorOptions=
"
{rules: [{ required: true, message: '用户名不能为空'}], validateTrigger: ['change', 'blur'], validateFirst: true}">
:fieldDecoratorOptions=
"
{rules: [{ required: true, message: '用户名不能为空'}
, { validator: this.handleUserName}
], validateTrigger: ['change', 'blur'], validateFirst: true}">
<a-input
size=
"large"
type=
"text"
autocomplete=
"false"
placeholder=
"请输入用户名"
></a-input>
<a-input
size=
"large"
type=
"text"
autocomplete=
"false"
placeholder=
"请输入用户名"
></a-input>
</a-form-item>
</a-form-item>
...
@@ -40,7 +40,6 @@
...
@@ -40,7 +40,6 @@
size=
"large"
size=
"large"
type=
"text"
type=
"text"
default-value=
""
default-value=
""
@
change=
"inputCodeChange"
placeholder=
"请输入验证码"
>
placeholder=
"请输入验证码"
>
<a-icon
slot=
"prefix"
type=
"smile"
:style=
"{ color: 'rgba(0,0,0,.25)' }"
/>
<a-icon
slot=
"prefix"
type=
"smile"
:style=
"{ color: 'rgba(0,0,0,.25)' }"
/>
</a-input>
</a-input>
...
@@ -60,9 +59,9 @@
...
@@ -60,9 +59,9 @@
class=
"register-button"
class=
"register-button"
:loading=
"registerBtn"
:loading=
"registerBtn"
@
click.stop.prevent=
"handleSubmit"
@
click.stop.prevent=
"handleSubmit"
:disabled=
"registerBtn"
>
注册
:disabled=
"registerBtn"
>
注册
租户
</a-button>
</a-button>
<router-link
class=
"login"
:to=
"{ name: 'login' }"
>
使用已有
账
户登录
</router-link>
<router-link
class=
"login"
:to=
"{ name: 'login' }"
>
使用已有
租
户登录
</router-link>
</a-form-item>
</a-form-item>
<div
class=
"login-copyright"
>
<div
class=
"login-copyright"
>
...
@@ -153,6 +152,13 @@
...
@@ -153,6 +152,13 @@
this
.
requestCodeSuccess
=
false
this
.
requestCodeSuccess
=
false
})
})
},
},
handleUserName
(
rule
,
value
,
callback
)
{
let
reg
=
/^
(?=
.*
[
a-z
])
.
{4,}
$/
;
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
'
用户名需要由4位小写字母组成!
'
))
}
callback
()
},
handlePasswordLevel
(
rule
,
value
,
callback
)
{
handlePasswordLevel
(
rule
,
value
,
callback
)
{
let
level
=
0
let
level
=
0
...
@@ -232,8 +238,8 @@
...
@@ -232,8 +238,8 @@
if
(
res
.
code
===
200
){
if
(
res
.
code
===
200
){
this
.
$notification
.
success
({
this
.
$notification
.
success
({
message
:
'
提示
'
,
message
:
'
提示
'
,
description
:
"
注册成功,请
进行
登录!
"
,
description
:
"
注册成功,请
使用该租户
登录!
"
,
duration
:
2
duration
:
5
});
});
let
that
=
this
;
let
that
=
this
;
setTimeout
(
function
()
{
setTimeout
(
function
()
{
...
@@ -326,6 +332,7 @@
...
@@ -326,6 +332,7 @@
.login {
.login {
float: right;
float: right;
line-height: 40px;
line-height: 40px;
font-weight: bolder;
}
}
}
}
.login-copyright {
.login-copyright {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment