Commit a3bfbf5e by zhanghaozhe

红包统计

parent 87099ecc
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数据
......@@ -46,6 +46,8 @@ class App extends Component {
this.setNavigationRecord(this.props.location)
window.addEventListener('beforeunload', this.removeShareCodeCookie)
//平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'})
......@@ -70,12 +72,18 @@ class App extends Component {
return
}
location.state = {from: this.previousLocation};
} else {
this.removeShareCodeCookie()
}
})
}
removeShareCodeCookie = () => {
cookie.remove('share_code', {path: '/', domain: '.julyedu.com'})
}
setNavigationRecord = (location) => {
let {location: _location} = this.props
let {state: _state = {}} = _location
......
......@@ -56,7 +56,11 @@ class RedPacket extends PureComponent {
this.judgePopupType();
window.addEventListener('beforeunload', this.removeStatisticsCookie)
if(!this.props.userInfo || !this.props.userInfo.uid) {
this.setRelativeCookie()
}
// 微信进入
const isWechat = getParam('wechat');
const { userInfo } = this.props;
......@@ -113,7 +117,6 @@ class RedPacket extends PureComponent {
componentWillUnmount() {
window.removeEventListener('beforeunload', this.removeStatisticsCookie)
this.removeStatisticsCookie()
}
......
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