Commit 7fb7b733 by zhanghaozhe

app内登录bug

parent 7e60f9c5
......@@ -3,7 +3,7 @@ import Routes from './router'
import cookie from 'js-cookie'
import { connect } from "react-redux"
import { setCurrentUser, startFetchUser } from "@/store/userAction"
import {initialState} from "@/store/userReducer"
import { initialState } from "@/store/userReducer"
import { withRouter, Link } from 'react-router-dom'
import { compose } from 'redux'
import { getParam, http, browser } from "@/utils"
......@@ -34,18 +34,22 @@ class App extends Component {
pathnameBlacklist = ['/country', '/passport']
firstLoad = true
componentWillMount(){
componentWillMount() {
if (!getParam('version')) {
if(!cookie.get('qimoClientIdedu')){
if (!cookie.get('qimoClientIdedu')) {
this.getqimoClientId()
} else {
window.qimoClientId = cookie.get('qimoClientIdedu')}
window.qimoClientId = cookie.get('qimoClientIdedu')
}
}
}
componentDidMount() {
this.umengStatistic()
//平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'})
!getParam('version') && cookie.set('plat', '5', {domain: '.julyedu.com'})
if (browser.isWeixin && browser.isIOS) {
sessionStorage.setItem('enter_url', window.location.href)
......@@ -285,19 +289,19 @@ class App extends Component {
// 七陌客服代码 start
getqimoClientId =()=>{
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 () {
})
.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=()=>{
QimoClient = () => {
let utm_source = getParam('utm_source')
let utm_medium = getParam('utm_medium')
let utm_campaign = getParam('utm_campaign')
......@@ -320,8 +324,8 @@ class App extends Component {
document.body.appendChild(script)
}
// 七陌客服代码 end
// 七陌客服代码 end
render() {
......
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