diff --git a/.env.development b/.env.development index f143926..a6e30d6 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,3 @@ # 开发环境接口地址 # VITE_API_URL=https://vue.ruoyi.vip/prod-api VITE_API_URL=http://localhost:9090 - - -FAST_POSTER_TOKEN_NAME=http://localhost:8080/fastposter diff --git a/.env.production b/.env.production index 923ef94..7cb9aa0 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,4 @@ # 生产环境接口地址 VITE_API_URL=https://vue.ruoyi.vip/prod-api + +FAST_POSTER_TOKEN_NAME=http://localhost:8080/fastposter diff --git a/src/views/template/beer/index.vue b/src/views/template/beer/index.vue index 1f2f1be..8790495 100644 --- a/src/views/template/beer/index.vue +++ b/src/views/template/beer/index.vue @@ -73,7 +73,6 @@ import { Delete, DocumentCopy, Edit } from '@element-plus/icons-vue'; import { EleMessage } from 'ele-admin-plus'; import { getFastToken } from '@/utils/token-util.js'; - import { API_BASE_URL } from '@/config/setting'; defineOptions({ name: 'ListCardProject' }); interface Item { @@ -98,12 +97,12 @@ const token = getFastToken(); const screenWidth = screen.availWidth; const screenHeight = screen.availHeight; + const fastUrl = 'http://localhost:8080/fastposter'; /** 打开新建 */ const openEdit = () => { - + console.log('打开新建:', fastUrl); // 构建编辑器URL - const editorUrl = `${API_BASE_URL}?token=${token}`; - + const editorUrl = `${fastUrl}?token=${token}`; // 在新窗口中打开编辑器(自动全屏) window.open(editorUrl, '_blank', `fullscreen=yes,width=${screenWidth},height=${screenHeight},top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,status=no`); @@ -112,16 +111,13 @@ /** 编辑模板 */ const editTemplate = (item: Item) => { // 构建编辑器URL,使用模板的ID - const editorUrl = `${API_BASE_URL}?token=${token}&posterId=${item.id}`; + const editorUrl = `${fastUrl}?token=${token}&posterId=${item.id}`; window.open(editorUrl, '_blank', `fullscreen=yes,width=${screenWidth},height=${screenHeight},top=0,left=0,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,status=no`); - - console.log('编辑模板:', item.name, editorUrl); }; /** 删除模板 */ const removeTemplate = (item: Item) => { console.log('删除模板:', item.name); - // TODO: 实现删除逻辑 delPosterTemplate(item.id).then((res) => { EleMessage.success({ message: '删除成功', plain: true }); query(); @@ -130,12 +126,10 @@ /** 复制模板 */ const copyTemplate = (item: Item) => { - console.log('复制模板:', item.name); copyPosterTemplate(item.id).then((res) => { EleMessage.success({ message: '复制成功', plain: true }); query(); }) - // TODO: 实现复制逻辑 }; query();