Commit c19303f6 by zhanghaozhe

微信登录无痕验证

parent 0018a825
...@@ -8,8 +8,8 @@ import { Link } from "react-router-dom" ...@@ -8,8 +8,8 @@ import { Link } from "react-router-dom"
import { connect } from "react-redux" import { connect } from "react-redux"
import { HeaderBar } from "@/common" import { HeaderBar } from "@/common"
import { http } from "@/utils" import { http } from "@/utils"
import { getCourses } from './../detail/actions';
import { setCurrentUser, startFetchUser } from "@/store/userAction" import { setCurrentUser, startFetchUser } from "@/store/userAction"
import {endFetchNoTrace} from '@/store/no-trace-validation/reducer'
const Item = List.Item; const Item = List.Item;
...@@ -17,7 +17,7 @@ const Brief = Item.Brief; ...@@ -17,7 +17,7 @@ const Brief = Item.Brief;
@connect(state => ({ @connect(state => ({
user: state.user, user: state.user,
}), {startFetchUser, setCurrentUser}) }), {startFetchUser, setCurrentUser, endFetchNoTrace})
class My extends PureComponent { class My extends PureComponent {
constructor(props) { constructor(props) {
super(props) super(props)
...@@ -34,6 +34,7 @@ class My extends PureComponent { ...@@ -34,6 +34,7 @@ class My extends PureComponent {
getUser = () => { getUser = () => {
this.props.startFetchUser() this.props.startFetchUser()
http.get(`${API.home}/m/user_info_sample/1`).then(res => { http.get(`${API.home}/m/user_info_sample/1`).then(res => {
this.props.endFetchNoTrace()
this.props.setCurrentUser(this.transformUser(res)) this.props.setCurrentUser(this.transformUser(res))
}) })
} }
......
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