Commit 5c1747e2 by zhanghaozhe

登录传redirect地址,统计用

parent e04d633d
......@@ -72,8 +72,9 @@ const formikConfig = {
handleSubmit(values, formikBag) {
const {account: username, password} = values
const {props, props: {history}} = formikBag
const from = props.location.state && props.location.state.from
props.accountLogin({
username, password
username, password,redirect: from && window.location.origin + from.pathname + from.search + from.hash
}).then(res => {
if (res.hasError) {
Toast.info(res.msg, 2, null, false)
......
......@@ -130,10 +130,12 @@ const FormikConfig = {
veriCode: ''
}),
handleSubmit(values, {props}) {
const from = props.location.state && props.location.state.from
props.quickLogin({
phone_num: values.tel,
phone_code: values.veriCode,
area_code: '00'+props.country.num
area_code: '00'+props.country.num,
redirect: from && window.location.origin + from.pathname + from.search + from.hash
}).then(res => {
if (res.hasError) {
Toast.info(res.msg);
......@@ -163,4 +165,4 @@ export default compose(
{quickLogin}
),
withFormik(FormikConfig),
)(Login)
\ No newline at end of file
)(Login)
......@@ -7,7 +7,8 @@ const accountLogin = user => dispatch => {
return http.post(`${API['passport-api']}/user_login`, {
user_name: user.username,
password: encrypt(user.password),
is_encrypt: 1
is_encrypt: 1,
redirect: user.redirect
}).then(res => {
return storeUser(res, dispatch)
})
......@@ -80,4 +81,4 @@ export {
updateUser,
START_FETCH_USER,
startFetchUser,
}
\ No newline at end of file
}
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