修改路由
This commit is contained in:
@@ -31,7 +31,7 @@ const routes = [
|
|||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(process.env.BASE_URL),
|
history: createWebHistory(process.env.BASE_URL),
|
||||||
// history: createWebHistory("/"),
|
// history: createWebHistory("/"),
|
||||||
mode: "hash",
|
mode: "history",
|
||||||
// base: process.env.BASE_URL,
|
// base: process.env.BASE_URL,
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ const { defineConfig } = require('@vue/cli-service')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
// publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
||||||
|
publicPath: '/',
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
@@ -41,11 +42,11 @@ module.exports = defineConfig({
|
|||||||
proxy: {
|
proxy: {
|
||||||
'/Api': {
|
'/Api': {
|
||||||
target: 'https://app.gter.net',//请求的接口的前缀
|
target: 'https://app.gter.net',//请求的接口的前缀
|
||||||
changeOrigin:true,
|
changeOrigin: true,
|
||||||
ws: true, //用于支持websocket
|
ws: true, //用于支持websocket
|
||||||
rewrite: (path) => path.replace(/^\/Api/, ''),
|
rewrite: (path) => path.replace(/^\/Api/, ''),
|
||||||
pathRewrite:{
|
pathRewrite: {
|
||||||
'^/Api':''
|
'^/Api': ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user