@mu-cabin/opms-permission 0.9.16 → 0.9.17
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.cjs +7 -7
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +7 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -640,11 +640,7 @@ var Permission = class {
|
|
640
640
|
msg: "No code found in URL"
|
641
641
|
});
|
642
642
|
}
|
643
|
-
const {
|
644
|
-
obj,
|
645
|
-
msg,
|
646
|
-
code: loginCode
|
647
|
-
} = await this.api.login(authCode);
|
643
|
+
const { obj, msg, code: loginCode } = await this.api.login(authCode);
|
648
644
|
if (loginCode !== 200) {
|
649
645
|
return Promise.reject({
|
650
646
|
code: loginCode,
|
@@ -858,7 +854,9 @@ var Permission = class {
|
|
858
854
|
const missingOrgCodes = [];
|
859
855
|
let cachedOrgMap = {};
|
860
856
|
if (!force) {
|
861
|
-
cachedOrgMap = this.storage.getItem(
|
857
|
+
cachedOrgMap = this.storage.getItem(
|
858
|
+
USER_ORG_NO_AUTH_KEY
|
859
|
+
) || {};
|
862
860
|
}
|
863
861
|
for (const orgCode of orgCodes) {
|
864
862
|
if (cachedOrgMap[orgCode]) {
|
@@ -870,7 +868,9 @@ var Permission = class {
|
|
870
868
|
if (missingOrgCodes.length > 0) {
|
871
869
|
try {
|
872
870
|
const { obj } = await this.api.queryOrgCustom({
|
873
|
-
|
871
|
+
orgQueryType: "BY_ORG_CODE",
|
872
|
+
orgCodes: missingOrgCodes,
|
873
|
+
maxDepth: 100
|
874
874
|
});
|
875
875
|
const list = iterateNestedArray(obj, (item) => {
|
876
876
|
return {
|
package/dist/index.d.mts
CHANGED
@@ -174,6 +174,7 @@ type OrgType = 'HEAD' | 'BRANCH' | 'DEPARTMENT';
|
|
174
174
|
interface QueryOrgCustomParams {
|
175
175
|
resultView?: ResultViewType;
|
176
176
|
orgCodeSource?: CodeSourceType;
|
177
|
+
orgQueryType?: 'BY_ORG_CODE' | 'BY_ORG_ID';
|
177
178
|
ids?: number[];
|
178
179
|
direction?: OrgDirectionType;
|
179
180
|
maxDepth?: number;
|
package/dist/index.d.ts
CHANGED
@@ -174,6 +174,7 @@ type OrgType = 'HEAD' | 'BRANCH' | 'DEPARTMENT';
|
|
174
174
|
interface QueryOrgCustomParams {
|
175
175
|
resultView?: ResultViewType;
|
176
176
|
orgCodeSource?: CodeSourceType;
|
177
|
+
orgQueryType?: 'BY_ORG_CODE' | 'BY_ORG_ID';
|
177
178
|
ids?: number[];
|
178
179
|
direction?: OrgDirectionType;
|
179
180
|
maxDepth?: number;
|
package/dist/index.mjs
CHANGED
@@ -591,11 +591,7 @@ var Permission = class {
|
|
591
591
|
msg: "No code found in URL"
|
592
592
|
});
|
593
593
|
}
|
594
|
-
const {
|
595
|
-
obj,
|
596
|
-
msg,
|
597
|
-
code: loginCode
|
598
|
-
} = await this.api.login(authCode);
|
594
|
+
const { obj, msg, code: loginCode } = await this.api.login(authCode);
|
599
595
|
if (loginCode !== 200) {
|
600
596
|
return Promise.reject({
|
601
597
|
code: loginCode,
|
@@ -809,7 +805,9 @@ var Permission = class {
|
|
809
805
|
const missingOrgCodes = [];
|
810
806
|
let cachedOrgMap = {};
|
811
807
|
if (!force) {
|
812
|
-
cachedOrgMap = this.storage.getItem(
|
808
|
+
cachedOrgMap = this.storage.getItem(
|
809
|
+
USER_ORG_NO_AUTH_KEY
|
810
|
+
) || {};
|
813
811
|
}
|
814
812
|
for (const orgCode of orgCodes) {
|
815
813
|
if (cachedOrgMap[orgCode]) {
|
@@ -821,7 +819,9 @@ var Permission = class {
|
|
821
819
|
if (missingOrgCodes.length > 0) {
|
822
820
|
try {
|
823
821
|
const { obj } = await this.api.queryOrgCustom({
|
824
|
-
|
822
|
+
orgQueryType: "BY_ORG_CODE",
|
823
|
+
orgCodes: missingOrgCodes,
|
824
|
+
maxDepth: 100
|
825
825
|
});
|
826
826
|
const list = iterateNestedArray(obj, (item) => {
|
827
827
|
return {
|