service.ts 751 Bytes
Newer Older
1
import request from 'umi-request';
陈帅's avatar
陈帅 committed
2
import { TableListParams } from './data';
3

陈帅's avatar
陈帅 committed
4
export async function queryRule(params: TableListParams) {
5 6 7 8 9
  return request(`/api/BLOCK_NAME`, {
    params,
  });
}

陈帅's avatar
陈帅 committed
10
export async function removeRule(params: TableListParams) {
11 12 13 14 15 16 17 18 19
  return request('/api/BLOCK_NAME', {
    method: 'POST',
    data: {
      ...params,
      method: 'delete',
    },
  });
}

陈帅's avatar
陈帅 committed
20
export async function addRule(params: TableListParams) {
21 22 23 24 25 26 27 28 29
  return request('/api/BLOCK_NAME', {
    method: 'POST',
    data: {
      ...params,
      method: 'post',
    },
  });
}

陈帅's avatar
陈帅 committed
30
export async function updateRule(params: TableListParams) {
31 32 33 34 35 36 37 38
  return request('/api/BLOCK_NAME', {
    method: 'POST',
    data: {
      ...params,
      method: 'update',
    },
  });
}