Commit 382f96d9 by zhanghaozhe

修改登录接口

parent 69c28b11
......@@ -44,6 +44,7 @@
"jest-watch-typeahead": "^0.2.1",
"js-base64": "^2.5.1",
"js-cookie": "^2.2.0",
"json-stringify-safe": "^5.0.1",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"lodash": "^4.17.15",
......
......@@ -9,6 +9,7 @@ import { compose } from 'redux'
import { getParam, http, browser } from "@/utils"
import { Toast } from "antd-mobile"
import { addDays } from 'date-fns'
import stringify from 'json-stringify-safe'
//拦截ajax请求,返回mock数据
......@@ -69,7 +70,7 @@ class App extends Component {
this.getUser()
}
if (location.pathname === '/passport') {
window.localStorage.setItem('binding_redirect', JSON.stringify(this.previousLocation))
window.localStorage.setItem('binding_redirect', stringify(this.previousLocation))
}
const {pathname, state} = location
if (pathname.startsWith('/passport')) {
......
......@@ -48,13 +48,13 @@ class Passport extends Component {
{
logo: qq,
text: 'QQ',
url: `${API["passport-api"]}/mob/qqlogin?redirect_url=${encodeURIComponent(this.redirectURL)}`,
url: `${API["passport-api"]}/m/login/qqLogin?redirect_url=${encodeURIComponent(this.redirectURL)}`,
id: 'qq'
},
{
logo: sina,
text: '新浪',
url: `${API['passport-api']}/mob/sinalogin?redirect_url=${encodeURIComponent(this.redirectURL)}`,
url: `${API['passport-api']}/m/login/sinaLogin?redirect_url=${encodeURIComponent(this.redirectURL)}`,
id: 'sina'
}
]
......
......@@ -4,7 +4,7 @@ import jsCookie from 'js-cookie'
const accountLogin = user => dispatch => {
return http.post(`${API['passport-api']}/user_login`, {
return http.post(`${API['passport-api']}/m/login/accountLogin`, {
user_name: user.username,
password: encrypt(user.password),
is_encrypt: 1,
......@@ -15,7 +15,7 @@ const accountLogin = user => dispatch => {
}
const quickLogin = user => dispatch => {
return http.post(`${API['passport-api']}/quick_login`, {
return http.post(`${API['passport-api']}/m/login/quickLogin`, {
...user,
plat: 5
}).then(res => {
......@@ -26,7 +26,7 @@ const quickLogin = user => dispatch => {
const storeUser = (res, dispatch) => {
const data = res.data
let payload
if (data.errno === 0) {
if (data.errno === 200) {
const {user_name: username, avatar_file: avatar,is_vip: isVIP, ...rest} = data.data.user_info
payload = {
hasError: false,
......
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