Browse Source

fix: 修改nav样式以及哈希模式

曾坤森 3 months ago
parent
commit
de7fc68ff0
4 changed files with 10 additions and 3 deletions
  1. 1 0
      config/vite.config.base.ts
  2. 1 1
      config/vite.config.dev.ts
  3. 2 0
      src/layout/default-layout.vue
  4. 6 2
      src/router/index.ts

+ 1 - 0
config/vite.config.base.ts

@@ -5,6 +5,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx';
 import svgLoader from 'vite-svg-loader';
 import configArcoStyleImportPlugin from './plugin/arcoStyleImport';
 export default defineConfig({
+  base: './',
   plugins: [
     vue(),
     vueJsx(),

+ 1 - 1
config/vite.config.dev.ts

@@ -15,7 +15,7 @@ export default mergeConfig(
           // 代理路径前缀
           target: 'http://192.168.1.28:5000/', // 目标服务器地址
           changeOrigin: true, // 修改请求头中的 Origin
-          rewrite: path => path.replace(/^\/api/, ''), // 重写路径(可选)
+          // rewrite: path => path.replace(/^\/api/, ''), // 重写路径(可选)
         },
       },
     },

+ 2 - 0
src/layout/default-layout.vue

@@ -134,6 +134,8 @@ onMounted(() => {
   top: 0;
   left: 0;
   z-index: 99;
+  display: flex;
+  justify-content: end;
   width: 100%;
   height: @nav-size-height;
   background-color: white;

+ 6 - 2
src/router/index.ts

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