Commit 7fb7b733 by zhanghaozhe

app内登录bug

parent 7e60f9c5
...@@ -3,7 +3,7 @@ import Routes from './router' ...@@ -3,7 +3,7 @@ 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"
...@@ -34,18 +34,22 @@ class App extends Component { ...@@ -34,18 +34,22 @@ class App extends Component {
pathnameBlacklist = ['/country', '/passport'] pathnameBlacklist = ['/country', '/passport']
firstLoad = true firstLoad = true
componentWillMount(){
componentWillMount() {
if (!getParam('version')) { if (!getParam('version')) {
if(!cookie.get('qimoClientIdedu')){ if (!cookie.get('qimoClientIdedu')) {
this.getqimoClientId() this.getqimoClientId()
} else { } else {
window.qimoClientId = cookie.get('qimoClientIdedu')} window.qimoClientId = cookie.get('qimoClientIdedu')
}
} }
} }
componentDidMount() { componentDidMount() {
this.umengStatistic() this.umengStatistic()
//平台信息 //平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'}) !getParam('version') && cookie.set('plat', '5', {domain: '.julyedu.com'})
if (browser.isWeixin && browser.isIOS) { if (browser.isWeixin && browser.isIOS) {
sessionStorage.setItem('enter_url', window.location.href) sessionStorage.setItem('enter_url', window.location.href)
...@@ -285,19 +289,19 @@ class App extends Component { ...@@ -285,19 +289,19 @@ class App extends Component {
// 七陌客服代码 start // 七陌客服代码 start
getqimoClientId =()=>{ getqimoClientId = () => {
http.post(`${API['home']}/qiMoUserId`) http.post(`${API['home']}/qiMoUserId`)
.then(res => { .then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
window.qimoClientId = res.data.data.userId window.qimoClientId = res.data.data.userId
cookie.set('qimoClientIdedu', res.data.data.userId, {domain: '.julyedu.com'}) cookie.set('qimoClientIdedu', res.data.data.userId, {domain: '.julyedu.com'})
} }
}) })
.catch(function () { .catch(function () {
}) })
} }
QimoClient=()=>{ QimoClient = () => {
let utm_source = getParam('utm_source') let utm_source = getParam('utm_source')
let utm_medium = getParam('utm_medium') let utm_medium = getParam('utm_medium')
let utm_campaign = getParam('utm_campaign') let utm_campaign = getParam('utm_campaign')
...@@ -320,8 +324,8 @@ class App extends Component { ...@@ -320,8 +324,8 @@ class App extends Component {
document.body.appendChild(script) document.body.appendChild(script)
} }
// 七陌客服代码 end
// 七陌客服代码 end
render() { 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