Commit 0ee93465 by zhanghaozhe

微信登录redirect_url

parent f9d09faf
...@@ -23,12 +23,25 @@ import './assets/font/iconfont.css'; ...@@ -23,12 +23,25 @@ import './assets/font/iconfont.css';
class App extends Component { class App extends Component {
previousLocation = this.props.location previousLocation = {
...{
state: {
from:
{
pathname: this.props.location.pathname,
search: this.props.location.search,
hash: this.props.location.hash
}
}
},
...this.props.location
}
componentDidMount() { componentDidMount() {
//平台信息 //平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'}) cookie.set('plat', '5', {domain: '.julyedu.com'})
console.log(this.props.location);
this.props.startFetchUser() this.props.startFetchUser()
http.get(`${API.home}/m/user_info`).then(res => { http.get(`${API.home}/m/user_info`).then(res => {
......
...@@ -23,9 +23,10 @@ class Passport extends Component { ...@@ -23,9 +23,10 @@ class Passport extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
const {location: {state: {from}}} = props const {location} = props
const {pathname, search, hash} = location
const {from} = location.state || {from: {pathname: pathname, search: search, hash: hash}}
this.redirectURL = window.location.origin + from.pathname + from.search + from.hash this.redirectURL = window.location.origin + from.pathname + from.search + from.hash
// console.log(props.location);
this.state = { this.state = {
loginWays: [ loginWays: [
{ {
......
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