提交 f9a8d240587daea83c367e7f4757dd30945ad550

作者 愚道
1 个父辈 8e2e98a5

fix service request params bug

... ... @@ -3,6 +3,6 @@ import request from 'umi-request';
3 3 export async function fakeSubmitForm(params) {
4 4 return request('/api/BLOCK_NAME/forms', {
5 5 method: 'POST',
6   - body: params,
  6 + data: params,
7 7 });
8 8 }
... ...
... ... @@ -3,6 +3,6 @@ import request from 'umi-request';
3 3 export async function fakeSubmitForm(params) {
4 4 return request('/api/BLOCK_NAME/forms', {
5 5 method: 'POST',
6   - body: params,
  6 + data: params,
7 7 });
8 8 }
... ...
... ... @@ -3,6 +3,6 @@ import request from 'umi-request';
3 3 export async function fakeSubmitForm(params) {
4 4 return request('/api/BLOCK_NAME/forms', {
5 5 method: 'POST',
6   - body: params,
  6 + data: params,
7 7 });
8 8 }
... ...
1 1 import { routerRedux } from 'dva/router';
2   -import { stringify } from 'query-string';
3 2 import { getPageQuery } from './utils/utils';
4 3 import { setAuthority } from './utils/authority';
5 4 import { reloadAuthorized } from './utils/Authorized';
... ... @@ -44,25 +43,6 @@ export default {
44 43 *getCaptcha({ payload }, { call }) {
45 44 yield call(getFakeCaptcha, payload);
46 45 },
47   -
48   - *logout(_, { put }) {
49   - yield put({
50   - type: 'changeLoginStatus',
51   - payload: {
52   - status: false,
53   - currentAuthority: 'guest',
54   - },
55   - });
56   - reloadAuthorized();
57   - yield put(
58   - routerRedux.push({
59   - pathname: '/user/login',
60   - search: stringify({
61   - redirect: window.location.href,
62   - }),
63   - })
64   - );
65   - },
66 46 },
67 47
68 48 reducers: {
... ...
... ... @@ -3,7 +3,7 @@ import request from 'umi-request';
3 3 export async function fakeAccountLogin(params) {
4 4 return request('/api/BLOCK_NAME/account', {
5 5 method: 'POST',
6   - body: params,
  6 + data: params,
7 7 });
8 8 }
9 9
... ...
  1 +import { parse } from 'query-string'
  2 +
1 3 export function getPageQuery() {
2 4 return parse(window.location.href.split('?')[1]);
3 5 }
... ...
... ... @@ -3,6 +3,6 @@ import request from 'umi-request';
3 3 export async function fakeRegister(params) {
4 4 return request('/api/BLOCK_NAME/register', {
5 5 method: 'POST',
6   - body: params,
  6 + data: params,
7 7 });
8 8 }
... ...
注册登录 后发表评论