x-essential-lib 0.10.21 → 0.10.23
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.d.ts +1 -0
- package/dist/index.js +8 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -296,6 +296,7 @@ interface GlobalStates {
|
|
|
296
296
|
activeOrg: Ref<string>;
|
|
297
297
|
activeOrgNameRaw: Ref<string>;
|
|
298
298
|
activeOrgName: Ref<string>;
|
|
299
|
+
privateDomain: Ref<boolean>;
|
|
299
300
|
permissionObjects: Ref<PermissionObjects>;
|
|
300
301
|
permissionChecksum: Ref<string>;
|
|
301
302
|
lastAppPath: Ref<string>;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Fragment, Transition, computed, createBlock, createCommentVNode, create
|
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
import { useDisplay, useTheme } from "vuetify";
|
|
6
6
|
import axios from "axios";
|
|
7
|
-
import {
|
|
7
|
+
import { useRoute, useRouter } from "vue-router";
|
|
8
8
|
import { getErrorMessage } from "x-error-lib";
|
|
9
9
|
import { createAxios as createAxios$1, messageError as messageError$1 } from "x-essential-lib";
|
|
10
10
|
|
|
@@ -676,7 +676,7 @@ function clearViews(views) {
|
|
|
676
676
|
//#region src/composables/globalStates.ts
|
|
677
677
|
function useGlobalStates(globalStates, base) {
|
|
678
678
|
const { t } = useI18n();
|
|
679
|
-
const { darkRaw, dark, locale, activeOrg, activeOrgNameRaw, activeOrgName, permissionObjects, permissionChecksum, lastAppPath, views } = globalStates;
|
|
679
|
+
const { darkRaw, dark, locale, activeOrg, activeOrgNameRaw, activeOrgName, privateDomain, permissionObjects, permissionChecksum, lastAppPath, views } = globalStates;
|
|
680
680
|
provideDark(dark);
|
|
681
681
|
provideLocale(locale);
|
|
682
682
|
providePermissionObjects(permissionObjects);
|
|
@@ -696,6 +696,9 @@ function useGlobalStates(globalStates, base) {
|
|
|
696
696
|
if (activeOrg.value === "public") activeOrgName.value = t("x-essential-lib.publicDomain");
|
|
697
697
|
else activeOrgName.value = activeOrgNameRaw.value;
|
|
698
698
|
});
|
|
699
|
+
watchEffect(() => {
|
|
700
|
+
privateDomain.value = activeOrg.value !== "public";
|
|
701
|
+
});
|
|
699
702
|
function onUpdateDark(val) {
|
|
700
703
|
darkRaw.value = val;
|
|
701
704
|
}
|
|
@@ -768,7 +771,7 @@ function useMicroApp(globalStates, ignoreSyncOrg, onRouteChange, customBack) {
|
|
|
768
771
|
async function syncOrg() {
|
|
769
772
|
const orgId = route.query.orgId;
|
|
770
773
|
if (!orgId) {
|
|
771
|
-
router.replace(`/main/${Date.now()}`);
|
|
774
|
+
router.replace({ path: `/main/${Date.now()}` });
|
|
772
775
|
return false;
|
|
773
776
|
}
|
|
774
777
|
if (orgId === "public") {
|
|
@@ -786,7 +789,7 @@ function useMicroApp(globalStates, ignoreSyncOrg, onRouteChange, customBack) {
|
|
|
786
789
|
eventBus.emit("updatePermission", [toPermissionObjects(permissions), permissions.checksum ?? ""]);
|
|
787
790
|
return true;
|
|
788
791
|
} catch (e) {
|
|
789
|
-
if (e === "org not found" || e === "org member not found") router.replace(`/main/${Date.now()}`);
|
|
792
|
+
if (e === "org not found" || e === "org member not found") router.replace({ path: `/main/${Date.now()}` });
|
|
790
793
|
return false;
|
|
791
794
|
}
|
|
792
795
|
}
|
|
@@ -797,7 +800,7 @@ function useMicroApp(globalStates, ignoreSyncOrg, onRouteChange, customBack) {
|
|
|
797
800
|
onBeforeMount(async () => {
|
|
798
801
|
await fetch();
|
|
799
802
|
});
|
|
800
|
-
|
|
803
|
+
watch(() => route.path, async () => {
|
|
801
804
|
await fetch();
|
|
802
805
|
});
|
|
803
806
|
async function handleBack() {
|