v3.8.1发布,上传前端代码

This commit is contained in:
JEECG
2025-06-25 16:04:02 +08:00
parent 3d414aaec8
commit 0148f45979
120 changed files with 4783 additions and 486 deletions

View File

@ -1,6 +1,7 @@
import type { RouteRecordRaw } from 'vue-router';
import type { App } from 'vue';
import { $electron } from "@/electron";
import { basicRoutes } from './routes';
import {createRouter as createVueRouter, destroyRouter, router} from './router'
@ -18,10 +19,13 @@ getRouteNames(basicRoutes);
*/
export function createRouter() {
let router = createVueRouter({
routes: basicRoutes as unknown as RouteRecordRaw[],
strict: true,
scrollBehavior: () => ({left: 0, top: 0}),
})
routes: basicRoutes as unknown as RouteRecordRaw[],
strict: true,
scrollBehavior: () => ({left: 0, top: 0}),
},
// 如果是 Electron 环境,则使用 hash 路由
$electron.isElectron(),
)
// TODO 【QQYUN-4517】【表单设计器】记录分享路由守卫测试
// @ts-ignore

View File

@ -2,7 +2,7 @@
* 路由实例存储文件,请勿轻易添加其他代码,防止出现 HMR 或其他问题
*/
import type {Router, RouterHistory} from 'vue-router';
import {createRouter as createVueRouter, createWebHistory, RouterOptions} from 'vue-router';
import {createRouter as createVueRouter, createWebHistory, createWebHashHistory, RouterOptions} from 'vue-router';
export let router: Router = null as unknown as Router;
@ -15,9 +15,11 @@ let webHistory: Nullable<RouterHistory> = null;
/**
* 创建路由
* @param options 参数
* @param useHashHistory 是否使用 hash 路由true使用false不使用hash路由
*/
export function createRouter(options: Partial<RouterOptions>) {
webHistory = createWebHistory(import.meta.env.VITE_PUBLIC_PATH);
export function createRouter(options: Partial<RouterOptions>, useHashHistory = false) {
const createFn = useHashHistory ? createWebHashHistory : createWebHistory;
webHistory = createFn(import.meta.env.VITE_PUBLIC_PATH);
// app router
let router = createVueRouter({
history: webHistory,