Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
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
陈智峰
jinfa-platform
Commits
09df93ae
Commit
09df93ae
authored
Dec 07, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
5d283360
f57fb3b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
auth.ts
src/utils/auth.ts
+5
-5
No files found.
src/utils/auth.ts
View file @
09df93ae
import
{
isDev
,
TOP_DOMAIN
}
from
'@/constants'
import
{
TOP_DOMAIN_NO_PORT
,
TOP_DOMAIN
}
from
'@/constants'
import
{
GetMemberLoginRegetResponse
}
from
'@/services/MemberV2Api'
import
{
getTopDomainByHost
}
from
'.'
import
{
getCookie
,
removeCookie
,
setCookie
}
from
'./cookie'
...
...
@@ -33,8 +33,8 @@ export const setAuth = (info: AuthInfo) => {
memberRoleId
:
info
.
memberRoleId
,
memberType
:
info
.
memberType
,
}
setCookie
(
AUTH_KEY
,
JSON
.
stringify
(
auth
),
{
domain
:
TOP_DOMAIN
})
setCookie
(
AUTH_ROLES_KEY
,
JSON
.
stringify
(
info
.
roles
),
{
domain
:
TOP_DOMAIN
})
setCookie
(
AUTH_KEY
,
JSON
.
stringify
(
auth
),
{
domain
:
TOP_DOMAIN
_NO_PORT
})
setCookie
(
AUTH_ROLES_KEY
,
JSON
.
stringify
(
info
.
roles
),
{
domain
:
TOP_DOMAIN
_NO_PORT
})
setLocalAuth
(
info
)
setRouters
(
info
.
urls
)
}
...
...
@@ -96,8 +96,8 @@ export const removeRouters = () => {
}
export
const
removeAuth
=
()
=>
{
removeCookie
(
AUTH_KEY
,
{
path
:
'/'
,
domain
:
getTopDomainByHost
(
TOP_DOMAIN
,
true
)
})
removeCookie
(
AUTH_ROLES_KEY
,
{
path
:
'/'
,
domain
:
getTopDomainByHost
(
TOP_DOMAIN
,
true
)
})
removeCookie
(
AUTH_KEY
,
{
path
:
'/'
,
domain
:
getTopDomainByHost
(
TOP_DOMAIN
_NO_PORT
,
true
)
})
removeCookie
(
AUTH_ROLES_KEY
,
{
path
:
'/'
,
domain
:
getTopDomainByHost
(
TOP_DOMAIN
_NO_PORT
,
true
)
})
window
.
localStorage
.
removeItem
(
AUTH_KEY
)
removeRouters
()
const
_window
:
any
=
window
...
...
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