瀏覽代碼

fix: 修改分析系统访问方式

weijin 4 年之前
父節點
當前提交
f014b9cb0a
共有 3 個文件被更改,包括 8 次插入10 次删除
  1. 4 4
      src/api/analysis.ts
  2. 1 1
      src/api/prefix.ts
  3. 3 5
      vue.config.js

+ 4 - 4
src/api/analysis.ts

@@ -4,9 +4,9 @@ import { AnalysisInfo, ID, ReceivedData } from './types'
 
 export const getExamAnalysis = (examId: ID) => {
   return axios.get<ReceivedData<AnalysisInfo>>(`${ANALYSIS_MODULE}/${examId}`, {
-    headers: {
-      Authorization:
-        'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJza3kiOiJXb0JpU2hlWWFvWGllQnVXYW5MZSEhIn0.QDF9l3beb2vodPMH87adsT4DZL60NU6Zf4uYAxelzg8'
-    }
+    // headers: {
+    //   Authorization:
+    //     'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJza3kiOiJXb0JpU2hlWWFvWGllQnVXYW5MZSEhIn0.QDF9l3beb2vodPMH87adsT4DZL60NU6Zf4uYAxelzg8'
+    // }
   })
 }

+ 1 - 1
src/api/prefix.ts

@@ -7,6 +7,6 @@ export const JUDGE_MODULE = BASE_URL + '/judge'
 export const REPORT_MODULE = BASE_URL + '/report'
 export const RECORD_MODULE = BASE_URL + '/record'
 
-const ANALYSIS_URL = '/analysis_api'
+const ANALYSIS_URL = '/eval'
 
 export const ANALYSIS_MODULE = ANALYSIS_URL + '/analysis'

+ 3 - 5
vue.config.js

@@ -11,11 +11,9 @@ module.exports = {
         ws: true,
         changeOrigin: true
       },
-      '^/analysis_api': {
-        target: 'https://analysis.seec.seecoder.cn',
-        pathRewrite: {
-          '^/analysis_api': '/eval'
-        },
+      '^/eval': {
+        // target: 'http://localhost:8089/',
+        target: 'https://analysis.seec.seecoder.cn/',
         ws: true,
         changeOrigin: true
         //token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJza3kiOiJXb0JpU2hlWWFvWGllQnVXYW5MZSEhIn0.QDF9l3beb2vodPMH87adsT4DZL60NU6Zf4uYAxelzg8