feat(layout):优化API地址配置逻辑- 移除对API_BASE_URL常量的依赖- 生产环境优先使用远程配置的ApiUrl

- 简化请求工具中API地址获取逻辑
- 删除冗余的订单结算功能代码
This commit is contained in:
2025-10-18 12:15:22 +08:00
parent 98e9f51b52
commit 78d8b2478a
3 changed files with 2 additions and 33 deletions

View File

@@ -153,7 +153,6 @@ import { useSiteStore } from '@/store/modules/site';
import Qrcode from "@/components/QrCode/index.vue";
import {AppInfo} from "@/api/cms/cmsWebsite/model";
import {getCmsWebsiteFieldByCode} from "@/api/cms/cmsWebsiteField";
import {API_BASE_URL} from "@/config/setting";
// 是否开启响应式布局
const themeStore = useThemeStore();
@@ -247,8 +246,7 @@ const reload = () => {
});
}
// 检查是否启动自定义接口
if(!localStorage.getItem('ApiUrl')){
localStorage.setItem('ApiUrl', `${API_BASE_URL}`)
if(import.meta.env.PROD){
getCmsWebsiteFieldByCode('ApiUrl').then(res => {
if(res){
localStorage.setItem('ApiUrl', `${res.value}`);

View File

@@ -19,7 +19,7 @@ const getBaseUrl = (): string => {
try {
// 如果store中没有则尝试从localStorage获取
const ApiUrl = localStorage.getItem('ApiUrl');
if (ApiUrl && import.meta.env.PROD) {
if (ApiUrl) {
return ApiUrl;
}
} catch (error) {

View File

@@ -262,35 +262,6 @@ const reload = (where?: ShopDealerOrderParam) => {
tableRef?.value?.reload({where: where});
};
/* 结算单个订单 */
// const settleOrder = (row: ShopDealerOrder) => {
// const totalCommission = (parseFloat(row.firstMoney || '0') +
// parseFloat(row.secondMoney || '0') +
// parseFloat(row.thirdMoney || '0')).toFixed(2);
//
// Modal.confirm({
// title: '确认结算',
// content: `确定要结算此订单吗?总佣金金额:¥${totalCommission}`,
// icon: createVNode(DollarOutlined),
// okText: '确认结算',
// okType: 'primary',
// cancelText: '取消',
// onOk: () => {
// const hide = message.loading('正在结算...', 0);
// // 这里调用结算API
// updateSdyDealerOrder({
// ...row,
// isSettled: 1
// })
// setTimeout(() => {
// hide();
// message.success('结算成功');
// reload();
// }, 1000);
// }
// });
// };
/* 批量结算 */
const batchSettle = () => {
if (!selection.value.length) {