Commit 7b4a11ae by xuzhenghua

cookie

parent 6ea13222
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -118,11 +118,13 @@ class BlessingPreheat extends Component {
loginInfo = (result) => {
this.setState({
userInfoList: result
})
if (this.state.userInfoList.length !== 0) {
}, () => {
if(this.state.userInfoList.length){
this.props.startFetchUser()
this.appLogin()
}
})
}
// 保存cookie
appLogin = () => {
......@@ -134,8 +136,6 @@ class BlessingPreheat extends Component {
cookie.set("uid", item.uid, {expires, path: '/', domain: '.julyedu.com'});
cookie.set("uname", item.uname, {expires, path: '/', domain: '.julyedu.com'});
cookie.set("avatar_file", item.avatar_file, {expires, path: '/', domain: '.julyedu.com'});
alert(cookie.get("uid"))
});
if (cookie.get("token") && cookie.get("uid")) {
......@@ -219,6 +219,7 @@ class BlessingPreheat extends Component {
const {userInfo} = this.state;
http.get(`${API.home}/sys/user/blessing`).then(res => {
const {code, data} = res.data
alert(code)
if (code === 200) {
this.setState({
isSign: !!data.today_signed,
......@@ -229,6 +230,7 @@ class BlessingPreheat extends Component {
inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0,
})
})
alert(cookie.get('uid'))
if (data.is_login === 1) {
this.handleToSign()
}
......
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