Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aa05ed28
authored
May 12, 2021
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
x
parent
619bc84b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
src/main.js
src/views/User/login.vue
src/main.js
View file @
aa05ed28
...
@@ -57,9 +57,6 @@ router.afterEach((to, from, next) => {
...
@@ -57,9 +57,6 @@ router.afterEach((to, from, next) => {
if
(
tabOldJson
)
{
if
(
tabOldJson
)
{
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tabOldJson
));
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tabOldJson
));
}
}
if
(
tabOldJson
)
{
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tabOldJson
));
}
});
});
axios
.
interceptors
.
response
.
use
(
res
=>
{
axios
.
interceptors
.
response
.
use
(
res
=>
{
...
@@ -74,28 +71,27 @@ Vue.prototype.$http = http;
...
@@ -74,28 +71,27 @@ Vue.prototype.$http = http;
//路由页面回跳处理 mate里面参数 back:true 开启登录态回跳
//路由页面回跳处理 mate里面参数 back:true 开启登录态回跳
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
console
.
log
(
to
.
query
)
console
.
log
(
to
)
if
(
to
.
path
!=
"/login"
){
if
(
to
.
path
==
"/login"
){
next
()
}
else
{
http
(
'get'
,
"/api/user/getuserinfo"
,
{
http
(
'get'
,
"/api/user/getuserinfo"
,
{
}).
then
(
data
=>
{
}).
then
(
data
=>
{
let
res
=
data
.
data
;
let
res
=
data
.
data
;
if
(
res
.
err_code
===
101
)
{
if
(
res
.
err_code
===
101
)
{
window
.
location
.
href
=
'/#/login?referer='
+
encodeURI
(
to
.
path
);
window
.
location
.
href
=
'/#/login?referer='
+
encodeURI
(
to
.
path
);
history
.
go
(
0
)
}
else
{
}
else
{
next
()
next
()
}
}
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
.
message
);
console
.
log
(
err
.
message
);
next
()
})
})
}
else
{
next
()
}
}
});
});
...
...
src/views/User/login.vue
View file @
aa05ed28
...
@@ -91,7 +91,6 @@
...
@@ -91,7 +91,6 @@
},
},
created
()
{
created
()
{
this
.
updateCp
();
this
.
updateCp
();
console
.
log
(
this
.
$route
.
query
.
referer
)
},
},
computed
:
{},
computed
:
{},
methods
:
{
methods
:
{
...
@@ -140,9 +139,10 @@
...
@@ -140,9 +139,10 @@
let
res
=
data
.
data
;
let
res
=
data
.
data
;
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
Util
.
setCookie
(
"token"
,
res
.
data
.
api_token
,
1
);
Util
.
setCookie
(
"token"
,
res
.
data
.
api_token
,
1
);
console
.
log
(
this
.
$route
.
query
.
referer
)
if
(
this
.
$route
.
query
.
referer
){
if
(
this
.
$route
.
query
.
referer
){
window
.
location
.
href
=
"/#"
+
this
.
$route
.
query
.
referer
window
.
location
.
href
=
"/#"
+
this
.
$route
.
query
.
referer
}
else
{
}
else
{
window
.
location
.
href
=
'/'
;
window
.
location
.
href
=
'/'
;
}
}
...
...
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