From 322d1313287bb103dad01b8e38ff54eb1080bfbe Mon Sep 17 00:00:00 2001 From: lixg Date: Sun, 11 Dec 2022 21:23:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 4 +- vite.config.js | 114 +++++++++++++++++++++++++------------------------ 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 176d87f..591c295 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-12-11 16:57:58 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-12-11 21:00:20 + * @LastEditTime: 2022-12-11 21:21:16 * @FilePath: /fe-stu/src/api/api.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -39,7 +39,7 @@ export const DISCUSS_SUBMIT_REVIEW_LIST = '/discussSubmit/queryDiscussSubmitAndR export const COMMENT_LIST = '/comment/list' -export const VOTE_DETAIL2 = '/vote/queryStemByStemId post' +export const VOTE_DETAIL2 = ballotId => `/vote/queryStemByStemId?ballotId=${ballotId} post` export const COMMENT_ADD = '/comment post' export const COMMENT_PRAISE = '/comment/praise post' export const COMMENT_COLLECTION = '/comment/collection post' diff --git a/vite.config.js b/vite.config.js index 2226a4d..738747b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,69 +2,73 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-21 17:28:10 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-11-22 12:45:57 + * @LastEditTime: 2022-12-11 21:11:35 * @FilePath: /fe-stu/vite.config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ -import {defineConfig} from 'vite' +import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import legacy from '@vitejs/plugin-legacy' -import {viteMockServe} from 'vite-plugin-mock' +import { viteMockServe } from 'vite-plugin-mock' import topLevelAwait from "vite-plugin-top-level-await"; const path = require('path') -export default defineConfig(({command}) => - ({ - base: '/fe-student', - plugins: [ - vue(), - // legacy({ - // targets: ['chrome 64', 'defaults', 'not IE 11'] - // }), - topLevelAwait({ - promiseExportName: '__tla', - promiseImportName: i => `__tla_${i}` - }), - // viteMockServe({ - // mockPath: './src/mock/mocks', - // }) - ], - resolve: { - alias: [ - {find: '@', replacement: path.resolve(__dirname, 'src')} - ] - }, server: { - proxy: { - '/file/upload': { - target: 'http://111.231.196.214:30001', - changeOrigin: true, - }, - '/stu': { - target: 'http://localhost:30001', - changeOrigin: true, - }, - '/queryVoteSubmitDetailById': { - target: 'http://localhost:30001', - changeOrigin: true, - }, - '/work': { - target: 'http://localhost:30001', - changeOrigin: true, - }, - '/discuss': { - target: 'http://localhost:30001', - changeOrigin: true, - }, - '/discussSubmit': { - target: 'http://localhost:30001', - changeOrigin: true, - }, - '/comment': { - target: 'http://localhost:30001', - changeOrigin: true, - }, - } +export default defineConfig(({ command }) => +({ + base: '/fe-student', + plugins: [ + vue(), + // legacy({ + // targets: ['chrome 64', 'defaults', 'not IE 11'] + // }), + topLevelAwait({ + promiseExportName: '__tla', + promiseImportName: i => `__tla_${i}` + }), + // viteMockServe({ + // mockPath: './src/mock/mocks', + // }) + ], + resolve: { + alias: [ + { find: '@', replacement: path.resolve(__dirname, 'src') } + ] + }, server: { + proxy: { + '/file/upload': { + target: 'http://111.231.196.214:30001', + changeOrigin: true, + }, + '/stu': { + target: 'http://localhost:30001', + changeOrigin: true, + }, + '/queryVoteSubmitDetailById': { + target: 'http://localhost:30001', + changeOrigin: true, + }, + '/work': { + target: 'http://localhost:30001', + changeOrigin: true, + }, + '/discuss': { + target: 'http://localhost:30001', + changeOrigin: true, + }, + '/discussSubmit': { + target: 'http://localhost:30001', + changeOrigin: true, + }, + '/comment': { + target: 'http://localhost:30001', + changeOrigin: true, + }, + '/vote': { + target: 'http://111.231.196.214:12013/manageApi', + changeOrigin: true, + }, } - }) + } +}) )