提交 f9a8d240587daea83c367e7f4757dd30945ad550

作者 愚道
1 个父辈 8e2e98a5

fix service request params bug

@@ -3,6 +3,6 @@ import request from 'umi-request'; @@ -3,6 +3,6 @@ import request from 'umi-request';
3 export async function fakeSubmitForm(params) { 3 export async function fakeSubmitForm(params) {
4 return request('/api/BLOCK_NAME/forms', { 4 return request('/api/BLOCK_NAME/forms', {
5 method: 'POST', 5 method: 'POST',
6 - body: params, 6 + data: params,
7 }); 7 });
8 } 8 }
@@ -3,6 +3,6 @@ import request from 'umi-request'; @@ -3,6 +3,6 @@ import request from 'umi-request';
3 export async function fakeSubmitForm(params) { 3 export async function fakeSubmitForm(params) {
4 return request('/api/BLOCK_NAME/forms', { 4 return request('/api/BLOCK_NAME/forms', {
5 method: 'POST', 5 method: 'POST',
6 - body: params, 6 + data: params,
7 }); 7 });
8 } 8 }
@@ -3,6 +3,6 @@ import request from 'umi-request'; @@ -3,6 +3,6 @@ import request from 'umi-request';
3 export async function fakeSubmitForm(params) { 3 export async function fakeSubmitForm(params) {
4 return request('/api/BLOCK_NAME/forms', { 4 return request('/api/BLOCK_NAME/forms', {
5 method: 'POST', 5 method: 'POST',
6 - body: params, 6 + data: params,
7 }); 7 });
8 } 8 }
1 import { routerRedux } from 'dva/router'; 1 import { routerRedux } from 'dva/router';
2 -import { stringify } from 'query-string';  
3 import { getPageQuery } from './utils/utils'; 2 import { getPageQuery } from './utils/utils';
4 import { setAuthority } from './utils/authority'; 3 import { setAuthority } from './utils/authority';
5 import { reloadAuthorized } from './utils/Authorized'; 4 import { reloadAuthorized } from './utils/Authorized';
@@ -44,25 +43,6 @@ export default { @@ -44,25 +43,6 @@ export default {
44 *getCaptcha({ payload }, { call }) { 43 *getCaptcha({ payload }, { call }) {
45 yield call(getFakeCaptcha, payload); 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 reducers: { 48 reducers: {
@@ -3,7 +3,7 @@ import request from 'umi-request'; @@ -3,7 +3,7 @@ import request from 'umi-request';
3 export async function fakeAccountLogin(params) { 3 export async function fakeAccountLogin(params) {
4 return request('/api/BLOCK_NAME/account', { 4 return request('/api/BLOCK_NAME/account', {
5 method: 'POST', 5 method: 'POST',
6 - body: params, 6 + data: params,
7 }); 7 });
8 } 8 }
9 9
  1 +import { parse } from 'query-string'
  2 +
1 export function getPageQuery() { 3 export function getPageQuery() {
2 return parse(window.location.href.split('?')[1]); 4 return parse(window.location.href.split('?')[1]);
3 } 5 }
@@ -3,6 +3,6 @@ import request from 'umi-request'; @@ -3,6 +3,6 @@ import request from 'umi-request';
3 export async function fakeRegister(params) { 3 export async function fakeRegister(params) {
4 return request('/api/BLOCK_NAME/register', { 4 return request('/api/BLOCK_NAME/register', {
5 method: 'POST', 5 method: 'POST',
6 - body: params, 6 + data: params,
7 }); 7 });
8 } 8 }
注册登录 后发表评论