Browse Source

修改路由模式

master
liuchen 1 year ago
parent
commit
93911cdbb6
  1. 2
      Dockerfile
  2. 2
      nginx.conf
  3. 4
      src/router/index.ts

2
Dockerfile

@ -3,5 +3,5 @@ FROM nginx:WIN-1.25.3
WORKDIR /opt/sfms3.0
COPY nginx.conf /usr/local/nginx/conf/nginx.conf
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面
# 将dist文件中的内容复制到 /opt/sfms3.0 这个目录下面
COPY sfms3.0/ /opt/sfms3.0

2
nginx.conf

@ -1,4 +1,4 @@
#user root;
user root;
worker_processes 2;
events {

4
src/router/index.ts

@ -1,11 +1,11 @@
import type { App } from 'vue'
import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
import remainingRouter from './modules/remaining'
// 创建路由实例
const router = createRouter({
history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
history: createWebHashHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
strict: true,
routes: remainingRouter as RouteRecordRaw[],
scrollBehavior: () => ({ left: 0, top: 0 })

Loading…
Cancel
Save