Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
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
wuhao
ems3.3
Commits
792a833d
Commit
792a833d
authored
Nov 07, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qwe34
parent
ba58e96a
Pipeline
#1186
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app.jsx
src/app.jsx
+4
-4
request.js
src/utils/request.js
+1
-1
No files found.
src/app.jsx
View file @
792a833d
...
...
@@ -32,7 +32,7 @@ export async function getInitialState() {
const
msg
=
await
queryCurrentUser
();
return
msg
.
data
;
}
catch
(
error
)
{
history
.
push
(
loginPath
);
//
history.push(loginPath);
}
return
undefined
;
};
// 如果是登录页面,不执行
...
...
@@ -88,9 +88,9 @@ export const layout = ({ initialState, setInitialState }) => {
onPageChange
:
()
=>
{
const
{
location
}
=
history
;
// 如果没有登录,重定向到 login
if
(
!
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
)
{
history
.
push
(
loginPath
);
}
//
if (!initialState?.currentUser && location.pathname !== loginPath) {
//
history.push(loginPath);
//
}
},
links
:
isDev
?
[
...
...
src/utils/request.js
View file @
792a833d
...
...
@@ -93,7 +93,7 @@ request.interceptors.response.use(async (response, options) => {
}
else
{
const
data
=
await
response
.
clone
().
json
();
// 详情返回的response处理
if
(
data
?.
code
!=
'0000'
)
{
if
(
data
?.
code
!=
'0000'
&&
data
?.
code
)
{
message
.
destroy
();
message
.
warn
(
data
?.
msg
);
if
(
data
?.
code
==
'0001'
&&
window
.
location
.
href
.
indexOf
(
'login'
)
==
-
1
)
{
...
...
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