Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
16c919ce
authored
Aug 15, 2024
by
preschool
Committed by
李浪
Aug 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎈
perf:避免表单值被后续函数修改导致页面异常
parent
d3f38c69
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/views/Login/SocialLogin.vue
+5
-4
src/views/Login/components/LoginForm.vue
+5
-4
No files found.
src/views/Login/SocialLogin.vue
View file @
16c919ce
...
...
@@ -276,10 +276,11 @@ const handleLogin = async (params) => {
const
code
=
route
?.
query
?.
code
as
string
const
state
=
route
?.
query
?.
state
as
string
const
loginDataLoginForm
=
{
...
loginData
.
loginForm
}
const
res
=
await
LoginApi
.
login
({
// 账号密码登录
username
:
loginData
.
l
oginForm
.
username
,
password
:
loginData
.
l
oginForm
.
password
,
username
:
loginData
L
oginForm
.
username
,
password
:
loginData
L
oginForm
.
password
,
captchaVerification
:
params
.
captchaVerification
,
// 社交登录
socialCode
:
code
,
...
...
@@ -294,8 +295,8 @@ const handleLogin = async (params) => {
text
:
'正在加载系统中...'
,
background
:
'rgba(0, 0, 0, 0.7)'
})
if
(
loginData
.
l
oginForm
.
rememberMe
)
{
authUtil
.
setLoginForm
(
loginData
.
l
oginForm
)
if
(
loginData
L
oginForm
.
rememberMe
)
{
authUtil
.
setLoginForm
(
loginData
L
oginForm
)
}
else
{
authUtil
.
removeLoginForm
()
}
...
...
src/views/Login/components/LoginForm.vue
View file @
16c919ce
...
...
@@ -249,8 +249,9 @@ const handleLogin = async (params) => {
if
(
!
data
)
{
return
}
loginData
.
loginForm
.
captchaVerification
=
params
.
captchaVerification
const
res
=
await
LoginApi
.
login
(
loginData
.
loginForm
)
const
loginDataLoginForm
=
{
...
loginData
.
loginForm
}
loginDataLoginForm
.
captchaVerification
=
params
.
captchaVerification
const
res
=
await
LoginApi
.
login
(
loginDataLoginForm
)
if
(
!
res
)
{
return
}
...
...
@@ -259,8 +260,8 @@ const handleLogin = async (params) => {
text
:
'正在加载系统中...'
,
background
:
'rgba(0, 0, 0, 0.7)'
})
if
(
loginData
.
l
oginForm
.
rememberMe
)
{
authUtil
.
setLoginForm
(
loginData
.
l
oginForm
)
if
(
loginData
L
oginForm
.
rememberMe
)
{
authUtil
.
setLoginForm
(
loginData
L
oginForm
)
}
else
{
authUtil
.
removeLoginForm
()
}
...
...
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