Commit d669b678 by wangshuo

合并master

parents e18d5e04 1670e3e8
...@@ -14,7 +14,11 @@ ...@@ -14,7 +14,11 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts( importScripts(
<<<<<<< HEAD
"/precache-manifest.24de3a7f1901319e314914a540e9db15.js" "/precache-manifest.24de3a7f1901319e314914a540e9db15.js"
=======
"/precache-manifest.abe621760f8f2b29b2d7a83410923ff7.js"
>>>>>>> master
); );
workbox.clientsClaim(); workbox.clientsClaim();
......
import React, { Component } from 'react' import React, {Component} from 'react'
import Routes from './router' import Routes from './router'
import cookie from 'js-cookie' import cookie from 'js-cookie'
import { connect } from "react-redux" import {connect} from "react-redux"
import { setCurrentUser, startFetchUser } from "@/store/userAction" import {setCurrentUser, startFetchUser} from "@/store/userAction"
import { initialState } from "@/store/userReducer" import {initialState} from "@/store/userReducer"
import { withRouter, Link } from 'react-router-dom' import {withRouter, Link} from 'react-router-dom'
import { compose } from 'redux' import {compose} from 'redux'
import { getParam, http, browser } from "@/utils" import {getParam, http, browser} from "@/utils"
import { Toast } from "antd-mobile" import {Toast} from "antd-mobile"
import { addDays } from 'date-fns' import {addDays} from 'date-fns'
import stringify from 'json-stringify-safe' import stringify from 'json-stringify-safe'
...@@ -24,6 +24,13 @@ import './assets/css/index.scss' ...@@ -24,6 +24,13 @@ import './assets/css/index.scss'
import './assets/font/iconfont.css' import './assets/font/iconfont.css'
class App extends Component { class App extends Component {
constructor(props) {
super(props)
this.state = {
isShowActivityEntry: 0,
isShowChannel: 0
}
}
static displayName = 'App' static displayName = 'App'
...@@ -36,20 +43,15 @@ class App extends Component { ...@@ -36,20 +43,15 @@ class App extends Component {
firstLoad = true firstLoad = true
componentWillMount() { componentWillMount() {
if (!getParam('version')) {
if (!cookie.get('qimoClientIdedu')) {
this.getqimoClientId()
} else {
window.qimoClientId = cookie.get('qimoClientIdedu')
}
}
let url = window.location.href; let url = window.location.href;
if(url.indexOf('ccode')) { if(url.indexOf('ccode') > -1) {
cookie.set('ccode', getParam('ccode'), { expires: 1, domain: '.julyedu.com', path: '/' }) cookie.set('ccode', getParam('ccode'), { expires: 1, domain: '.julyedu.com', path: '/' })
} }
} }
componentDidMount() { componentDidMount() {
this.getStage()
this.umengStatistic() this.umengStatistic()
//平台信息 //平台信息
!getParam('version') && cookie.set('plat', '5', {domain: '.julyedu.com'}) !getParam('version') && cookie.set('plat', '5', {domain: '.julyedu.com'})
...@@ -96,10 +98,25 @@ class App extends Component { ...@@ -96,10 +98,25 @@ class App extends Component {
this.removeShareCodeCookie() this.removeShareCodeCookie()
} }
}) })
}
// 获取宝箱阶段
getStage = () => {
let ccode = cookie.get('ccode')
http.get(`${API.home}/activity/stage?ccode=${ccode}`).then(res => {
const {code, data, msg} = res.data
if (code === 200) {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({
isShowActivityEntry: data.treasure_stage,
isShowChannel: data.is_show_site_window_by_channel
})
if (!getParam('version')) { window.sessionStorage.setItem('isShowSiteWindowByChannel', data.is_show_site_window_by_channel)
this.QimoClient() } else {
Toast.info(msg, 2)
} }
})
} }
umengStatistic = () => { umengStatistic = () => {
...@@ -209,6 +226,7 @@ class App extends Component { ...@@ -209,6 +226,7 @@ class App extends Component {
if (!this.props.user.hasError && getParam('redirect')) { if (!this.props.user.hasError && getParam('redirect')) {
window.location.href = getParam('redirect') window.location.href = getParam('redirect')
} }
} }
setPreviousLocation = () => { setPreviousLocation = () => {
...@@ -282,51 +300,15 @@ class App extends Component { ...@@ -282,51 +300,15 @@ class App extends Component {
} }
} }
// 七陌客服代码 start
getqimoClientId = () => {
http.post(`${API['home']}/qiMoUserId`)
.then(res => {
if (res.data.code == 200) {
window.qimoClientId = res.data.data.userId
cookie.set('qimoClientIdedu', res.data.data.userId, {domain: '.julyedu.com'})
}
})
.catch(function () {
})
}
QimoClient = () => {
let zhihu_cb = getParam('cb')
var src = ''
// 知乎投放
if (zhihu_cb) {
src = 'https://webchat.7moor.com/javascripts/7moorInit.js?accessId=e2ca4f90-2d04-11ea-84c3-43908ae47640&autoShow=false&language=ZHCN'
} else {
// m端
src = 'https://webchat.7moor.com/javascripts/7moorInit.js?accessId=fbcf9aa0-2d03-11ea-84c3-43908ae47640&autoShow=false&language=ZHCN'
}
var script = document.createElement('script')
script.type = 'text/javascript'
script.src = src
script.async = 'async'
document.body.appendChild(script)
}
// 七陌客服代码 end
render() { render() {
return <> return <>
<Routes/> <Routes/>
{ {
/*this.state.isShowActivityEntry && !!this.state.isShowActivityEntry && !!this.state.isShowChannel &&
<Link className={'year19-index'} to="/box/boxActive"> <Link className={'year19-index'} to="/box/boxActive">
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/treasure-active/m/global-entry.png" alt=""/> <img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/treasure-active/m/global-entry.png"
</Link>*/ alt=""/>
</Link>
} }
</> </>
} }
......
...@@ -633,3 +633,8 @@ ...@@ -633,3 +633,8 @@
height: 8px; height: 8px;
background-color: #F3F4F8; background-color: #F3F4F8;
} }
.index-box ~ .year19-index {
display: none;
}
\ No newline at end of file
...@@ -221,7 +221,7 @@ class YearCourse extends Component { ...@@ -221,7 +221,7 @@ class YearCourse extends Component {
toQQque = () => { toQQque = () => {
if (!getParam('version')) { if (!getParam('version')) {
qimoChatClick() location.href = 'http://q.url.cn/s/Vbkup6m?_type=wpa'
} else { } else {
SendMessageToApp("toQQ", 'https://q.url.cn/AB8aue?_type=wpa&qidian=true') SendMessageToApp("toQQ", 'https://q.url.cn/AB8aue?_type=wpa&qidian=true')
} }
......
...@@ -43,7 +43,7 @@ class Landing extends Component { ...@@ -43,7 +43,7 @@ class Landing extends Component {
this.fetchPageData() this.fetchPageData()
this.getIndexData() this.getIndexData()
window.showFollowAlert = this.remind.bind(this, 'create') window.showFollowAlert = this.remind.bind(this, 'create')
document.title = 'AI充电季,开宝箱免费学AI爆款好课,300本程序员必备纸质书免费送,AI进阶宝典来就送!-七月在线' document.title = 'AI就业季,开宝箱免费拿VIP年会员,200本程序员必备纸质书免费包邮送!- 七月在线'
const landing = document.querySelector('#landing') const landing = document.querySelector('#landing')
const boxContainer = document.querySelector('.box-container') const boxContainer = document.querySelector('.box-container')
if (boxContainer.offsetHeight < window.innerHeight) { if (boxContainer.offsetHeight < window.innerHeight) {
...@@ -89,7 +89,7 @@ class Landing extends Component { ...@@ -89,7 +89,7 @@ class Landing extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data, msg} = res.data const {code, data, msg} = res.data
if (code === 200) { if (code === 200) {
if (Number(data.activity_stage) === 0) { if (Number(data.treasure_stage) === 0) {
this.props.history.push('/'); this.props.history.push('/');
return; return;
} }
......
...@@ -43,7 +43,7 @@ class MyTreasure extends Component { ...@@ -43,7 +43,7 @@ class MyTreasure extends Component {
componentDidMount() { componentDidMount() {
this.fetchMyTreasure() this.fetchMyTreasure()
this.fetchActivityStatus() this.fetchActivityStatus()
document.title = 'AI充电季,开宝箱免费学AI爆款好课,300本程序员必备纸质书免费送,AI进阶宝典来就送!-七月在线'; document.title = 'AI就业季,开宝箱免费拿VIP年会员,200本程序员必备纸质书免费包邮送!- 七月在线';
} }
componentWillReceiveProps(nextProp) { componentWillReceiveProps(nextProp) {
...@@ -309,7 +309,7 @@ class MyTreasure extends Component { ...@@ -309,7 +309,7 @@ class MyTreasure extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data} = res.data const {code, data} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) { if(Number(data.treasure_stage) === 0) {
this.props.history.push('/'); this.props.history.push('/');
return; return;
} }
......
...@@ -221,7 +221,7 @@ class YearCourse extends Component { ...@@ -221,7 +221,7 @@ class YearCourse extends Component {
toQQque = () => { toQQque = () => {
if (!getParam('version')) { if (!getParam('version')) {
qimoChatClick() location.href = 'http://q.url.cn/s/Vbkup6m?_type=wpa'
} else { } else {
SendMessageToApp("toQQ", 'https://q.url.cn/AB8aue?_type=wpa&qidian=true') SendMessageToApp("toQQ", 'https://q.url.cn/AB8aue?_type=wpa&qidian=true')
} }
......
...@@ -39,7 +39,7 @@ export default class index extends Component { ...@@ -39,7 +39,7 @@ export default class index extends Component {
_this.loginInfo(result) _this.loginInfo(result)
} }
_this.getStage() _this.getStage()
document.title = 'AI充电季,开宝箱免费学AI爆款好课,300本程序员必备纸质书免费送,AI进阶宝典来就送!-七月在线'; document.title = 'AI就业季,开宝箱免费拿VIP年会员,200本程序员必备纸质书免费包邮送!- 七月在线';
} }
// 获取app登录数据 // 获取app登录数据
...@@ -110,7 +110,7 @@ export default class index extends Component { ...@@ -110,7 +110,7 @@ export default class index extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data, msg} = res.data const {code, data, msg} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) { if(Number(data.treasure_stage) === 0) {
this.props.history.push('/'); this.props.history.push('/');
return; return;
} }
......
...@@ -23,9 +23,9 @@ class YarnWish extends Component { ...@@ -23,9 +23,9 @@ class YarnWish extends Component {
componentWillUpdate() { componentWillUpdate() {
const {activityStage} = this.state const {activityStage} = this.state
if (activityStage == 1) { if (activityStage == 1) {
document.title = `七月在线年终大回馈,人气好课免费学,精品课程1分抢!` document.title = `AI就业季,开宝箱免费拿VIP年会员,200本程序员必备纸质书免费包邮送!- 七月在线`
} else { } else {
document.title = `七月在线年终大回馈,人气好课免费学,精品课程1分抢!` document.title = `AI就业季,开宝箱免费拿VIP年会员,200本程序员必备纸质书免费包邮送!- 七月在线`
} }
} }
......
...@@ -313,10 +313,6 @@ class BtnStatus extends Component { ...@@ -313,10 +313,6 @@ class BtnStatus extends Component {
}); });
} }
qimoChatClick = () => {
qimoChatClick()
}
render() { render() {
// data 课程信息;barInfo 砍价信息 // data 课程信息;barInfo 砍价信息
const {user = {}, toCart, country} = this.props; const {user = {}, toCart, country} = this.props;
...@@ -355,7 +351,7 @@ class BtnStatus extends Component { ...@@ -355,7 +351,7 @@ class BtnStatus extends Component {
{ {
info.is_baoming === 0 && info.group_status !== 3 && info.is_baoming === 0 && info.group_status !== 3 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' onClick={() => this.qimoChatClick()}> <a className='consult consult-s' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -376,7 +372,7 @@ class BtnStatus extends Component { ...@@ -376,7 +372,7 @@ class BtnStatus extends Component {
{ {
info.is_baoming === 0 && info.is_deposit != 0 && info.is_baoming === 0 && info.is_deposit != 0 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-m' onClick={() => this.qimoChatClick()}> <a className='consult consult-m' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'/> <i className='iconfont iconerji'/>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -390,7 +386,7 @@ class BtnStatus extends Component { ...@@ -390,7 +386,7 @@ class BtnStatus extends Component {
{ {
info.is_baoming === 1 && info.is_baoming === 1 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-m' onClick={() => this.qimoChatClick()}> <a className='consult consult-m' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'/> <i className='iconfont iconerji'/>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -403,7 +399,7 @@ class BtnStatus extends Component { ...@@ -403,7 +399,7 @@ class BtnStatus extends Component {
{ {
info.is_baoming === 0 && info.group_status === 3 && info.is_baoming === 0 && info.group_status === 3 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' onClick={() => this.qimoChatClick()}> <a className='consult consult-s' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -424,7 +420,7 @@ class BtnStatus extends Component { ...@@ -424,7 +420,7 @@ class BtnStatus extends Component {
{ {
info.is_baoming === 0 && info.group_status === 4 && info.is_baoming === 0 && info.group_status === 4 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' onClick={() => this.qimoChatClick()}> <a className='consult consult-s' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -438,7 +434,7 @@ class BtnStatus extends Component { ...@@ -438,7 +434,7 @@ class BtnStatus extends Component {
{ {
info.is_baoming === 0 && this.props.data && this.props.data.is_bargain && info.is_baoming === 0 && this.props.data && this.props.data.is_bargain &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' onClick={() => this.qimoChatClick()}> <a className='consult consult-s' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -466,7 +462,7 @@ class BtnStatus extends Component { ...@@ -466,7 +462,7 @@ class BtnStatus extends Component {
{ {
this.state.isbuy === 20 && this.state.isbuy === 20 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult-l' onClick={() => this.qimoChatClick()}> <a className='consult-l' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -477,7 +473,7 @@ class BtnStatus extends Component { ...@@ -477,7 +473,7 @@ class BtnStatus extends Component {
{ {
(info.is_aist && (this.props.user.hasError || info.is_baoming === 0)) && (info.is_aist && (this.props.user.hasError || info.is_baoming === 0)) &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-m' onClick={() => this.qimoChatClick()}> <a className='consult consult-m' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -491,7 +487,7 @@ class BtnStatus extends Component { ...@@ -491,7 +487,7 @@ class BtnStatus extends Component {
{ {
info.is_aist && !this.props.user.hasError && info.is_baoming === 1 && info.is_aist && !this.props.user.hasError && info.is_baoming === 1 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-m' onClick={() => this.qimoChatClick()}> <a className='consult consult-m' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
...@@ -531,7 +527,7 @@ class BtnStatus extends Component { ...@@ -531,7 +527,7 @@ class BtnStatus extends Component {
* limit_free_status: 0 未领取 1已领取未过期 2已过期 * limit_free_status: 0 未领取 1已领取未过期 2已过期
* */ * */
info.is_baoming === 0 && info.is_limit_free && info.limit_free_status == 0 && <div className='btns-box'> info.is_baoming === 0 && info.is_limit_free && info.limit_free_status == 0 && <div className='btns-box'>
<a className='consult consult-m' onClick={() => this.qimoChatClick()}> <a className='consult consult-m' href='http://q.url.cn/s/Vbkup6m?_type=wpa'>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
......
...@@ -50,6 +50,7 @@ class Detail extends Component { ...@@ -50,6 +50,7 @@ class Detail extends Component {
isRedPacket: true, isRedPacket: true,
countDownTime: '20s', countDownTime: '20s',
isShowChannel: window.sessionStorage.getItem('isShowSiteWindowByChannel')
} }
} }
...@@ -78,7 +79,6 @@ class Detail extends Component { ...@@ -78,7 +79,6 @@ class Detail extends Component {
if (getParam('ac') && Number(getParam('ac')) === 11) { if (getParam('ac') && Number(getParam('ac')) === 11) {
this.getBorwerCourse(); this.getBorwerCourse();
} }
} }
getBorwerCourse = () => { getBorwerCourse = () => {
...@@ -575,7 +575,11 @@ class Detail extends Component { ...@@ -575,7 +575,11 @@ class Detail extends Component {
<ExpandActiveToast/> <ExpandActiveToast/>
{
this.state.isShowChannel == 1 &&
<CallApp className='toapp' path={`/detail/id=${getParam('id')}`}/> <CallApp className='toapp' path={`/detail/id=${getParam('id')}`}/>
}
{/*弹幕*/} {/*弹幕*/}
<Barrage isShow={course_info.is_show}/> <Barrage isShow={course_info.is_show}/>
......
...@@ -28,7 +28,8 @@ class PythonDes extends Component { ...@@ -28,7 +28,8 @@ class PythonDes extends Component {
toApp: false, toApp: false,
payMoney: 0, payMoney: 0,
isOnline: true, //课程是否上架 isOnline: true, //课程是否上架
courseInfo: {} courseInfo: {},
isShowChannel: window.sessionStorage.getItem('isShowSiteWindowByChannel')
} }
} }
...@@ -219,9 +220,10 @@ class PythonDes extends Component { ...@@ -219,9 +220,10 @@ class PythonDes extends Component {
) )
} }
{
this.state.isShowChannel == 1 &&
<CallApp className='toapp'/> <CallApp className='toapp'/>
}
{/* 课程介绍 */} {/* 课程介绍 */}
<Description/> <Description/>
......
...@@ -14,7 +14,9 @@ class PythonStudy extends Component { ...@@ -14,7 +14,9 @@ class PythonStudy extends Component {
toApp: false, toApp: false,
courseInfo: '', courseInfo: '',
syllabus: '', syllabus: '',
learning: '' learning: '',
isShowChannel: window.sessionStorage.getItem('isShowSiteWindowByChannel')
}; };
} }
...@@ -112,7 +114,10 @@ class PythonStudy extends Component { ...@@ -112,7 +114,10 @@ class PythonStudy extends Component {
</div> </div>
} }
{
this.state.isShowChannel == 1 &&
<CallApp className='toapp'/> <CallApp className='toapp'/>
}
</div> </div>
{ {
......
...@@ -71,6 +71,21 @@ class Login extends Component { ...@@ -71,6 +71,21 @@ class Login extends Component {
history.push('/passport/student-login') history.push('/passport/student-login')
} }
componentDidMount() {
const {location} = this.props
const {action} = this.props.history
let pathname = location.state && location.state.from && location.state.from.pathname
let search = location.state && location.state.from && location.state.from.search
console.log(action,pathname,search);
if(action !== 'POP'){
let historyUrl = `${pathname}${search}`
window.localStorage.setItem('HistoryUrl',historyUrl)
}
}
render() { render() {
const { const {
loginWays, loginWays,
......
...@@ -15,6 +15,35 @@ import { connect } from "react-redux" ...@@ -15,6 +15,35 @@ import { connect } from "react-redux"
import { setCurrentUser } from '@/store/userAction' import { setCurrentUser } from '@/store/userAction'
class SetPassword extends Component { class SetPassword extends Component {
toFrom = () => {
let historyUrl = window.localStorage.getItem('HistoryUrl')
const {history} = this.props
history.push(historyUrl)
// window.localStorage.removeItem('HistoryUrl')
return
}
//
// componentDidMount() {
// const {location} = this.props
// const {action} = this.props.history
// let pathname = location.state && location.state.from && location.state.from.pathname
// let search = location.state && location.state.from && location.state.from.search
//
// console.log(location);
// console.log(location.state);
// console.log(action,pathname,search);
//
// // if(action !== 'PUSH'){
// // let historyUrl = `${pathname}${search}`
// // window.localStorage.setItem('HistoryUrl',historyUrl)
// // }
//
// }
render() { render() {
let {values, errors, location} = this.props let {values, errors, location} = this.props
let {from} = location.state || {from: {pathname: '/'}} let {from} = location.state || {from: {pathname: '/'}}
...@@ -52,7 +81,7 @@ class SetPassword extends Component { ...@@ -52,7 +81,7 @@ class SetPassword extends Component {
</Form> </Form>
<div className="skip" <div className="skip"
style={{display: from && from.pathname.includes('forgot-password') ? 'none' : 'block'}}> style={{display: from && from.pathname.includes('forgot-password') ? 'none' : 'block'}}>
<Link replace to='/passport/account-login'>跳过</Link> <span onClick={this.toFrom}>跳过</span>
</div> </div>
</div> </div>
</> </>
...@@ -68,7 +97,6 @@ const formikConfig = { ...@@ -68,7 +97,6 @@ const formikConfig = {
} }
}, },
handleSubmit: (values, {props}) => { handleSubmit: (values, {props}) => {
const {location} = props const {location} = props
let from = location.state && location.state.records && location.state.records[location.state.records.length - 2] || {pathname: '/'} let from = location.state && location.state.records && location.state.records[location.state.records.length - 2] || {pathname: '/'}
...@@ -117,7 +145,6 @@ function forgotPasswordReset(values, props) { ...@@ -117,7 +145,6 @@ function forgotPasswordReset(values, props) {
} }
function bindMobileSetPassword(values, props) { function bindMobileSetPassword(values, props) {
http.post(`${API['passport-api']}/bind_mobile/set_pwd_new`, { http.post(`${API['passport-api']}/bind_mobile/set_pwd_new`, {
uid: props.user.data.uid, uid: props.user.data.uid,
password: encrypt(values.password) password: encrypt(values.password)
...@@ -128,10 +155,21 @@ function bindMobileSetPassword(values, props) { ...@@ -128,10 +155,21 @@ function bindMobileSetPassword(values, props) {
Toast.info('密码设置成功') Toast.info('密码设置成功')
let from = location.state && location.state.from || {pathname: '/'} let from = location.state && location.state.from || {pathname: '/'}
let local_redirect_url = JSON.parse(window.localStorage.getItem('binding_redirect')) let local_redirect_url = JSON.parse(window.localStorage.getItem('binding_redirect'))
setTimeout(function () {
if (local_redirect_url) { // setTimeout(function () {
const {pathname, search, hash} = local_redirect_url // if (local_redirect_url) {
history.replace(pathname + search + hash) // const {pathname, search, hash} = local_redirect_url
// history.replace(pathname + search + hash)
// } else {
// history.replace(from.pathname)
// }
// }, 1000)
let HistoryUrl = window.localStorage.getItem('HistoryUrl')
setTimeout(()=> {
if (HistoryUrl) {
let historyUrl = window.localStorage.getItem('HistoryUrl')
props.history.push(historyUrl)
} else { } else {
history.replace(from.pathname) history.replace(from.pathname)
} }
......
...@@ -15,7 +15,8 @@ class PythonStudy extends Component { ...@@ -15,7 +15,8 @@ class PythonStudy extends Component {
toApp: false, toApp: false,
courseInfo: '', courseInfo: '',
syllabus: '', syllabus: '',
learning: '' learning: '',
isShowChannel: window.sessionStorage.getItem('isShowSiteWindowByChannel')
}; };
} }
...@@ -115,7 +116,10 @@ class PythonStudy extends Component { ...@@ -115,7 +116,10 @@ class PythonStudy extends Component {
</div> </div>
} }
<CallApp className={'toapp'}/> {
this.state.isShowChannel == 1 &&
<CallApp className='toapp'/>
}
<Accordion <Accordion
defaultActiveKey="0" defaultActiveKey="0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment