修改路由

This commit is contained in:
A1300399510 2023-07-13 11:58:39 +08:00
parent 93e55767c5
commit 46d92f16dd
2 changed files with 6 additions and 5 deletions

View File

@ -31,7 +31,7 @@ const routes = [
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
// history: createWebHistory("/"),
mode: "hash",
mode: "history",
// base: process.env.BASE_URL,
routes
})

View File

@ -2,7 +2,8 @@ const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = defineConfig({
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
// publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
publicPath: '/',
configureWebpack: {
resolve: {
alias: {
@ -41,11 +42,11 @@ module.exports = defineConfig({
proxy: {
'/Api': {
target: 'https://app.gter.net',//请求的接口的前缀
changeOrigin:true,
changeOrigin: true,
ws: true, //用于支持websocket
rewrite: (path) => path.replace(/^\/Api/, ''),
pathRewrite:{
'^/Api':''
pathRewrite: {
'^/Api': ''
}
}
}