| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { request, goCommonSearchUrl } from '@/utils/request/index';
- import { Method } from 'axios'
- /**
- * go 接口通用查询
- * @param url 接口路径
- * @param params 请求参数
- * @param method 请求方式
- * @returns
- */
- export function commonSearch_go(url: string, params: Object, method: Method = 'get'): Promise<any> {
- return request({
- method,
- url: goCommonSearchUrl(url),
- params,
- })
- .then((value) => value.data.data)
- .catch((err) => Promise.reject(err));
- }
- export interface BaseResponse{
- result: boolean
- message: String
- }
- /**
- * go 申请/修改类型返回 (不关心具体返回的数据, 只关心请求是否成功)
- * @param url 接口路径
- * @param params 请求参数
- * @param method 请求方式
- */
- export function commonUpdate_go(url: string, params: Object, method: Method = 'post'): Promise<BaseResponse> {
- return request({
- method,
- url: goCommonSearchUrl(url),
- params,
- })
- .then((value) => {
- return {
- result: value.data.code === 200 ? true : false,
- message: value.data.msg
- }
- })
- .catch((err) => Promise.reject(err));
- }
|