chore: 路由模式改为hash

This commit is contained in:
RubyLiu 2023-08-08 16:49:49 +08:00 committed by 刘瑞斌
parent 4d6d23c4ac
commit 56e4562ddd
4 changed files with 6 additions and 8 deletions

View File

@ -1,2 +1 @@
VITE_API_BASE_URL= 'app' VITE_API_BASE_URL= 'front'
VUE_APP_Access_Control_Allow_Origin= '*'

View File

@ -1,2 +1 @@
VITE_API_BASE_URL= 'app' VITE_API_BASE_URL= ''
VUE_APP_Access_Control_Allow_Origin= '*'

View File

@ -12,10 +12,10 @@ export default mergeConfig(
strict: true, strict: true,
}, },
proxy: { proxy: {
'/app': { '/front': {
target: 'http://172.16.200.18:8081/', target: 'http://172.16.200.18:8081/',
changeOrigin: true, changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/app/, ''), rewrite: (path: string) => path.replace(/^\/front/, ''),
}, },
}, },
}, },

View File

@ -1,4 +1,4 @@
import { createRouter, createWebHistory } from 'vue-router'; import { createRouter, createWebHashHistory } from 'vue-router';
import NProgress from 'nprogress'; // progress bar import NProgress from 'nprogress'; // progress bar
import 'nprogress/nprogress.css'; import 'nprogress/nprogress.css';
@ -9,7 +9,7 @@ import createRouteGuard from './guard';
NProgress.configure({ showSpinner: false }); // NProgress Configuration NProgress.configure({ showSpinner: false }); // NProgress Configuration
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHashHistory(),
routes: [ routes: [
{ {
path: '/', path: '/',