diff --git a/src/api/daemon/job-log.ts b/src/api/daemon/job-log.ts index f48d1358..9c961a25 100644 --- a/src/api/daemon/job-log.ts +++ b/src/api/daemon/job-log.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query: any) { return request({ - url: '/daemon/sys-job-log/page', + url: '/job/sys-job-log/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query: any) { export function delObjs(ids: object) { return request({ - url: '/daemon/sys-job-log', + url: '/job/sys-job-log', method: 'delete', data: ids, }); diff --git a/src/api/daemon/job.ts b/src/api/daemon/job.ts index 03a79be3..6c3077af 100644 --- a/src/api/daemon/job.ts +++ b/src/api/daemon/job.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/daemon/sys-job/page', + url: '/job/sys-job/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/daemon/sys-job', + url: '/job/sys-job', method: 'post', data: obj, }); @@ -18,21 +18,21 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/daemon/sys-job/' + id, + url: '/job/sys-job/' + id, method: 'get', }); } export function delObj(id?: string) { return request({ - url: '/daemon/sys-job/' + id, + url: '/job/sys-job/' + id, method: 'delete', }); } export function putObj(obj?: Object) { return request({ - url: '/daemon/sys-job', + url: '/job/sys-job', method: 'put', data: obj, }); @@ -40,21 +40,21 @@ export function putObj(obj?: Object) { export function startJobRa(jobId: string) { return request({ - url: '/daemon/sys-job/start-job/' + jobId, + url: '/job/sys-job/start-job/' + jobId, method: 'post', }); } export function runJobRa(jobId: string) { return request({ - url: '/daemon/sys-job/run-job/' + jobId, + url: '/job/sys-job/run-job/' + jobId, method: 'post', }); } export function shutDownJobRa(jobId: string) { return request({ - url: '/daemon/sys-job/shutdown-job/' + jobId, + url: '/job/sys-job/shutdown-job/' + jobId, method: 'post', }); } diff --git a/src/utils/other.ts b/src/utils/other.ts index 91180595..b6fea7ef 100644 --- a/src/utils/other.ts +++ b/src/utils/other.ts @@ -464,7 +464,7 @@ const adaptationUrl = (originUrl?: string) => { // 验证码服务 if (originUrl?.startsWith('/code/')) { - return `/admin/${originUrl}`; + return `/admin${originUrl}`; } // 如果是代码生成服务,不做路径转换 diff --git a/src/views/daemon/job-manage/index.vue b/src/views/daemon/job-manage/index.vue index c7546b42..c9ecb16d 100644 --- a/src/views/daemon/job-manage/index.vue +++ b/src/views/daemon/job-manage/index.vue @@ -180,7 +180,7 @@ const handleSelectionChange = (rows) => { /** 导出Excel */ const exportExcel = () => { - downBlobFile('/daemon/sys-job/export', state.queryForm, 'job.xlsx'); + downBlobFile('/job/sys-job/export', state.queryForm, 'job.xlsx'); }; /** 查看作业日志 */ diff --git a/src/views/home/schedule/index.vue b/src/views/home/schedule/index.vue index f5857b36..758a107d 100644 --- a/src/views/home/schedule/index.vue +++ b/src/views/home/schedule/index.vue @@ -126,7 +126,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/daemon/schedule/export', state.queryForm, 'schedule.xlsx'); + downBlobFile('/job/schedule/export', state.queryForm, 'schedule.xlsx'); }; // 多选事件 diff --git a/vite.config.ts b/vite.config.ts index c1c7955f..9bafb200 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -52,19 +52,18 @@ const viteConfig = defineConfig((mode: ConfigEnv) => { open: env.VITE_OPEN === 'true', // 是否自动打开浏览器 hmr: true, // 启用热更新 proxy: { - // 代理设置,用于解决跨域问题 - '/api': { - target: env.VITE_ADMIN_PROXY_PATH, // 目标服务器地址 - ws: true, // 是否启用 WebSocket - changeOrigin: true, // 是否修改请求头中的 Origin 字段 - rewrite: (path) => path.replace(/^\/api/, ''), - }, '/api/gen': { //单体架构下特殊处理代码生成模块代理 target: env.VITE_IS_MICRO === 'true' ? env.VITE_ADMIN_PROXY_PATH : env.VITE_GEN_PROXY_PATH, changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), }, + '/api': { + target: env.VITE_ADMIN_PROXY_PATH, // 目标服务器地址 + ws: true, // 是否启用 WebSocket + changeOrigin: true, // 是否修改请求头中的 Origin 字段 + rewrite: (path) => path.replace(/^\/api/, ''), + }, }, }, build: {