admin-web 接入新的登陆接口
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { routerRedux } from 'dva/router';
|
||||
import { stringify } from 'qs';
|
||||
import { getFakeCaptcha } from '@/services/api';
|
||||
import { oauth2UsernameAuthenticate } from '@/services/system';
|
||||
import { passportLogin } from '@/services/system';
|
||||
import { setAuthority } from '@/utils/authority';
|
||||
import { getPageQuery } from '@/utils/utils';
|
||||
import { reloadAuthorized } from '@/utils/Authorized';
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
|
||||
effects: {
|
||||
*login({ payload }, { call, put }) {
|
||||
const response = yield call(oauth2UsernameAuthenticate, payload);
|
||||
const response = yield call(passportLogin, payload);
|
||||
yield put({
|
||||
type: 'changeLoginStatus',
|
||||
payload: response,
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
if (response.code === 0) {
|
||||
|
||||
// 保存 token 到 localStorage,发送请求的时候,会自动取 token 放到 header
|
||||
setLoginToken(response.data.token.accessToken, response.data.token.refreshToken);
|
||||
setLoginToken(response.data.authorization.accessToken, response.data.authorization.refreshToken);
|
||||
// 此处直接设置为 admin、和 user 角色,因为暂时不做服务控制前段 角色
|
||||
setAuthority(['admin', 'user']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user