Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
8f3ca978
Commit
8f3ca978
authored
Sep 16, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login
parent
7e96afe2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
src/components/passport/index.js
+3
-4
src/components/passport/login/index.js
+9
-5
No files found.
src/components/passport/index.js
View file @
8f3ca978
...
...
@@ -15,6 +15,7 @@ import account from './account.png'
import
qq
from
'./qq.png'
import
sina
from
'./sina.png'
import
wechat
from
'./wechat.png'
import
{
getParam
}
from
"@/utils"
;
class
Passport
extends
Component
{
...
...
@@ -59,8 +60,6 @@ class Passport extends Component {
componentDidUpdate
()
{
this
.
routeWhenUserLoggedIn
()
// console.log(this.props.location);
}
...
...
@@ -72,8 +71,8 @@ class Passport extends Component {
history
.
push
(
'/'
)
}
else
{
const
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
,
search
:
''
}};
history
.
replace
(
from
);
// history.go(-1)
const
redirectURI
=
getParam
(
'redirect'
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
history
.
replace
(
from
);
}
}
}
...
...
src/components/passport/login/index.js
View file @
8f3ca978
...
...
@@ -12,7 +12,7 @@ import { connect } from 'react-redux';
import
{
compose
}
from
'redux'
;
import
{
isEmpty
}
from
'lodash'
import
{
Toast
}
from
'antd-mobile'
;
import
{
validateTel
}
from
"@/utils"
;
import
{
validateTel
,
getParam
}
from
"@/utils"
;
import
{
HeaderBar
}
from
"@/common"
;
...
...
@@ -27,13 +27,17 @@ class Login extends Component {
const
item
=
loginWays
.
find
(
item
=>
item
.
text
===
method
)
let
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
'/'
,
search
:
''
,
hash
:
''
}};
console
.
log
(
location
);
console
.
log
(
from
);
let
from
=
location
.
state
&&
location
.
state
.
from
||
{
from
:
{
pathname
:
'/'
,
search
:
window
.
location
.
search
,
hash
:
''
}
};
const
redirectURI
=
window
.
location
.
origin
+
from
.
pathname
+
from
.
search
+
from
.
hash
;
switch
(
method
)
{
case
'账号登录'
:
history
.
push
(
'/passport/account-login'
,
location
.
state
)
history
.
push
(
{
pathname
:
'/passport/account-login'
,
search
:
window
.
location
.
search
}
,
location
.
state
)
break
;
case
'微信'
:
window
.
location
.
assign
(
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=
${
encodeURIComponent
(
redirectURI
)}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment