Forráskód Böngészése

接口地址设置

XW 1 éve
szülő
commit
d98a266656

+ 10 - 10
Contest/contest.client/src/api/index.js

@@ -2,38 +2,38 @@ import { post } from '@/api/http'
 
 export default {
     loginPortal(data) {
-        return post('/api/activity/login-portal', data)
+        return post('/activity/login-portal', data)
     },
     getWebsite(data) {
-        return post('https://test.teammodel.cn/activity/get-website', data)
+        return post('/activity/get-website', data)
     },
     getActivityList(data) {
-        return post('/api/activity/list-portal', data)
+        return post('/activity/list-portal', data)
     },
     teaContest(data) {
-        return post('/api/activity/teacher-contest', data)
+        return post('/activity/teacher-contest', data)
     },
     actManage(data) {
-        return post('/api/activity/manage', data)
+        return post('/activity/manage', data)
     },
     getActInfo(data) {
-        return post('/api/activity/read-activity', data)
+        return post('/activity/read-activity', data)
     },
     getInfoInWeb(data) {
-        return post('/api/activity/get-activity-website', data)
+        return post('/activity/get-activity-website', data)
     },
     getTaskList(data) {
-        return post('/api/activity/expert-contest', data)
+        return post('/activity/expert-contest', data)
     },
 
 
 
     //获取blob容器读写创建
     blobSasRCW(data) {
-        return post('/api/blob/sas-rcwld', data)
+        return post('/blob/sas-rcwld', data)
     },
     // 删除blob指定目录下的所有文件
     deletePrefix(data) {
-        return post('/api/blob/delete-prefix', data)
+        return post('/blob/delete-prefix', data)
     },
 }

+ 6 - 2
Contest/contest.client/src/main.js

@@ -3,8 +3,9 @@ import App from './App.vue'
 import router from './router/index.js'
 // import store from '@/store'
 import pinia from './pinia'
-import axios from '@/api/index.js'
+import api from '@/api/index.js'
 import tools from '@/utils/common.js'
+import axios from 'axios'
 
 import Less from 'less'
 import ElementPlus from 'element-plus'
@@ -14,7 +15,10 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
 
 let app = createApp(App)
 
-app.config.globalProperties.$api = axios
+axios.defaults.baseURL = 'https://test.teammodel.cn'
+
+app.config.globalProperties.$axios = axios
+app.config.globalProperties.$api = api
 app.config.globalProperties.$tools = tools
 // app.config.globalProperties.$jwtDecode = jwtDecode
 

+ 3 - 3
Contest/contest.client/vue.config.js

@@ -3,14 +3,14 @@ module.exports = {
     publicPath: '/', // 默认'/',部署应用包时的基本 URL
     lintOnSave: false, //关闭语法检查
     devServer: {
-        proxy: {
+        /* proxy: {
             '/api': {
-                target: 'https://test.teammodel.cn', //后端接口
+                target: 'https://localhost:5001', //后端接口
                 changeOrigin: true,
                 pathRewrite: {
                     '^/api': ''
                 }
             }
-        },
+        }, */
     },
 }