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
a11fded1
Commit
a11fded1
authored
Aug 26, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wx return
parent
d866e55f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
src/App.js
+16
-7
src/common/HeaderBar/index.js
+4
-0
No files found.
src/App.js
View file @
a11fded1
...
...
@@ -45,14 +45,14 @@ class App extends Component {
sessionStorage
.
setItem
(
'enter_url'
,
window
.
location
.
href
)
}
this
.
props
.
startFetchUser
()
http
.
get
(
`
${
API
.
home
}
/m/user_info`
).
then
(
res
=>
{
this
.
props
.
setCurrentUser
(
this
.
transformUser
(
res
))
})
this
.
getUser
()
const
routeMatchRule
=
/binding-tel|forgot|set-password/
const
{
history
}
=
this
.
props
history
.
listen
(
location
=>
{
if
(
cookie
.
get
(
'uid'
)
&&
this
.
props
.
user
.
hasError
){
this
.
getUser
()
}
const
{
pathname
}
=
location
if
(
pathname
.
startsWith
(
'/passport'
))
{
if
(
routeMatchRule
.
test
(
pathname
))
{
...
...
@@ -63,6 +63,17 @@ class App extends Component {
})
}
getUser
=
()
=>
{
this
.
props
.
startFetchUser
()
http
.
get
(
`
${
API
.
home
}
/m/user_info`
).
then
(
res
=>
{
this
.
props
.
setCurrentUser
(
this
.
transformUser
(
res
))
})
//微信
let
code
=
getParam
(
'code'
)
...
...
@@ -90,8 +101,6 @@ class App extends Component {
}
}
componentDidUpdate
()
{
...
...
@@ -169,7 +178,7 @@ class App extends Component {
export
default
compose
(
connect
(
null
,
state
=>
({
user
:
state
.
user
})
,
{
setCurrentUser
,
startFetchUser
}
),
withRouter
...
...
src/common/HeaderBar/index.js
View file @
a11fded1
import
React
,
{
Component
}
from
'react'
import
'./index.scss'
;
import
{
withRouter
}
from
'react-router-dom'
import
{
browser
,
getParam
}
from
"@/utils"
;
class
HeaderBar
extends
Component
{
constructor
(
props
)
{
...
...
@@ -8,6 +9,9 @@ class HeaderBar extends Component {
}
goBack
=
()
=>
{
if
(
browser
.
isWeixin
&&
getParam
(
'code'
)
&&
getParam
(
'state'
)){
window
.
history
.
go
(
-
2
)
}
window
.
history
.
go
(
-
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