全局:优化请求的提示

This commit is contained in:
YunaiV
2024-01-20 17:28:04 +08:00
parent 33d57fd7e5
commit 22139d9a2d
15 changed files with 172 additions and 110 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import diyTemplateApi from '@/sheep/api/promotion/diy/template';
import DiyApi from '@/sheep/api/promotion/diy';
import { defineStore } from 'pinia';
import $platform from '@/sheep/platform';
import $router from '@/sheep/router';
@@ -117,8 +117,8 @@ const app = defineStore({
const adaptTemplate = async (appTemplate, templateId) => {
const { data: diyTemplate } = templateId
// 查询指定模板,一般是预览时使用
? await diyTemplateApi.getDiyTemplate(templateId)
: await diyTemplateApi.getUsedDiyTemplate();
? await DiyApi.getDiyTemplate(templateId)
: await DiyApi.getUsedDiyTemplate();
// 模板不存在
if (!diyTemplate) {
$router.error('TemplateError');