修复urldi之

This commit is contained in:
清雨 2025-07-07 18:03:33 +08:00
parent f4dc23c0c3
commit daed63fa6f
3 changed files with 6 additions and 13 deletions

View File

@ -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

View File

@ -1,2 +1,4 @@
# 生产环境接口地址
VITE_API_URL=https://vue.ruoyi.vip/prod-api
FAST_POSTER_TOKEN_NAME=http://localhost:8080/fastposter

View File

@ -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();