feat(payment): 添加统一下单接口并修复类型引用
- 添加 create 和 createWithOrder 两个统一下单接口 - 将 Order 类型替换为 ShopOrder 类型 - 修复 getNativeCode 函数的参数类型引用 - 修复 importArticles 导入语句的格式问题 feat(navigation): 实现导航管理导入导出功能 - 添加导航导入弹窗组件 Import.vue - 实现导航数据导出功能,支持按搜索结果导出 - 优化导出数据的列宽设置 - 添加导出加载状态和错误处理 - 修复组件格式化问题 refactor(led): 重构LED显示页面实现自动轮播 - 重命名组件名称为 LedIndex - 添加两个表格实例引用用于独立控制 - 实现页面自动轮播功能,设置10秒间隔 - 隐藏表格分页组件 - 优化页面加载和卸载逻辑 style(components): 统一组件代码格式化 - 修复多个组件中的格式化问题 - 统一 import 语句的格式 - 修复组件标签闭合问题 - 优化代码缩进和换行 chore(env): 更新开发环境配置注释 - 注释掉 VITE_API_URL 配置项 - 保持其他环境配置不变
This commit is contained in:
@@ -2,7 +2,7 @@ import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Payment, PaymentParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
import type { Order } from '@/api/shop/order/model';
|
||||
import type { ShopOrder } from '@/api/shop/shopOrder/model';
|
||||
|
||||
/**
|
||||
* 分页查询支付方式
|
||||
@@ -50,6 +50,34 @@ export async function addPayment(data: Payment) {
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一下单订单接口
|
||||
*/
|
||||
export async function create(data: Payment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/payment/create',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一下单订单接口(包含订单信息)
|
||||
*/
|
||||
export async function createWithOrder(data: Payment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/payment/create-with-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支付方式
|
||||
*/
|
||||
@@ -109,7 +137,7 @@ export async function getPayment(id: number) {
|
||||
/**
|
||||
* 生成支付二维码(微信native)
|
||||
*/
|
||||
export async function getNativeCode(data: Order) {
|
||||
export async function getNativeCode(data: ShopOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/wx-native-pay/codeUrl',
|
||||
data
|
||||
|
||||
Reference in New Issue
Block a user