Commit 41f4c4cf by xuzhenghua

用户id

parent 69a8c351
......@@ -32,13 +32,12 @@ class App extends Component {
pathnameBlacklist = ['/country', '/passport']
firstLoad = true
componentWillMount(){
this.getqimoClientId()
}
componentDidMount() {
this.umengStatistic()
this.QimoClient()
//平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'})
......@@ -204,6 +203,10 @@ class App extends Component {
if (!this.props.user.hasError && getParam('redirect')) {
window.location.href = getParam('redirect')
}
this.QimoClient()
}
setPreviousLocation = () => {
......@@ -279,6 +282,17 @@ class App extends Component {
// 七陌客服代码 start
getqimoClientId =()=>{
http.post(`${API['home']}/qiMoUserId`)
.then(res => {
if (res.data.code == 200) {
window.qimoClientId = res.data.data.userId
}
})
.catch(function () {
})
}
QimoClient=()=>{
let utm_source = getParam('utm_source')
let utm_medium = getParam('utm_medium')
......@@ -295,23 +309,11 @@ class App extends Component {
src = 'https://webchat.7moor.com/javascripts/7moorInit.js?accessId=fbcf9aa0-2d03-11ea-84c3-43908ae47640&autoShow=true&language=ZHCN'
}
var timestamp = new Date().getTime()
cookie.set('qimoClientIdTimestamp', timestamp, {domain: '.julyedu.com'})
var script = document.createElement('script')
script.type = 'text/javascript'
script.src = src
script.async = 'async'
var qimoClientId = ''// 自定义用户的唯一id,由英文字母,数字,下划线组成
http.get(`${API['home']}/qiMoUserId`)
.then(res => {
if (res.data.code == 200) {
qimoClientId = res.data.data.userId
}
console.log(qimoClientId)
document.body.appendChild(script)
})
document.body.appendChild(script)
}
// 七陌客服代码 end
......
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