gant-core 0.1.26 → 0.1.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/lib/cli/index.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +30 -15
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/cli/index.js
CHANGED
|
@@ -48724,7 +48724,7 @@ const createCwdConfig = (cwd, name, vue) => {
|
|
|
48724
48724
|
};
|
|
48725
48725
|
|
|
48726
48726
|
var name = "gant-core";
|
|
48727
|
-
var version = "0.1.
|
|
48727
|
+
var version = "0.1.28";
|
|
48728
48728
|
var description = "";
|
|
48729
48729
|
var main = "lib/index.js";
|
|
48730
48730
|
var bin = {
|
package/lib/index.d.ts
CHANGED
|
@@ -2098,6 +2098,7 @@ declare class UserStore {
|
|
|
2098
2098
|
userSetting: {
|
|
2099
2099
|
[type: string]: any;
|
|
2100
2100
|
};
|
|
2101
|
+
users: User[];
|
|
2101
2102
|
getUserIdentity(): UserIdentityType;
|
|
2102
2103
|
setUserIdentity(identity: Partial<UserIdentityType>): UserIdentityType;
|
|
2103
2104
|
clearUserIdentity(): void;
|
|
@@ -2106,7 +2107,7 @@ declare class UserStore {
|
|
|
2106
2107
|
getUserSetting: (dataType: string) => Promise<any>;
|
|
2107
2108
|
updateUserSetting: (dataType: string, data: any) => Promise<any>;
|
|
2108
2109
|
removeUserSetting: (dataType: string) => Promise<void>;
|
|
2109
|
-
getUserInfo: (userId: string) => Promise<any>;
|
|
2110
|
+
getUserInfo: (userId: string, userLoginName?: boolean) => Promise<any>;
|
|
2110
2111
|
}
|
|
2111
2112
|
|
|
2112
2113
|
interface ParameterItem {
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios__default from 'axios';
|
|
2
2
|
export * from 'axios';
|
|
3
|
-
import { forEach, groupBy, reduce, find, pick, get as get$1, uniqueId, omit, isEmpty, cloneDeep, mapValues, uniqBy, toLower, isObject, mergeWith, has, join } from 'lodash-es';
|
|
3
|
+
import { forEach, groupBy, reduce, find, pick, get as get$1, uniqueId, omit, isEmpty, findIndex, cloneDeep, mapValues, uniqBy, toLower, isObject, mergeWith, has, join } from 'lodash-es';
|
|
4
4
|
import mitt from 'mitt';
|
|
5
5
|
|
|
6
6
|
class InterceptorManager {
|
|
@@ -616,30 +616,37 @@ const storage = createStorage();
|
|
|
616
616
|
|
|
617
617
|
//公司定制化数据接口
|
|
618
618
|
async function setUserDataApi(params, options) {
|
|
619
|
-
return request(
|
|
619
|
+
return request("/accountUserSelf/setUserData", {
|
|
620
620
|
data: params,
|
|
621
|
-
serviceId:
|
|
621
|
+
serviceId: "fwSecurity",
|
|
622
622
|
}, options);
|
|
623
623
|
}
|
|
624
624
|
//获取公司定制化信息
|
|
625
625
|
async function getUserDataApi(params) {
|
|
626
|
-
return request(
|
|
626
|
+
return request("/accountUserSelf/getUserData", {
|
|
627
627
|
data: params,
|
|
628
|
-
serviceId:
|
|
628
|
+
serviceId: "fwSecurity",
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
//删除公司定制化信息
|
|
632
632
|
async function delUserDataApi(params, options) {
|
|
633
|
-
return request(
|
|
633
|
+
return request("/accountUserSelf/delUserData", {
|
|
634
634
|
data: params,
|
|
635
|
-
serviceId:
|
|
635
|
+
serviceId: "fwSecurity",
|
|
636
636
|
}, options);
|
|
637
637
|
}
|
|
638
638
|
async function getUserByIdApi(userId) {
|
|
639
|
-
return request(
|
|
640
|
-
method:
|
|
639
|
+
return request("/security/getUserById", {
|
|
640
|
+
method: "POST",
|
|
641
641
|
data: { id: userId },
|
|
642
|
-
serviceId:
|
|
642
|
+
serviceId: "fwSecurity",
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
async function getUserByUserLoginNameApi(userLoginName) {
|
|
646
|
+
return request("/security/getUserByUserLoginName", {
|
|
647
|
+
method: "POST",
|
|
648
|
+
data: { userLoginName: userLoginName },
|
|
649
|
+
serviceId: "fwSecurity",
|
|
643
650
|
});
|
|
644
651
|
}
|
|
645
652
|
|
|
@@ -651,10 +658,11 @@ class UserStore {
|
|
|
651
658
|
functions = []; //用户授权功能点
|
|
652
659
|
delegations = []; //用户代理信息
|
|
653
660
|
userSetting = {};
|
|
661
|
+
users = [];
|
|
654
662
|
getUserIdentity() {
|
|
655
663
|
if (!isEmpty(this.userIdentity))
|
|
656
664
|
return this.userIdentity;
|
|
657
|
-
const localUserIdentity = storage?.get(
|
|
665
|
+
const localUserIdentity = storage?.get("userIdentity");
|
|
658
666
|
return localUserIdentity ? localUserIdentity : {};
|
|
659
667
|
}
|
|
660
668
|
setUserIdentity(identity) {
|
|
@@ -662,11 +670,11 @@ class UserStore {
|
|
|
662
670
|
...this.userIdentity,
|
|
663
671
|
...identity,
|
|
664
672
|
};
|
|
665
|
-
storage.set(
|
|
673
|
+
storage.set("userIdentity", this.userIdentity);
|
|
666
674
|
return this.userIdentity;
|
|
667
675
|
}
|
|
668
676
|
clearUserIdentity() {
|
|
669
|
-
storage.remove(
|
|
677
|
+
storage.remove("userIdentity");
|
|
670
678
|
this.userIdentity = {};
|
|
671
679
|
}
|
|
672
680
|
setUserAggregateInfo = ({ delegations, roles, functions, isSuperAdmin, currentUser, }) => {
|
|
@@ -708,8 +716,15 @@ class UserStore {
|
|
|
708
716
|
await delUserDataApi({ dataType, dataId: userId });
|
|
709
717
|
delete this.userSetting[key];
|
|
710
718
|
};
|
|
711
|
-
getUserInfo = async (userId) => {
|
|
712
|
-
|
|
719
|
+
getUserInfo = async (userId, userLoginName) => {
|
|
720
|
+
const index = findIndex(this.users, (itemUser) => userLoginName ? itemUser.userLoginName === userId : itemUser.id === userId);
|
|
721
|
+
if (index > -1)
|
|
722
|
+
return get$1(this.users, `[${index}]`);
|
|
723
|
+
const userInfo = userLoginName
|
|
724
|
+
? await getUserByUserLoginNameApi(userId)
|
|
725
|
+
: await getUserByIdApi(userId);
|
|
726
|
+
this.users.push(userInfo);
|
|
727
|
+
return userInfo;
|
|
713
728
|
};
|
|
714
729
|
}
|
|
715
730
|
|