feat(layout):优化API地址配置逻辑- 移除对API_BASE_URL常量的依赖- 生产环境优先使用远程配置的ApiUrl
- 简化请求工具中API地址获取逻辑 - 删除冗余的订单结算功能代码
This commit is contained in:
@@ -153,7 +153,6 @@ import { useSiteStore } from '@/store/modules/site';
|
|||||||
import Qrcode from "@/components/QrCode/index.vue";
|
import Qrcode from "@/components/QrCode/index.vue";
|
||||||
import {AppInfo} from "@/api/cms/cmsWebsite/model";
|
import {AppInfo} from "@/api/cms/cmsWebsite/model";
|
||||||
import {getCmsWebsiteFieldByCode} from "@/api/cms/cmsWebsiteField";
|
import {getCmsWebsiteFieldByCode} from "@/api/cms/cmsWebsiteField";
|
||||||
import {API_BASE_URL} from "@/config/setting";
|
|
||||||
|
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
@@ -247,8 +246,7 @@ const reload = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 检查是否启动自定义接口
|
// 检查是否启动自定义接口
|
||||||
if(!localStorage.getItem('ApiUrl')){
|
if(import.meta.env.PROD){
|
||||||
localStorage.setItem('ApiUrl', `${API_BASE_URL}`)
|
|
||||||
getCmsWebsiteFieldByCode('ApiUrl').then(res => {
|
getCmsWebsiteFieldByCode('ApiUrl').then(res => {
|
||||||
if(res){
|
if(res){
|
||||||
localStorage.setItem('ApiUrl', `${res.value}`);
|
localStorage.setItem('ApiUrl', `${res.value}`);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const getBaseUrl = (): string => {
|
|||||||
try {
|
try {
|
||||||
// 如果store中没有,则尝试从localStorage获取
|
// 如果store中没有,则尝试从localStorage获取
|
||||||
const ApiUrl = localStorage.getItem('ApiUrl');
|
const ApiUrl = localStorage.getItem('ApiUrl');
|
||||||
if (ApiUrl && import.meta.env.PROD) {
|
if (ApiUrl) {
|
||||||
return ApiUrl;
|
return ApiUrl;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -262,35 +262,6 @@ const reload = (where?: ShopDealerOrderParam) => {
|
|||||||
tableRef?.value?.reload({where: where});
|
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 = () => {
|
const batchSettle = () => {
|
||||||
if (!selection.value.length) {
|
if (!selection.value.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user