x-essential-lib 0.9.27 → 0.9.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -18
- package/dist/utils/router.d.ts +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -334,37 +334,42 @@ function isHasAccessToken() {
|
|
|
334
334
|
function isHasActiveOrg() {
|
|
335
335
|
return !!api.get("activeOrg");
|
|
336
336
|
}
|
|
337
|
-
function onBeforeEach(e, T, E
|
|
338
|
-
let
|
|
339
|
-
if (!
|
|
340
|
-
|
|
337
|
+
function onBeforeEach(e, T, E) {
|
|
338
|
+
let D = isHasAccessToken(), O = isHasActiveOrg(), k = matchRouteMeta(e.path);
|
|
339
|
+
if (!k) throw Error("to route meta invalid");
|
|
340
|
+
if (k.requiredState === "auth") if (D) if (O) {
|
|
341
|
+
let e = "/main";
|
|
342
|
+
return onBeforeChange(e, T.path, E), { path: e };
|
|
343
|
+
} else {
|
|
344
|
+
onBeforeChange(e.path, T.path, E);
|
|
341
345
|
return;
|
|
342
346
|
}
|
|
343
|
-
if (A.requiredState === "auth") if (O) if (k) {
|
|
344
|
-
let e = "/main";
|
|
345
|
-
onBeforeChange(e, T.path, D), E({ path: e });
|
|
346
|
-
} else onBeforeChange(e.path, T.path, D), E();
|
|
347
347
|
else {
|
|
348
348
|
let e = "/passport/login";
|
|
349
|
-
onBeforeChange(e, T.path,
|
|
349
|
+
return onBeforeChange(e, T.path, E), { path: e };
|
|
350
350
|
}
|
|
351
|
-
else if (
|
|
352
|
-
|
|
351
|
+
else if (k.requiredState === "org") if (D) if (O) {
|
|
352
|
+
onBeforeChange(e.path, T.path, E);
|
|
353
|
+
return;
|
|
354
|
+
} else {
|
|
353
355
|
let e = "/org/joinOrCreate";
|
|
354
|
-
onBeforeChange(e, T.path,
|
|
356
|
+
return onBeforeChange(e, T.path, E), { path: e };
|
|
355
357
|
}
|
|
356
358
|
else {
|
|
357
359
|
let e = "/passport/login";
|
|
358
|
-
onBeforeChange(e, T.path,
|
|
360
|
+
return onBeforeChange(e, T.path, E), { path: e };
|
|
359
361
|
}
|
|
360
|
-
else if (
|
|
362
|
+
else if (D) if (O) {
|
|
361
363
|
let e = "/main";
|
|
362
|
-
onBeforeChange(e, T.path,
|
|
364
|
+
return onBeforeChange(e, T.path, E), { path: e };
|
|
363
365
|
} else {
|
|
364
366
|
let e = "/org/joinOrCreate";
|
|
365
|
-
onBeforeChange(e, T.path,
|
|
367
|
+
return onBeforeChange(e, T.path, E), { path: e };
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
onBeforeChange(e.path, T.path, E);
|
|
371
|
+
return;
|
|
366
372
|
}
|
|
367
|
-
else onBeforeChange(e.path, T.path, D), E();
|
|
368
373
|
}
|
|
369
374
|
const types = [
|
|
370
375
|
"string",
|
|
@@ -479,7 +484,7 @@ function useSystem() {
|
|
|
479
484
|
return {
|
|
480
485
|
sysBarAvail: E,
|
|
481
486
|
compactWidth: computed(() => O.width.value <= 1280 ? O.width.value + "px" : O.width.value <= 1920 ? "768px" : "1024px"),
|
|
482
|
-
isCurvedScreen: computed(() =>
|
|
487
|
+
isCurvedScreen: computed(() => !1),
|
|
483
488
|
isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
|
|
484
489
|
nameList: (E, D) => {
|
|
485
490
|
let O, k = E.map((e) => T(e));
|
package/dist/utils/router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RouteLocationNormalized
|
|
1
|
+
import { RouteLocationNormalized } from 'vue-router';
|
|
2
2
|
interface RouteMeta {
|
|
3
3
|
app: 'x-app-mf' | 'x-compute-mf' | 'x-data-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf' | 'x-resource-mf';
|
|
4
4
|
path: string;
|
|
@@ -8,5 +8,7 @@ interface RouteMeta {
|
|
|
8
8
|
}
|
|
9
9
|
export declare function matchRouteMeta(path: string): RouteMeta | undefined;
|
|
10
10
|
export declare const routeTransName: import("vue").Ref<string, string>;
|
|
11
|
-
export declare function onBeforeEach(to: RouteLocationNormalized, from: RouteLocationNormalized,
|
|
11
|
+
export declare function onBeforeEach(to: RouteLocationNormalized, from: RouteLocationNormalized, lastAppPath: string): {
|
|
12
|
+
path: string;
|
|
13
|
+
} | undefined;
|
|
12
14
|
export {};
|