@goweekdays/layer-common 1.2.3 → 1.2.5
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/CHANGELOG.md +12 -0
- package/components/ListGroupSelection.vue +116 -0
- package/components/RoleForm.vue +326 -0
- package/components/RolePermissionFormCreate.vue +2 -2
- package/components/RolePermissionMain.vue +119 -184
- package/composables/useAddress.ts +4 -4
- package/composables/useChartOfAccount.ts +7 -10
- package/composables/useFile.ts +4 -7
- package/composables/useInvoice.ts +11 -17
- package/composables/useLocalAuth.ts +7 -7
- package/composables/useMember.ts +12 -18
- package/composables/useOrder.ts +1 -1
- package/composables/useOrg.ts +13 -19
- package/composables/usePayment.ts +1 -1
- package/composables/usePaymentMethod.ts +24 -37
- package/composables/usePermission.ts +2 -1
- package/composables/usePrice.ts +1 -1
- package/composables/usePromoCode.ts +4 -4
- package/composables/useRole.ts +25 -41
- package/composables/useSubscription.ts +25 -37
- package/composables/useUser.ts +10 -10
- package/composables/useUtils.ts +1 -1
- package/composables/useVerification.ts +1 -1
- package/package.json +1 -1
- package/pages/require-organization.vue +43 -0
- package/plugins/API.ts +1 -1
- package/plugins/member.client.ts +4 -4
- package/plugins/secure.client.ts +3 -3
- package/types/local.d.ts +6 -0
- package/types/permission.d.ts +2 -0
- package/types/role.d.ts +1 -0
package/plugins/API.ts
CHANGED
package/plugins/member.client.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default defineNuxtPlugin(() => {
|
|
2
2
|
const router = useRouter();
|
|
3
3
|
const { getByUserType } = useMember();
|
|
4
|
-
const { getRoleById } = useRole();
|
|
4
|
+
const { getById: getRoleById } = useRole();
|
|
5
5
|
const { membership, permissions } = useLocalAuth();
|
|
6
6
|
|
|
7
|
-
router.afterEach((to) => {
|
|
7
|
+
router.afterEach(async (to) => {
|
|
8
8
|
const isSecured = to.meta?.member;
|
|
9
9
|
if (!isSecured) return;
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ export default defineNuxtPlugin(() => {
|
|
|
17
17
|
data: userMemberData,
|
|
18
18
|
error: userMemberError,
|
|
19
19
|
refresh: refreshUserMemberData,
|
|
20
|
-
} = useLazyAsyncData(
|
|
20
|
+
} = await useLazyAsyncData(
|
|
21
21
|
"plugin-get-member-by-id" + userId,
|
|
22
22
|
() => getByUserType(userId, APP, org),
|
|
23
23
|
{ immediate: false }
|
|
@@ -43,7 +43,7 @@ export default defineNuxtPlugin(() => {
|
|
|
43
43
|
|
|
44
44
|
const roleId = computed(() => membership.value?.role ?? "");
|
|
45
45
|
|
|
46
|
-
const { data: roleData, refresh: refreshRoleData } = useLazyAsyncData(
|
|
46
|
+
const { data: roleData, refresh: refreshRoleData } = await useLazyAsyncData(
|
|
47
47
|
"plugin-get-role-by-id" + roleId.value,
|
|
48
48
|
() => getRoleById(roleId.value),
|
|
49
49
|
{ immediate: false }
|
package/plugins/secure.client.ts
CHANGED
|
@@ -3,7 +3,7 @@ export default defineNuxtPlugin(() => {
|
|
|
3
3
|
const { cookieConfig } = useRuntimeConfig().public;
|
|
4
4
|
const { currentUser } = useLocalAuth();
|
|
5
5
|
|
|
6
|
-
router.afterEach((to) => {
|
|
6
|
+
router.afterEach(async (to) => {
|
|
7
7
|
const isSecured = to.meta?.secured;
|
|
8
8
|
if (!isSecured) return;
|
|
9
9
|
|
|
@@ -14,8 +14,8 @@ export default defineNuxtPlugin(() => {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const { data: getCurrentUserReq, error: getCurrentUserErr } =
|
|
17
|
-
useLazyAsyncData("get-current-user", () =>
|
|
18
|
-
|
|
17
|
+
await useLazyAsyncData("get-current-user", () =>
|
|
18
|
+
$fetch<TUser>(`/api/users/id/${user}`)
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
watchEffect(() => {
|
package/types/local.d.ts
CHANGED
package/types/permission.d.ts
CHANGED
|
@@ -16,9 +16,11 @@ declare type TPermissions = {
|
|
|
16
16
|
declare type TPerm = {
|
|
17
17
|
_id?: string;
|
|
18
18
|
app: string;
|
|
19
|
+
name: string;
|
|
19
20
|
key: string;
|
|
20
21
|
group: string;
|
|
21
22
|
description: string;
|
|
23
|
+
status?: string;
|
|
22
24
|
createdAt?: string | Date;
|
|
23
25
|
updatedAt?: string | Date;
|
|
24
26
|
deletedAt?: string | Date;
|