mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 11:05:06 +08:00
进一步重构社交登陆的实现
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import {login, logout, getInfo, socialLogin, socialLogin2} from '@/api/login'
|
||||
import {login, logout, getInfo, socialQuickLogin, socialBindLogin} from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
|
||||
const user = {
|
||||
@ -57,7 +57,7 @@ const user = {
|
||||
const state = userInfo.state
|
||||
const type = userInfo.type
|
||||
return new Promise((resolve, reject) => {
|
||||
socialLogin(type, code, state).then(res => {
|
||||
socialQuickLogin(type, code, state).then(res => {
|
||||
res = res.data;
|
||||
setToken(res.token)
|
||||
commit('SET_TOKEN', res.token)
|
||||
@ -76,7 +76,7 @@ const user = {
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password
|
||||
return new Promise((resolve, reject) => {
|
||||
socialLogin2(type, code, state, username, password).then(res => {
|
||||
socialBindLogin(type, code, state, username, password).then(res => {
|
||||
res = res.data;
|
||||
setToken(res.token)
|
||||
commit('SET_TOKEN', res.token)
|
||||
|
Reference in New Issue
Block a user