Commit 3028447c by zhanghaozhe

Merge branch 'intelligent-recommend' into dev

parents 165e9abd 95f355c3
...@@ -29,7 +29,7 @@ class App extends Component { ...@@ -29,7 +29,7 @@ class App extends Component {
super(props) super(props)
this.state = { this.state = {
isShowActivityEntry: 0, isShowActivityEntry: 0,
isShowChannel: 0 isShowChannel: 0,
} }
this.globalEntry = null this.globalEntry = null
} }
...@@ -69,8 +69,8 @@ class App extends Component { ...@@ -69,8 +69,8 @@ class App extends Component {
this.getUser() this.getUser()
this.utm() this.utm()
const {history} = this.props const {history, location} = this.props
this.records.push(location)
this.setNavigationRecord(this.props.location, this.props.history.action) this.setNavigationRecord(this.props.location, this.props.history.action)
this.setPreviousLocation() this.setPreviousLocation()
...@@ -95,9 +95,9 @@ class App extends Component { ...@@ -95,9 +95,9 @@ class App extends Component {
from: { from: {
pathname: this.previousLocation.pathname, pathname: this.previousLocation.pathname,
search: this.previousLocation.search, search: this.previousLocation.search,
hash: this.previousLocation.hash hash: this.previousLocation.hash,
} },
} },
} }
} else { } else {
this.removeShareCodeCookie() this.removeShareCodeCookie()
...@@ -114,7 +114,7 @@ class App extends Component { ...@@ -114,7 +114,7 @@ class App extends Component {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({ this.setState({
isShowActivityEntry: data.treasure_stage, isShowActivityEntry: data.treasure_stage,
isShowChannel: data.is_show_site_window_by_channel isShowChannel: data.is_show_site_window_by_channel,
}, () => { }, () => {
data.treasure_stage && this.bindGlobalEntry() data.treasure_stage && this.bindGlobalEntry()
}) })
...@@ -171,7 +171,7 @@ class App extends Component { ...@@ -171,7 +171,7 @@ class App extends Component {
if (zhihu_cb) { if (zhihu_cb) {
let data = { let data = {
'zhihu_cb': zhihu_cb 'zhihu_cb': zhihu_cb,
} }
http.post(`${API['home']}/sys/zhihu/firstRecord`, data) http.post(`${API['home']}/sys/zhihu/firstRecord`, data)
...@@ -253,8 +253,8 @@ class App extends Component { ...@@ -253,8 +253,8 @@ class App extends Component {
user_name: username, user_name: username,
is_vip: isVIP, is_vip: isVIP,
uid, uid,
code code,
} },
} = res.data } = res.data
payload = { payload = {
...@@ -265,15 +265,15 @@ class App extends Component { ...@@ -265,15 +265,15 @@ class App extends Component {
isVIP, isVIP,
avatar, avatar,
uid, uid,
code code,
} },
} }
} else { } else {
payload = { payload = {
hasError: true, hasError: true,
msg: res.data.msg, msg: res.data.msg,
code: res.data.code, code: res.data.code,
data: {} data: {},
} }
} }
return payload return payload
...@@ -284,7 +284,7 @@ class App extends Component { ...@@ -284,7 +284,7 @@ class App extends Component {
if (data.errno == 200) { if (data.errno == 200) {
//移除红包统计cookie //移除红包统计cookie
this.removeShareCodeCookie() this.removeShareCodeCookie()
let {uid, token, avatar_file: avatar, uname: username,} = data.data let {uid, token, avatar_file: avatar, uname: username} = data.data
return { return {
hasError: false, hasError: false,
...@@ -292,9 +292,9 @@ class App extends Component { ...@@ -292,9 +292,9 @@ class App extends Component {
uid, uid,
token, token,
avatar, avatar,
username username,
}, },
msg: data.msg msg: data.msg,
} }
} else { } else {
let {code, msg} = data.data let {code, msg} = data.data
...@@ -302,7 +302,7 @@ class App extends Component { ...@@ -302,7 +302,7 @@ class App extends Component {
code, code,
msg, msg,
hasError: true, hasError: true,
data: {} data: {},
} }
} }
} }
...@@ -338,7 +338,7 @@ class App extends Component { ...@@ -338,7 +338,7 @@ class App extends Component {
closeGlobalEntry = () => { closeGlobalEntry = () => {
localStorage.setItem('globalEntryClosedTime', Date.now().toString()) localStorage.setItem('globalEntryClosedTime', Date.now().toString())
this.setState({ this.setState({
isShowActivityEntry: 0 isShowActivityEntry: 0,
}) })
} }
...@@ -377,7 +377,7 @@ class App extends Component { ...@@ -377,7 +377,7 @@ class App extends Component {
export default compose( export default compose(
connect( connect(
state => ({user: state.user}), state => ({user: state.user}),
{setCurrentUser, startFetchUser} {setCurrentUser, startFetchUser},
), ),
withRouter withRouter,
)(App) )(App)
...@@ -31,11 +31,12 @@ class IntelligentRecommend extends Component { ...@@ -31,11 +31,12 @@ class IntelligentRecommend extends Component {
} }
componentDidMount() { componentDidMount() {
const {user, intelligentRecommend, history} = this.props const {user, intelligentRecommend, history, reselect} = this.props
if (user.hasError) { if (user.hasError) {
return history.push('/passport') return history.push('/passport')
} }
if (!intelligentRecommend.processing.length) { if (isEmpty(intelligentRecommend.result)) {
reselect()
this.getMessage() this.getMessage()
} }
} }
......
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