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
18e24611
Commit
18e24611
authored
Sep 17, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
pull master and del build
parents
615ef9aa
61bc7232
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
22 deletions
+48
-22
public/api.js
+1
-0
src/App.js
+36
-9
src/components/passport/bindingTel/index.js
+3
-2
src/components/passport/index.js
+6
-4
src/components/passport/setPassword/index.js
+2
-7
No files found.
public/api.js
View file @
18e24611
var
API
=
{
'www'
:
'http://www-test.julyedu.com'
,
'home'
:
'http://fast-test.julyedu.com'
,
'search-api'
:
'https://search.julyedu.com'
,
'passport-api'
:
'http://passport-test.julyedu.com'
,
...
...
src/App.js
View file @
18e24611
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
Routes
from
'./router'
import
cookie
from
'js-cookie'
import
{
connect
}
from
"react-redux"
;
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
;
import
{
withRouter
}
from
'react-router-dom'
import
{
compose
}
from
'redux'
import
{
getParam
,
http
,
browser
}
from
"@/utils"
;
import
{
Toast
}
from
"antd-mobile"
;
import
{
addDays
}
from
'date-fns'
import
{
connect
}
from
"react-redux"
;
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
;
import
{
withRouter
}
from
'react-router-dom'
import
{
compose
}
from
'redux'
import
{
getParam
,
http
,
browser
}
from
"@/utils"
;
import
{
Toast
}
from
"antd-mobile"
;
import
{
addDays
}
from
'date-fns'
//拦截ajax请求,返回mock数据
...
...
@@ -55,10 +55,11 @@ class App extends Component {
}
this
.
getUser
()
this
.
utm
()
const
routeMatchRule
=
/binding-tel|forgot|set-password/
const
{
history
}
=
this
.
props
history
.
listen
((
location
)
=>
{
this
.
utm
()
this
.
setNavigationRecord
(
location
)
if
(
cookie
.
get
(
'uid'
)
&&
this
.
props
.
user
.
hasError
)
{
this
.
getUser
()
...
...
@@ -88,6 +89,32 @@ class App extends Component {
}
}
utm
=
()
=>
{
// utm统计 m站全站统计广告投放、以及统计详情页浏览
let
utm_source
=
getParam
(
'utm_source'
)
let
utm_medium
=
getParam
(
'utm_medium'
)
let
utm_campaign
=
getParam
(
'utm_campaign'
)
let
utm_content
=
getParam
(
'utm_content'
)
let
utm_term
=
getParam
(
'utm_term'
)
let
courseId
=
location
.
pathname
.
startsWith
(
'/getDetail'
)
||
location
.
pathname
.
startsWith
(
'/detail'
)
?
getParam
(
'id'
)
:
0
if
(
courseId
||
(
utm_term
&&
utm_source
&&
utm_medium
&&
utm_campaign
&&
utm_content
))
{
let
data
=
{
'utm_source'
:
utm_source
,
'utm_medium'
:
utm_medium
,
'utm_campaign'
:
utm_campaign
,
'utm_content'
:
utm_content
,
'utm_term'
:
utm_term
,
}
http
.
post
(
`
${
API
[
'www'
]}
/base/first_utm_record/
${
courseId
}
`
,
data
)
.
then
(
res
=>
{
})
}
}
getUser
=
()
=>
{
this
.
props
.
startFetchUser
()
...
...
src/components/passport/bindingTel/index.js
View file @
18e24611
...
...
@@ -123,7 +123,6 @@ const formikConfig = {
plat
:
5
}).
then
(
res
=>
{
const
data
=
res
.
data
if
(
data
.
errno
==
200
)
{
if
(
data
.
data
[
'is_set_pwd'
])
{
...
...
@@ -132,8 +131,10 @@ const formikConfig = {
data
:
{
uid
:
data
.
data
.
uid
},
msg
:
data
.
data
.
msg
msg
:
data
.
data
.
msg
,
stage
:
'binding'
})
alert
(
'replace'
)
props
.
history
.
replace
(
`/passport/set-password`
)
}
else
{
location
.
assign
(
data
.
data
[
'jump_url'
])
...
...
src/components/passport/index.js
View file @
18e24611
...
...
@@ -67,12 +67,14 @@ class Passport extends Component {
let
{
history
,
location
}
=
this
.
props
let
{
data
}
=
this
.
props
.
user
if
(
data
&&
Object
.
values
(
data
).
filter
(
item
=>
!!
item
).
length
)
{
if
(
history
.
action
===
'POP'
&&
history
.
length
<=
3
)
{
if
(
history
.
action
===
'POP'
&&
history
.
length
<=
3
)
{
history
.
push
(
'/'
)
}
else
{
const
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
,
search
:
''
}};
const
redirectURI
=
getParam
(
'redirect'
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
history
.
replace
(
from
);
if
(
!
(
this
.
props
.
user
&&
this
.
props
.
user
.
stage
))
{
const
from
=
location
.
state
&&
location
.
state
.
from
||
{
pathname
:
'/'
,
search
:
''
};
const
redirectURI
=
getParam
(
'redirect'
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
history
.
replace
(
from
);
}
}
}
}
...
...
src/components/passport/setPassword/index.js
View file @
18e24611
...
...
@@ -16,11 +16,6 @@ import { connect } from "react-redux";
class
SetPassword
extends
Component
{
componentDidMount
()
{
// console.log(this.props.location);
}
render
()
{
let
{
values
,
errors
,
location
}
=
this
.
props
let
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
}}
...
...
@@ -75,7 +70,7 @@ const formikConfig = {
},
handleSubmit
:
(
values
,
{
props
})
=>
{
let
{
from
}
=
props
.
location
.
state
||
{
from
:
{
pathname
:
'/'
}
}
let
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
||
{
pathname
:
'/'
}
if
(
from
.
pathname
.
includes
(
'forgot-password'
))
{
forgotPasswordReset
(
values
,
props
);
}
else
{
...
...
@@ -129,7 +124,7 @@ function bindMobileSetPassword(values, props) {
.
then
(
res
=>
{
if
(
res
.
data
.
errno
==
200
)
{
Toast
.
info
(
'密码设置成功'
)
let
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
}
}
let
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
||
{
pathname
:
'/'
}
setTimeout
(
function
()
{
props
.
history
.
replace
(
from
.
pathname
)
},
1000
)
...
...
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