Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
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
Maple
TOSTUMI
Commits
64029eb2
Commit
64029eb2
authored
Dec 14, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Signed-off-by: cellee <893264950@qq.com>
parent
563ed16c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
proxy.ts
config/proxy.ts
+6
-6
SecurityLayout.tsx
src/layouts/SecurityLayout.tsx
+7
-1
No files found.
config/proxy.ts
View file @
64029eb2
...
@@ -86,15 +86,15 @@ export default {
...
@@ -86,15 +86,15 @@ export default {
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
pathRewrite
:
{
'^'
:
''
},
},
},
'/tos/'
:
{
target
:
'http://47.74.233.180:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
// '/tos/': {
// '/tos/': {
// target: 'http://
192.168.1.28
:8651',
// target: 'http://
47.74.233.180
:8651',
// changeOrigin: true,
// changeOrigin: true,
// pathRewrite: { '^': '' },
// pathRewrite: { '^': '' },
// },
// },
'/tos/'
:
{
target
:
'http://192.168.1.28:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
},
},
};
};
src/layouts/SecurityLayout.tsx
View file @
64029eb2
...
@@ -85,7 +85,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
...
@@ -85,7 +85,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// 用户重新打开需要重新登录
// 用户重新打开需要重新登录
let
time
=
localStorage
.
getItem
(
'loginTime'
);
let
time
=
localStorage
.
getItem
(
'loginTime'
);
const
tokenLogin
=
time
?
JSON
.
parse
(
time
)
:
''
;
const
tokenLogin
=
time
?
JSON
.
parse
(
time
)
:
false
;
// 登录
// 登录
if
(
history
.
location
.
pathname
==
'/'
)
{
if
(
history
.
location
.
pathname
==
'/'
)
{
...
@@ -124,6 +124,12 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
...
@@ -124,6 +124,12 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
setTimeout
(
function
()
{
setTimeout
(
function
()
{
logOut
();
logOut
();
},
1000
);
},
1000
);
}
else
{
// 其他状态返回登录页 (没登陆)
const
queryString
=
stringify
({
redirect
:
window
.
location
.
href
,
});
return
<
Redirect
to=
{
`/user/login?${queryString}`
}
/>;
}
}
return
children
;
return
children
;
}
}
...
...
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