Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
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
baiguangyao
mr-julyedu
Commits
4da7d06e
Commit
4da7d06e
authored
Jun 22, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
93d8d984
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
9 deletions
+35
-9
scripts/start.js
+1
-1
src/App.js
+1
-1
src/components/passport/index.js
+21
-2
src/router/loading.js
+9
-3
src/setupProxy.js
+1
-1
src/store/userAction.js
+2
-1
No files found.
scripts/start.js
View file @
4da7d06e
...
...
@@ -42,7 +42,7 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
}
// Tools like Cloud9 rely on this.
const
DEFAULT_PORT
=
parseInt
(
process
.
env
.
PORT
,
10
)
||
300
0
;
const
DEFAULT_PORT
=
parseInt
(
process
.
env
.
PORT
,
10
)
||
8
0
;
const
HOST
=
process
.
env
.
HOST
||
'0.0.0.0'
;
if
(
process
.
env
.
HOST
)
{
...
...
src/App.js
View file @
4da7d06e
...
...
@@ -54,7 +54,7 @@ class App extends Component {
jsCookie
.
set
(
'role'
,
role
,
expires
)
jsCookie
.
set
(
'uid'
,
uid
,
expires
)
jsCookie
.
set
(
'token'
,
token
,
expires
)
this
.
props
.
receive
User
(
user
)
this
.
props
.
setCurrent
User
(
user
)
}
}
else
{
Toast
.
info
(
data
.
msg
)
...
...
src/components/passport/index.js
View file @
4da7d06e
...
...
@@ -8,8 +8,8 @@ import AccountLogin from './accountLogin'
import
ForgotPassword
from
'./forgotPassword'
import
SetPassword
from
'./setPassword'
import
BindingTel
from
'./bindingTel'
import
{
connect
}
from
"react-redux"
;
import
{
compose
}
from
"redux"
;
import
{
connect
}
from
"react-redux"
;
import
{
compose
}
from
"redux"
;
import
account
from
'./account.png'
import
qq
from
'./qq.png'
...
...
@@ -48,6 +48,25 @@ class Passport extends Component {
}
}
componentDidMount
()
{
this
.
routeWhenUserLoggedIn
()
}
componentDidUpdate
()
{
this
.
routeWhenUserLoggedIn
()
}
routeWhenUserLoggedIn
=
()
=>
{
let
{
history
}
=
this
.
props
if
(
Object
.
values
(
this
.
props
.
user
.
data
).
filter
(
item
=>
!!
item
).
length
)
{
history
.
action
===
'POP'
&&
history
.
go
(
-
1
)
}
}
render
()
{
let
{
match
,
location
}
=
this
.
props
return
(
...
...
src/router/loading.js
View file @
4da7d06e
...
...
@@ -17,13 +17,17 @@ function Loading(props) {
return
}
if
(
!
isLoading
)
{
return
}
if
(
!
user
.
isFetching
)
{
if
(
user
.
hasError
)
{
history
.
push
(
'/passport'
,
{
from
:
location
})
history
.
replace
(
'/passport'
,
{
from
:
location
})
setLoadingState
(
false
)
}
else
{
if
(
Object
.
values
(
user
.
data
).
every
(
item
=>
!!
item
).
length
!==
0
)
{
history
.
push
(
location
.
pathname
)
history
.
replace
(
location
.
pathname
)
setLoadingState
(
false
)
}
}
...
...
@@ -32,7 +36,9 @@ function Loading(props) {
return
(
<
div
className
=
{
'loading-route'
}
>
<
LoadingComponent
isLoading
=
{
isLoading
}
/
>
<
LoadingComponent
isLoading
=
{
isLoading
}
>
<
div
><
/div
>
<
/LoadingComponent
>
<
/div
>
);
}
...
...
src/setupProxy.js
View file @
4da7d06e
...
...
@@ -12,7 +12,7 @@ module.exports = function (app) {
pathRewrite
:
{
[
`^
${
config
[
item
][
'development'
]}
`
]:
''
},
cookieDomainRewrite
:
'localhost'
,
//
cookieDomainRewrite: 'localhost',
...
config
[
item
][
'proxy'
]
}
))
...
...
src/store/userAction.js
View file @
4da7d06e
...
...
@@ -33,7 +33,8 @@ const storeUser = (res, dispatch) => {
}
else
{
payload
=
{
hasError
:
true
,
msg
:
data
.
msg
msg
:
data
.
msg
,
data
:
{}
}
}
dispatch
(
setCurrentUser
(
payload
))
...
...
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