Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
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
front-end-dev
techbook
Commits
cf1de2c7
Commit
cf1de2c7
authored
Sep 27, 2019
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实时保存用户认证状态
parent
e9042e0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
main.js
src/main.js
+14
-2
No files found.
src/main.js
View file @
cf1de2c7
...
...
@@ -78,8 +78,20 @@ const i18n = new VueI18n({
}
})();
// if(document.cookie.indexOf('rfreshShiro=')!=-1){
// console.log(document.cookie.split('rfreshShiro=')[1])
// }
if
(
document
.
cookie
.
length
>
0
)
{
var
arr
=
document
.
cookie
.
split
(
'; '
);
//这里显示的格式需要切割一下自己可输出看下
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
var
arr2
=
arr
[
i
].
split
(
'='
);
//再次切割
//判断查找相对应的值
if
(
arr2
[
0
]
==
'refreshShiro'
)
{
var
userInfo
=
Base64
.
encode
(
decodeURIComponent
(
arr2
[
1
]));
window
.
localStorage
.
setItem
(
"userInfo"
,
userInfo
)
}
}
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// console.log(window.__asxiosPromiseArr)
if
(
window
.
__asxiosPromiseArr
)
{
...
...
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