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
619bc84b
authored
May 12, 2021
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
x
parent
cf6168af
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
src/ajax/index.js
src/components/menu.vue
src/main.js
src/views/User/login.vue
src/ajax/index.js
View file @
619bc84b
...
...
@@ -15,7 +15,7 @@ let NODE_ENVS = "/";
switch
(
envs
)
{
case
'development'
:
//开发环境
NODE_ENVS
=
'http://192.168.2.1
42
:8080'
;
NODE_ENVS
=
'http://192.168.2.1
64
:8080'
;
break
;
case
'test'
:
//测试环境
...
...
src/components/menu.vue
View file @
619bc84b
...
...
@@ -166,6 +166,7 @@
}
else
{
app_
.
setAttribute
(
'style'
,
'padding-left:226px'
);
}
}
},
mounted
()
{
...
...
src/main.js
View file @
619bc84b
...
...
@@ -57,12 +57,15 @@ router.afterEach((to, from, next) => {
if
(
tabOldJson
)
{
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tabOldJson
));
}
if
(
tabOldJson
)
{
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
tabOldJson
));
}
});
axios
.
interceptors
.
response
.
use
(
res
=>
{
return
res
;
},
error
=>
{
Message
(
'网络出现问题,请检查网络'
);
//
Message('网络出现问题,请检查网络');
return
Promise
.
reject
(
new
Error
(
error
))
})
...
...
@@ -71,17 +74,28 @@ Vue.prototype.$http = http;
//路由页面回跳处理 mate里面参数 back:true 开启登录态回跳
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
console
.
log
(
to
.
query
)
if
(
to
.
path
!=
"/login"
){
http
(
'get'
,
"/api/user/getuserinfo"
,
{
}).
then
(
data
=>
{
let
res
=
data
.
data
;
if
(
res
.
err_code
===
101
)
{
window
.
location
.
href
=
'/#/login'
;
window
.
location
.
href
=
'/#/login?referer='
+
encodeURI
(
to
.
path
);
}
else
{
next
()
}
}).
catch
(
err
=>
{
console
.
log
(
err
.
message
);
next
()
})
next
();
}
else
{
next
()
}
});
...
...
src/views/User/login.vue
View file @
619bc84b
...
...
@@ -91,6 +91,7 @@
},
created
()
{
this
.
updateCp
();
console
.
log
(
this
.
$route
.
query
.
referer
)
},
computed
:
{},
methods
:
{
...
...
@@ -139,7 +140,12 @@
let
res
=
data
.
data
;
if
(
res
.
err_code
===
0
)
{
Util
.
setCookie
(
"token"
,
res
.
data
.
api_token
,
1
);
if
(
this
.
$route
.
query
.
referer
){
window
.
location
.
href
=
"/#"
+
this
.
$route
.
query
.
referer
}
else
{
window
.
location
.
href
=
'/'
;
}
}
else
{
Message
(
res
.
err_msg
);
this
.
updateCp
();
...
...
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