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
51cffa4e
authored
Dec 28, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能优化】登录界面,如果禁用验证码,不初始化 Verify 组件
parent
e985b250
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
src/api/login/index.ts
+1
-0
src/views/Login/SocialLogin.vue
+1
-0
src/views/Login/components/LoginForm.vue
+4
-4
src/views/Login/components/RegisterForm.vue
+1
-0
No files found.
src/api/login/index.ts
View file @
51cffa4e
...
@@ -77,6 +77,7 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => {
...
@@ -77,6 +77,7 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => {
}
}
// 获取验证图片以及 token
// 获取验证图片以及 token
export
const
getCode
=
(
data
)
=>
{
export
const
getCode
=
(
data
)
=>
{
debugger
return
request
.
postOriginal
({
url
:
'system/captcha/get'
,
data
})
return
request
.
postOriginal
({
url
:
'system/captcha/get'
,
data
})
}
}
...
...
src/views/Login/SocialLogin.vue
View file @
51cffa4e
...
@@ -133,6 +133,7 @@
...
@@ -133,6 +133,7 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<Verify
<Verify
v-if=
"loginData.captchaEnable === 'true'"
ref=
"verify"
ref=
"verify"
:captchaType=
"captchaType"
:captchaType=
"captchaType"
:imgSize=
"
{ width: '400px', height: '200px' }"
:imgSize=
"
{ width: '400px', height: '200px' }"
...
...
src/views/Login/components/LoginForm.vue
View file @
51cffa4e
...
@@ -76,6 +76,7 @@
...
@@ -76,6 +76,7 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<Verify
<Verify
v-if=
"loginData.captchaEnable === 'true'"
ref=
"verify"
ref=
"verify"
:captchaType=
"captchaType"
:captchaType=
"captchaType"
:imgSize=
"
{ width: '400px', height: '200px' }"
:imgSize=
"
{ width: '400px', height: '200px' }"
...
@@ -241,7 +242,7 @@ const getTenantByWebsite = async () => {
...
@@ -241,7 +242,7 @@ const getTenantByWebsite = async () => {
}
}
const
loading
=
ref
()
// ElLoading.service 返回的实例
const
loading
=
ref
()
// ElLoading.service 返回的实例
// 登录
// 登录
const
handleLogin
=
async
(
params
)
=>
{
const
handleLogin
=
async
(
params
:
any
)
=>
{
loginLoading
.
value
=
true
loginLoading
.
value
=
true
try
{
try
{
await
getTenantId
()
await
getTenantId
()
...
@@ -273,7 +274,7 @@ const handleLogin = async (params) => {
...
@@ -273,7 +274,7 @@ const handleLogin = async (params) => {
if
(
redirect
.
value
.
indexOf
(
'sso'
)
!==
-
1
)
{
if
(
redirect
.
value
.
indexOf
(
'sso'
)
!==
-
1
)
{
window
.
location
.
href
=
window
.
location
.
href
.
replace
(
'/login?redirect='
,
''
)
window
.
location
.
href
=
window
.
location
.
href
.
replace
(
'/login?redirect='
,
''
)
}
else
{
}
else
{
push
({
path
:
redirect
.
value
||
permissionStore
.
addRouters
[
0
].
path
})
await
push
({
path
:
redirect
.
value
||
permissionStore
.
addRouters
[
0
].
path
})
}
}
}
finally
{
}
finally
{
loginLoading
.
value
=
false
loginLoading
.
value
=
false
...
@@ -313,8 +314,7 @@ const doSocialLogin = async (type: number) => {
...
@@ -313,8 +314,7 @@ const doSocialLogin = async (type: number) => {
encodeURIComponent
(
`type=
${
type
}
&redirect=
${
redirect
.
value
||
'/'
}
`
)
encodeURIComponent
(
`type=
${
type
}
&redirect=
${
redirect
.
value
||
'/'
}
`
)
// 进行跳转
// 进行跳转
const
res
=
await
LoginApi
.
socialAuthRedirect
(
type
,
encodeURIComponent
(
redirectUri
))
window
.
location
.
href
=
await
LoginApi
.
socialAuthRedirect
(
type
,
encodeURIComponent
(
redirectUri
))
window
.
location
.
href
=
res
}
}
}
}
watch
(
watch
(
...
...
src/views/Login/components/RegisterForm.vue
View file @
51cffa4e
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<Verify
<Verify
v-if=
"registerData.captchaEnable === 'true'"
ref=
"verify"
ref=
"verify"
:captchaType=
"captchaType"
:captchaType=
"captchaType"
:imgSize=
"
{ width: '400px', height: '200px' }"
:imgSize=
"
{ width: '400px', height: '200px' }"
...
...
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