- 修改结构:短信 smsSign

- 修改结构:短信 smsTemplate
This commit is contained in:
cherishsince
2020-04-20 11:36:44 +08:00
parent ac86ca2a13
commit e36b32a97d
41 changed files with 2214 additions and 19 deletions

View File

@@ -1,9 +1,12 @@
import { pageSign, addSign, updateSign, deletedSign } from '../../services/sms';
import { addSign, deletedSign, pageSign, updateSign } from '../../services/sms';
export default {
namespace: 'smsSignList',
state: {
total: 0,
index: 1,
size: 20,
list: [],
},
@@ -13,7 +16,10 @@ export default {
if (response.code === 0) {
yield put({
type: 'pageSuccess',
payload: response.data,
payload: {
data: response.data,
params: payload,
},
});
}
},
@@ -46,10 +52,15 @@ export default {
reducers: {
pageSuccess(state, { payload }) {
const { data } = payload;
const { data, params } = payload;
const { pageNo, pageSize } = params;
const { list, total } = data;
return {
...state,
list: data,
size: pageSize,
index: pageNo,
total,
list,
};
},
},

View File

@@ -4,6 +4,9 @@ export default {
namespace: 'smsTemplateList',
state: {
total: 0,
index: 1,
size: 20,
list: [],
},
@@ -13,7 +16,10 @@ export default {
if (response.code === 0) {
yield put({
type: 'pageSuccess',
payload: response.data,
payload: {
data: response.data,
params: payload,
},
});
}
},
@@ -46,10 +52,15 @@ export default {
reducers: {
pageSuccess(state, { payload }) {
const { data } = payload;
const { data, params } = payload;
const { pageNo, pageSize } = params;
const { list, total } = data;
return {
...state,
list: data,
size: pageSize,
index: pageNo,
total,
list,
};
},
},

View File

@@ -40,9 +40,9 @@ class SignList extends PureComponent {
dispatch({
type: 'smsSignList/page',
payload: {
current,
pageNo: current,
total,
size,
pageSize: size,
...searchParams,
},
});

View File

@@ -42,9 +42,9 @@ class TemplateList extends PureComponent {
dispatch({
type: 'smsSignList/page',
payload: {
current: 1,
pageNo: 1,
total: 0,
size: 100,
pageSize: 100,
// ...searchParams,
},
});
@@ -57,9 +57,9 @@ class TemplateList extends PureComponent {
dispatch({
type: 'smsTemplateList/page',
payload: {
current,
pageNo: current,
total,
size,
pageSize: size,
...searchParams,
},
});

View File

@@ -10,14 +10,20 @@ export async function pageSign(params) {
}
export async function addSign(params) {
return request(`/admin-api/admins/sms/sign/add?${stringify(params)}`, {
return request(`/admin-api/admins/sms/sign/add`, {
method: 'POST',
body: {
...params,
},
});
}
export async function updateSign(params) {
return request(`/admin-api/admins/sms/sign/update?${stringify(params)}`, {
return request(`/admin-api/admins/sms/sign/update`, {
method: 'PUT',
body: {
...params,
},
});
}
@@ -30,8 +36,11 @@ export async function deletedSign(params) {
// template
export async function pageTemplate(params) {
return request(`/admin-api/admins/sms/template/page?${stringify(params)}`, {
method: 'GET',
return request(`/admin-api/admins/sms/template/page`, {
method: 'POST',
body: {
...params,
},
});
}