Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev

This commit is contained in:
Xu Chang 2023-01-12 23:22:12 +08:00
commit a43e17d3f8
7 changed files with 60 additions and 34 deletions

View File

@ -25,6 +25,11 @@ exports.default = OakComponent({
var userId = features.token.getUserId(true);
var application = features.application.getApplication();
var systemId = application.systemId;
if (!userId) {
return {
id: 'illegal',
};
}
return {
userId: userId,
// systemId,

View File

@ -34,7 +34,7 @@ exports.default = OakComponent({
_c),
filter: (_d = {},
_d["".concat(entity, "Id")] = entityId,
_d)
_d),
},
_b.extraFile$entity = {
$entity: 'extraFile',
@ -129,10 +129,17 @@ exports.default = OakComponent({
{
name: '通过分享二维码',
mode: 'byQrCode',
}
},
],
idRemoveMp: '',
},
observers: {
'entity,entityId': function (entity, entityId) {
if (this.state.oakFullpath && entity && entityId) {
this.refresh();
}
},
},
lifetimes: {},
methods: {
goUpsert: function () {
@ -180,7 +187,7 @@ exports.default = OakComponent({
$in: relations.map(function (ele) { return ele.id; }),
},
},
}
},
],
_b), idRemove);
return [4 /*yield*/, this.execute()];
@ -278,6 +285,6 @@ exports.default = OakComponent({
}
});
});
}
},
},
});

View File

@ -26,7 +26,7 @@ exports.default = OakComponent({
}
else {
(0, assert_1.default)(type === 'web');
var passport = config.passport;
var passport = config.passport || [];
grantByEmail = passport.includes('email');
grantByMobile = passport.includes('mobile');
grantByUserEntityGrant = passport.includes('wechat');

View File

@ -1,6 +1,6 @@
{
"name": "oak-general-business",
"version": "2.3.1",
"version": "2.3.2",
"description": "oak框架中公共业务逻辑的实现",
"author": {
"name": "XuChang"

View File

@ -1,4 +1,3 @@
export default OakComponent({
entity: 'message',
isList: true,
@ -23,7 +22,11 @@ export default OakComponent({
const userId = features.token.getUserId(true);
const application = features.application.getApplication();
const { systemId } = application;
if (!userId) {
return {
id: 'illegal',
};
}
return {
userId,
// systemId,

View File

@ -29,7 +29,7 @@ export default OakComponent({
},
filter: {
[`${entity}Id`]: entityId,
}
},
},
extraFile$entity: {
$entity: 'extraFile',
@ -124,14 +124,22 @@ export default OakComponent({
{
name: '通过分享二维码',
mode: 'byQrCode',
}
},
],
idRemoveMp: '',
},
observers: {
'entity,entityId': function (entity, entityId) {
if (this.state.oakFullpath && entity && entityId) {
this.refresh();
}
},
},
lifetimes: {},
methods: {
goUpsert() {
const { entity, entityId, relations, redirectToAfterConfirm } = this.props;
const { entity, entityId, relations, redirectToAfterConfirm } =
this.props;
this.navigateTo(
{
url: '/userRelation/upsert',
@ -162,11 +170,10 @@ export default OakComponent({
const { entity, entityId } = this.props;
const entityStr = firstLetterUpperCase(entity!);
const { users } = this.state;
const user = users.find(
(ele: any) => ele.id === idRemove
);
const user = users.find((ele: any) => ele.id === idRemove);
const relations = user[`user${entityStr}$user`];
this.updateItem({
this.updateItem(
{
[`user${entityStr}$user`]: [
{
id: generateNewId(),
@ -177,9 +184,11 @@ export default OakComponent({
$in: relations.map((ele: any) => ele.id),
},
},
}
]
}, idRemove);
},
],
},
idRemove
);
await this.execute();
},
@ -204,8 +213,11 @@ export default OakComponent({
},
chooseActionMp(e: WechatMiniprogram.TouchEvent) {
const { entity, entityId, relations, redirectToAfterConfirm } = this.props;
const { item: { mode }} = e.detail;
const { entity, entityId, relations, redirectToAfterConfirm } =
this.props;
const {
item: { mode },
} = e.detail;
if (mode === 'byMobile') {
this.navigateTo({
url: '/userRelation/upsert/byMobile',
@ -213,8 +225,7 @@ export default OakComponent({
entityId,
relations,
});
}
else {
} else {
this.navigateTo({
url: '/userRelation/upsert/byUserEntityGrant',
entity,
@ -259,7 +270,7 @@ export default OakComponent({
cancelDeleteMp() {
this.setState({
idRemoveMp: '',
})
});
},
async confirmDeleteMp() {
@ -267,7 +278,7 @@ export default OakComponent({
await this.confirmDelete(idRemoveMp);
this.setState({
idRemoveMp: '',
})
}
});
},
},
});

View File

@ -23,7 +23,7 @@ export default OakComponent({
grantByUserEntityGrant = true;
} else {
assert(type === 'web');
const { passport } = config;
const passport = config.passport || [];
grantByEmail = passport.includes('email');
grantByMobile = passport.includes('mobile');
grantByUserEntityGrant = passport.includes('wechat');