Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DC-TOM
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘照晖
DC-TOM
Commits
1965f46c
Commit
1965f46c
authored
May 23, 2025
by
liuzhaoh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化登录
parent
d48ee858
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
26 deletions
+54
-26
user.js
src/request/user.js
+1
-1
index.vue
src/views/login/index.vue
+53
-25
No files found.
src/request/user.js
View file @
1965f46c
...
@@ -25,7 +25,7 @@ export function getLogin() {
...
@@ -25,7 +25,7 @@ export function getLogin() {
export
function
getInfo
()
{
export
function
getInfo
()
{
return
request
({
return
request
({
url
:
'/system/permission?appCode=bme-
pc
-service&userId=1'
,
url
:
'/system/permission?appCode=bme-
dc-tom
-service&userId=1'
,
method
:
'get'
method
:
'get'
})
})
}
}
...
...
src/views/login/index.vue
View file @
1965f46c
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<div
class=
"gap-20 captcha-box"
v-if=
"!needPhoneCertificate"
>
<div
class=
"gap-20 captcha-box"
v-if=
"!needPhoneCertificate"
>
<el-form-item
prop=
"captcha"
>
<el-form-item
prop=
"captcha"
>
<div
class=
"captcha-container"
>
<div
class=
"captcha-container"
>
<div
class=
"captcha-value"
>
<div
class=
"captcha-value"
>
<el-input
<el-input
ref=
"captcha"
ref=
"captcha"
...
@@ -75,7 +75,11 @@
...
@@ -75,7 +75,11 @@
</el-form-item>
</el-form-item>
</div>
</div>
<el-checkbox
v-model=
"loginOldForm.rememberMe"
label=
"记住密码"
size=
"large"
/>
<el-checkbox
v-model=
"loginOldForm.rememberMe"
label=
"记住密码"
size=
"large"
/>
<el-button
<el-button
:loading=
"oldloading"
:loading=
"oldloading"
...
@@ -138,7 +142,7 @@
...
@@ -138,7 +142,7 @@
v-model=
"dialogPhoneCertificate"
v-model=
"dialogPhoneCertificate"
class=
"dialogChangePassword"
class=
"dialogChangePassword"
:close-on-click-modal=
"false"
:close-on-click-modal=
"false"
width=
"3
3
%"
width=
"3
5
%"
>
>
<el-form
<el-form
ref=
"phoneForm"
ref=
"phoneForm"
...
@@ -150,7 +154,7 @@
...
@@ -150,7 +154,7 @@
class=
"dialogChangePasswordform"
class=
"dialogChangePasswordform"
>
>
<el-form-item
prop=
"iphone"
label=
"手机号码:"
>
<el-form-item
prop=
"iphone"
label=
"手机号码:"
>
<el-
autocomplete
<el-
input
class=
"inline-input"
class=
"inline-input"
ref=
"iphone"
ref=
"iphone"
name=
"iphone"
name=
"iphone"
...
@@ -158,7 +162,19 @@
...
@@ -158,7 +162,19 @@
:fetch-suggestions=
"querySearchIphone"
:fetch-suggestions=
"querySearchIphone"
placeholder=
"请输入手机号码"
placeholder=
"请输入手机号码"
@
select=
"handleSelect"
@
select=
"handleSelect"
></el-autocomplete>
>
<!--
<template
#
append
>
<el-button
:disabled=
"captchaSendStatus"
@
click
.
prevent=
"sendCaptchaCheck()"
>
{{
"发送验证码"
+
(
captchaWaitTime
>
0
?
"("
+
captchaWaitTime
+
")"
:
""
)
}}
</el-button>
</
template
>
-->
</el-input>
<el-button
<el-button
:disabled=
"captchaSendStatus"
:disabled=
"captchaSendStatus"
class=
"captcha-btn"
class=
"captcha-btn"
...
@@ -486,7 +502,7 @@ export default {
...
@@ -486,7 +502,7 @@ export default {
password
:
""
,
password
:
""
,
captcha
:
""
,
captcha
:
""
,
captchaKey
:
""
,
captchaKey
:
""
,
rememberMe
:
getToken
(
"rememberMe"
)
==
'true'
?
true
:
false
,
rememberMe
:
getToken
(
"rememberMe"
)
==
"true"
?
true
:
false
,
},
},
dialogPhoneBind
:
false
,
dialogPhoneBind
:
false
,
store
:
null
,
store
:
null
,
...
@@ -523,7 +539,7 @@ export default {
...
@@ -523,7 +539,7 @@ export default {
account
:
""
,
account
:
""
,
password
:
""
,
password
:
""
,
captcha
:
""
,
captcha
:
""
,
rememberMe
:
getToken
(
"rememberMe"
)
==
'true'
?
true
:
false
,
rememberMe
:
getToken
(
"rememberMe"
)
==
"true"
?
true
:
false
,
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -536,8 +552,8 @@ export default {
...
@@ -536,8 +552,8 @@ export default {
}
}
if
(
getToken
(
"rememberMe"
)
==
"true"
)
{
if
(
getToken
(
"rememberMe"
)
==
"true"
)
{
this
.
loginOldForm
.
account
=
encryptUtf8ToBase64
(
getToken
(
"account"
));
this
.
loginOldForm
.
account
=
encryptUtf8ToBase64
(
getToken
(
"account"
));
this
.
loginOldForm
.
password
=
encryptUtf8ToBase64
(
getToken
(
"remmberPWS"
));
this
.
loginOldForm
.
password
=
encryptUtf8ToBase64
(
getToken
(
"remmberPWS"
));
console
.
log
(
this
.
loginOldForm
)
console
.
log
(
this
.
loginOldForm
)
;
}
else
{
}
else
{
this
.
loginOldForm
.
account
=
""
;
this
.
loginOldForm
.
account
=
""
;
this
.
loginOldForm
.
password
=
""
;
this
.
loginOldForm
.
password
=
""
;
...
@@ -570,7 +586,7 @@ export default {
...
@@ -570,7 +586,7 @@ export default {
*/
*/
handleAccountBlur
(
event
)
{
handleAccountBlur
(
event
)
{
getData
(
getData
(
"/config/simpleLoginConfig?appCode=bme-
pc
-service&account="
+
"/config/simpleLoginConfig?appCode=bme-
dc-tom
-service&account="
+
(
event
.
currentTarget
.
value
||
event
.
target
.
value
),
(
event
.
currentTarget
.
value
||
event
.
target
.
value
),
true
true
).
then
((
result
)
=>
{
).
then
((
result
)
=>
{
...
@@ -580,7 +596,7 @@ export default {
...
@@ -580,7 +596,7 @@ export default {
},
},
handleAccountInput
(
value
)
{
handleAccountInput
(
value
)
{
getData
(
getData
(
"/config/simpleLoginConfig?appCode=bme-
pc
-service&account="
+
value
,
"/config/simpleLoginConfig?appCode=bme-
dc-tom
-service&account="
+
value
,
true
true
).
then
((
result
)
=>
{
).
then
((
result
)
=>
{
this
.
needPhoneCertificate
=
!
result
.
data
;
this
.
needPhoneCertificate
=
!
result
.
data
;
...
@@ -604,7 +620,7 @@ export default {
...
@@ -604,7 +620,7 @@ export default {
*/
*/
async
getAppCode
()
{
async
getAppCode
()
{
let
appCode
=
false
;
let
appCode
=
false
;
await
getData
(
"/user/captchaLoginConfig?appCode=bme-
pc
-service"
)
await
getData
(
"/user/captchaLoginConfig?appCode=bme-
dc-tom
-service"
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
setToken
(
"appCode"
,
res
.
data
);
setToken
(
"appCode"
,
res
.
data
);
...
@@ -673,7 +689,7 @@ export default {
...
@@ -673,7 +689,7 @@ export default {
confirmPassword
:
MD5
(
this
.
ruleForm
.
checkPass
+
"`1qazx"
).
toString
(),
confirmPassword
:
MD5
(
this
.
ruleForm
.
checkPass
+
"`1qazx"
).
toString
(),
};
};
if
(
!
this
.
needPhoneCertificate
)
{
if
(
!
this
.
needPhoneCertificate
)
{
obj
.
appCode
=
"bme-
pc
-service"
;
obj
.
appCode
=
"bme-
dc-tom
-service"
;
}
}
postData
(
"/management/savePassword"
,
obj
).
then
((
res
)
=>
{
postData
(
"/management/savePassword"
,
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
...
@@ -709,7 +725,7 @@ export default {
...
@@ -709,7 +725,7 @@ export default {
this
.
phoneForm
.
iphone
+
this
.
phoneForm
.
iphone
+
"&account="
+
"&account="
+
this
.
loginForm
.
account
+
this
.
loginForm
.
account
+
"&appCode=bme-
pc
-service"
,
"&appCode=bme-
dc-tom
-service"
,
true
true
)
)
.
then
((
result
)
=>
{
.
then
((
result
)
=>
{
...
@@ -746,7 +762,7 @@ export default {
...
@@ -746,7 +762,7 @@ export default {
this.loginForm.account +
this.loginForm.account +
"&password=" +
"&password=" +
this.loginForm.password +
this.loginForm.password +
"&appCode=bme-
pc
-service",
"&appCode=bme-
dc-tom
-service",
true
true
)
)
.then((result) => {
.then((result) => {
...
@@ -801,7 +817,7 @@ export default {
...
@@ -801,7 +817,7 @@ export default {
encodeURIComponent
(
encodeURIComponent
(
MD5
(
this
.
loginForm
.
password
+
"`1qazx"
).
toString
()
MD5
(
this
.
loginForm
.
password
+
"`1qazx"
).
toString
()
)
+
)
+
"&appCode=bme-
pc
-service"
,
"&appCode=bme-
dc-tom
-service"
,
true
true
).
then
((
result
)
=>
{
).
then
((
result
)
=>
{
if
(
result
.
code
==
1
&&
result
.
data
&&
result
.
data
.
length
>
0
)
{
if
(
result
.
code
==
1
&&
result
.
data
&&
result
.
data
.
length
>
0
)
{
...
@@ -828,7 +844,7 @@ export default {
...
@@ -828,7 +844,7 @@ export default {
this
.
$refs
.
phoneForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
phoneForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
phoneForm
.
appCode
=
"bme-
pc
-service"
;
this
.
phoneForm
.
appCode
=
"bme-
dc-tom
-service"
;
let
bindIphones
=
[];
let
bindIphones
=
[];
this
.
bindIphones
.
forEach
((
item
)
=>
{
this
.
bindIphones
.
forEach
((
item
)
=>
{
bindIphones
.
push
(
item
.
value
);
bindIphones
.
push
(
item
.
value
);
...
@@ -840,7 +856,10 @@ export default {
...
@@ -840,7 +856,10 @@ export default {
this
.
store
this
.
store
.
login
(
phoneFormOrigin
)
.
login
(
phoneFormOrigin
)
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
console
.
log
(
!
bindIphones
.
includes
(
this
.
phoneForm
.
iphone
)
&&
this
.
phoneForm
.
captcha
!=
"BME202288"
);
console
.
log
(
!
bindIphones
.
includes
(
this
.
phoneForm
.
iphone
)
&&
this
.
phoneForm
.
captcha
!=
"BME202288"
);
if
(
if
(
!
bindIphones
.
includes
(
this
.
phoneForm
.
iphone
)
&&
!
bindIphones
.
includes
(
this
.
phoneForm
.
iphone
)
&&
this
.
phoneForm
.
captcha
!=
"BME202288"
this
.
phoneForm
.
captcha
!=
"BME202288"
...
@@ -947,7 +966,7 @@ export default {
...
@@ -947,7 +966,7 @@ export default {
if
(
!
this
.
isVerify
)
{
if
(
!
this
.
isVerify
)
{
// 处理谷歌浏览器自带默认值的情况,因为初始化时获取不到,所以这里特殊处理
// 处理谷歌浏览器自带默认值的情况,因为初始化时获取不到,所以这里特殊处理
await
getData
(
await
getData
(
"/config/simpleLoginConfig?appCode=bme-
pc
-service&account="
+
"/config/simpleLoginConfig?appCode=bme-
dc-tom
-service&account="
+
this
.
loginOldForm
.
account
,
this
.
loginOldForm
.
account
,
true
true
).
then
((
result
)
=>
{
).
then
((
result
)
=>
{
...
@@ -967,10 +986,13 @@ export default {
...
@@ -967,10 +986,13 @@ export default {
this
.
$refs
.
loginOldForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
loginOldForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// 记住密码
// 记住密码
setToken
(
'account'
,
encryptBase64ToUtf8
(
this
.
loginOldForm
.
account
))
setToken
(
"account"
,
encryptBase64ToUtf8
(
this
.
loginOldForm
.
account
));
setToken
(
'remmberPWS'
,
encryptBase64ToUtf8
(
this
.
loginOldForm
.
password
))
setToken
(
"remmberPWS"
,
encryptBase64ToUtf8
(
this
.
loginOldForm
.
password
)
);
this
.
oldloading
=
true
;
this
.
oldloading
=
true
;
this
.
loginOldForm
.
appCode
=
"bme-
pc
-service"
;
this
.
loginOldForm
.
appCode
=
"bme-
dc-tom
-service"
;
const
loginOldFormOrigin
=
{
...
this
.
loginOldForm
};
const
loginOldFormOrigin
=
{
...
this
.
loginOldForm
};
loginOldFormOrigin
.
password
=
MD5
(
loginOldFormOrigin
.
password
=
MD5
(
...
@@ -1127,7 +1149,12 @@ $cursor: #ccc;
...
@@ -1127,7 +1149,12 @@ $cursor: #ccc;
}
}
}
}
.el-input__wrapper
{
.el-input__wrapper
{
width
:
100%
;
width
:
95%
;
}
.dialogChangePasswordform
{
.el-input__wrapper
{
width
:
80%
;
}
}
}
.captcha
{
.captcha
{
...
@@ -1152,8 +1179,9 @@ $light_gray: #eee;
...
@@ -1152,8 +1179,9 @@ $light_gray: #eee;
.captcha-btn
{
.captcha-btn
{
position
:
absolute
;
position
:
absolute
;
right
:
0px
;
top
:
1%
;
height
:
48px
;
right
:
17%
;
height
:
100%
;
}
}
.login-container
{
.login-container
{
...
...
Write
Preview
Markdown
is supported
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