import {request} from "@/utils/request"; import {alertController} from "@ionic/vue"; export function save(url: string, data: any) { return request( { url: url, method: 'post', data: data, }, { isNew: true, }, ); } export function get(url: string,params: any) { return request( { url: url, method: 'get', params: params, }, { isNew: true, }, ); } export function del(url: string,params: any) { return request( { url: url, method: 'get', params: params, }, { successMsg: '删除成功!', errorMsg: '删除失败!', isNew: true, }, ); } export function postdel(url: string,params: any) { return request( { url: url, method: 'post', data: params, }, { successMsg: '删除成功!', errorMsg: '删除失败!', isNew: true, }, ); } export function post(url: string,params: any,action:string) { return request( { url: url, method: 'post', data: params, }, { successMsg: action+'成功!', errorMsg: action+'失败!', isNew: true, }, ); } export function postData(url: string,params: any) { return request( { url: url, method: 'post', data: params, }, { isNew: true, }, ); } export const presentAlert = async (message: string) => { const alert = await alertController.create({ header: '提示!', message: message, buttons: [ '确定' ], }); await alert.present(); }