Explorar el Código

解决task接口404错误

57862207 hace 1 año
padre
commit
4313669a4c
Se han modificado 2 ficheros con 6 adiciones y 6 borrados
  1. 1 1
      src/api/task.js
  2. 5 5
      vue.config.js

+ 1 - 1
src/api/task.js

@@ -18,7 +18,7 @@ export const fetchBenchDetail = (benchId) => {
 //    data,
 //  });
 export const fetchTaskList = (data) => {
-  return api("/tts-test/v1.0.0/tts/task/list", {
+  return api(`/tts-test/v1.0.0/tts/task/list`, {
     method: "POST",
     data,
   });

+ 5 - 5
vue.config.js

@@ -4,6 +4,11 @@ module.exports = defineConfig({
   lintOnSave: false,
   devServer: {
     proxy: {
+      '/tts-test': {
+        target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
+        changeOrigin: true, //需要代理跨域
+        rewrite: (path) => path.replace(/^\/tts-test/, ''), //路径重写,把'/api'替换为''
+      },
       '/bench': {
         target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
         changeOrigin: true, //需要代理跨域
@@ -29,11 +34,6 @@ module.exports = defineConfig({
         changeOrigin: true, //需要代理跨域
         rewrite: (path) => path.replace(/^\/task/, ''), //路径重写,把'/api'替换为''
       },
-      '/tts-test': {
-        target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
-        changeOrigin: true, //需要代理跨域
-        rewrite: (path) => path.replace(/^\/tts-test/, ''), //路径重写,把'/api'替换为''
-      },
       '/arbitrator': {
         target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
         changeOrigin: true, //需要代理跨域