Browse Source

chore: 路由模式调整

master
wangxiang 2 years ago
parent
commit
4552f36e6a
  1. 6
      docker/kicc-ui.conf
  2. 6
      src/router/index.ts

6
docker/kicc-ui.conf

@ -46,4 +46,10 @@ server { @@ -46,4 +46,10 @@ server {
rewrite ^/prod-upload(.*)$ /system_proxy/system/file/upload break;
proxy_pass http://kicc-gateway:9999;
}
# 代理访问后端微服务表报地址
location ^~/ureport/ {
rewrite ^/(.*)$ /$1 break;
proxy_pass http://kicc-gateway:9999/report_proxy;
}
}

6
src/router/index.ts

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
import type { RouteRecordRaw } from 'vue-router';
import type { App } from 'vue';
import { createRouter, createWebHashHistory } from 'vue-router';
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
import { basicRoutes } from './routes';
import { formatUrlParamsMenu } from '/@/router/helper/menuHelper';
import { useUserStore } from '/@/store/modules/user';
@ -21,7 +21,7 @@ const getRouteNames = (array: any[]) => array.forEach((item) => { @@ -21,7 +21,7 @@ const getRouteNames = (array: any[]) => array.forEach((item) => {
/** 应用配置的静态路由 */
export const router = createRouter({
history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH),
history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH),
routes: basicRoutes as unknown as RouteRecordRaw[],
strict: true,
scrollBehavior: () => ({ left: 0, top: 0 }),
@ -42,7 +42,7 @@ export function setupRouter(app: App<Element>) { @@ -42,7 +42,7 @@ export function setupRouter(app: App<Element>) {
app.use(router);
}
/** 解析格式化路由占位符 */
/** 解析格式化路由占位符 */
export function formatRouterPlaceholder(path: string) {
const userStore = useUserStore();
return formatUrlParamsMenu(path, {

Loading…
Cancel
Save