修改uts类型

This commit is contained in:
刘辉
2025-09-23 13:22:09 +08:00
parent dfad4ff040
commit 738f44bb14
4 changed files with 9 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ import { storage, last, isNull, isEmpty, get, isFunction, toArray, map, debounce
// 路由信息类型
type RouteInfo = {
path: string;
meta: UTSJSONObject;
meta?: UTSJSONObject;
};
// 跳转前钩子类型
@@ -55,8 +55,8 @@ export class Router {
}
// 获取页面样式
const page = PAGES.find((e) => e.path == path);
const style = page?.style ?? {};
const meta = page?.meta ?? {};
const style = page?.style;
const meta = page?.meta;
// 获取页面暴露的方法
// @ts-ignore
let exposed = e.vm as any;

View File

@@ -53,4 +53,5 @@ export type PageInstance = {
query: UTSJSONObject;
exposed: any;
isCustomNavbar: boolean;
meta?: UTSJSONObject;
};

View File

@@ -1,6 +1,6 @@
{
"name": "cool-unix",
"appid": "__UNI__651711F",
"appid": "__UNI__EC807C1",
"description": "完全开源、永久免费、上手容易、效率极高的开发脚手架",
"versionName": "1.0.0",
"versionCode": "100",

View File

@@ -2,15 +2,13 @@ import { router, useStore } from "@/cool";
router.beforeEach((to, _, next) => {
const { user } = useStore();
if (
!to.meta.isAuth
) {
next();
} else {
if (to.meta?.isAuth == true) {
if (!user.isNull()) {
next();
} else {
router.login();
}
} else {
next();
}
});