diff --git a/api/memorial/index.js b/api/memorial/index.js index cd8e3d9..6c120dd 100644 --- a/api/memorial/index.js +++ b/api/memorial/index.js @@ -1,5 +1,6 @@ // 往生殿相关API -import { get, post, put, del } from '@/utils/request' +import { del, get, post, put } from "@/utils/request"; +import request from "../../utils/request"; /** * 获取供奉列表 @@ -11,10 +12,10 @@ import { get, post, put, del } from '@/utils/request' * @returns {Promise} 返回供奉列表数据 */ export function getEnshrinedList(params) { - return get('/app/enshrined/indexList', params, { + return get("/app/enshrined/indexList", params, { timeout: 10000, showLoading: false, - }) + }); } /** @@ -28,10 +29,10 @@ export function getEnshrinedList(params) { * @returns {Promise} 返回创建结果 */ export function createEnshrined(data) { - return post('/app/enshrined', data, { + return post("/app/enshrined", data, { showLoading: true, - loadingText: '创建中...', - }) + loadingText: "创建中...", + }); } /** @@ -46,10 +47,10 @@ export function createEnshrined(data) { * @returns {Promise} 返回更新结果 */ export function updateEnshrined(data) { - return put('/app/enshrined', data, { + return put("/app/enshrined", data, { showLoading: true, - loadingText: '更新中...', - }) + loadingText: "更新中...", + }); } /** @@ -60,8 +61,8 @@ export function updateEnshrined(data) { export function deleteEnshrined(id) { return del(`/app/enshrined/${id}`, { showLoading: true, - loadingText: '删除中...', - }) + loadingText: "删除中...", + }); } /** @@ -75,8 +76,8 @@ export function getMemorialDetail(id) { {}, { showLoading: false, - } - ) + }, + ); } /** @@ -84,13 +85,14 @@ export function getMemorialDetail(id) { * @returns {Promise} 返回楼层树形数据 */ export function getMemorialTree() { - return get( - '/app/memorial/listTree', - {}, - { - showLoading: false, - } - ) + return request({ + url: "/app/memorial/listTree", + method: "get", + params: { + orderByColumn: "order_num", + isAsc: "ascending", + }, + }); } /** @@ -103,8 +105,8 @@ export function getMemorialTree() { * @returns {Promise} 返回往生者列表数据 */ export function getDeceasedList(params) { - return get('/app/deceased/list', params, { + return get("/app/deceased/list", params, { timeout: 10000, showLoading: false, - }) + }); }