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
Unverified
Commit
b68f8be7
authored
Aug 19, 2023
by
芋道源码
Committed by
Gitee
Aug 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回退 'Pull Request !195 : 修复登录后通过登录页面无法再次登录的问题'
parent
cb4c78b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
src/config/axios/service.ts
+3
-2
src/views/Login/components/LoginForm.vue
+0
-3
No files found.
src/config/axios/service.ts
View file @
b68f8be7
...
@@ -31,7 +31,7 @@ let requestList: any[] = []
...
@@ -31,7 +31,7 @@ let requestList: any[] = []
// 是否正在刷新中
// 是否正在刷新中
let
isRefreshToken
=
false
let
isRefreshToken
=
false
// 请求白名单,无须token的接口
// 请求白名单,无须token的接口
const
whiteList
:
string
[]
=
[
'/login'
,
'/refresh-token'
,
'/system/tenant/get-id-by-name'
]
const
whiteList
:
string
[]
=
[
'/login'
,
'/refresh-token'
]
// 创建axios实例
// 创建axios实例
const
service
:
AxiosInstance
=
axios
.
create
({
const
service
:
AxiosInstance
=
axios
.
create
({
...
@@ -47,7 +47,8 @@ service.interceptors.request.use(
...
@@ -47,7 +47,8 @@ service.interceptors.request.use(
let
isToken
=
(
config
!
.
headers
||
{}).
isToken
===
false
let
isToken
=
(
config
!
.
headers
||
{}).
isToken
===
false
whiteList
.
some
((
v
)
=>
{
whiteList
.
some
((
v
)
=>
{
if
(
config
.
url
)
{
if
(
config
.
url
)
{
return
(
isToken
=
config
.
url
.
indexOf
(
v
)
>
-
1
)
config
.
url
.
indexOf
(
v
)
>
-
1
return
(
isToken
=
false
)
}
}
})
})
if
(
getAccessToken
()
&&
!
isToken
)
{
if
(
getAccessToken
()
&&
!
isToken
)
{
...
...
src/views/Login/components/LoginForm.vue
View file @
b68f8be7
...
@@ -148,8 +148,6 @@ import { ElLoading } from 'element-plus'
...
@@ -148,8 +148,6 @@ import { ElLoading } from 'element-plus'
import
LoginFormTitle
from
'./LoginFormTitle.vue'
import
LoginFormTitle
from
'./LoginFormTitle.vue'
import
type
{
RouteLocationNormalizedLoaded
}
from
'vue-router'
import
type
{
RouteLocationNormalizedLoaded
}
from
'vue-router'
import
{
CACHE_KEY
,
useCache
}
from
'@/hooks/web/useCache'
const
{
wsCache
}
=
useCache
()
import
{
useIcon
}
from
'@/hooks/web/useIcon'
import
{
useIcon
}
from
'@/hooks/web/useIcon'
import
*
as
authUtil
from
'@/utils/auth'
import
*
as
authUtil
from
'@/utils/auth'
...
@@ -246,7 +244,6 @@ const handleLogin = async (params) => {
...
@@ -246,7 +244,6 @@ const handleLogin = async (params) => {
if
(
!
res
)
{
if
(
!
res
)
{
return
return
}
}
wsCache
.
delete
(
CACHE_KEY
.
USER
)
// 清除上次登录用户信息
ElLoading
.
service
({
ElLoading
.
service
({
lock
:
true
,
lock
:
true
,
text
:
'正在加载系统中...'
,
text
:
'正在加载系统中...'
,
...
...
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