2.5.45 • Published 1 month ago
@steedos/service-license v2.5.45
功能说明
- 提供软件包许可证校验
actions
- hasProduct(packageName, spaceId): 是否有软件包的许可证
getProduct(packageName, spaceId): 获取软件包的许可证详细信息
hasFeature(packageFeatureName, spaceId): 许可证中是否有指定的功能点
- getFeature(packageFeatureName, spaceId): 获取许可证中功能点详细信息
示例: xxx.trigger.js
{
listenTo: 'contracts',
beforeInsert: async function () {
const allow = await objectql.getSteedosSchema().broker.call(`@steedos/service-license.hasProduct`, { key: '@steedos-labs/contract', spaceId: this.spaceId })
if (!allow) {
throw new Error(`请购买许可证`);
}
},
beforeUpdate: async function () {
if(this.doc.payment){
const allow = await objectql.getSteedosSchema().broker.call(`@steedos/service-license.hasFeature`, { key: '@steedos-labs/contract#payment', spaceId: this.spaceId })
if (!allow) {
throw new Error(`创建付款合同失败,请购买升级许可证`);
}
}
}
}
client js 中判断软件包许可证及软件包功能点:
- Steedos.hasProduct(packageName): 是否有软件包的许可证
Steedos.getProduct(packageName): 获取软件包的许可证详细信息
Steedos.hasFeature(packageFeatureName): 许可证中是否有指定的功能点
- Steedos.getFeature(packageFeatureName): 获取许可证中功能点详细信息
2.5.45
1 month ago
2.5.44
2 months ago
2.5.42
2 months ago
2.5.40
2 months ago
2.5.41
2 months ago
2.5.39
2 months ago
2.5.38
2 months ago
2.5.37
2 months ago
2.5.36
2 months ago
2.5.33
2 months ago
2.5.34
2 months ago
2.5.35
2 months ago
2.5.32
2 months ago
2.5.31
3 months ago
2.5.30
4 months ago
2.5.29
4 months ago
2.5.28
4 months ago
2.5.25
5 months ago
2.5.26
5 months ago
2.5.27
4 months ago
2.5.24
5 months ago
2.5.23
5 months ago
2.5.21
5 months ago
2.5.20
5 months ago
2.5.19
5 months ago
2.5.18
6 months ago
2.5.17
6 months ago
2.5.16
6 months ago
2.5.15
6 months ago
2.5.14
6 months ago
2.5.13
7 months ago
2.5.12
7 months ago
2.5.11
7 months ago
2.5.10
7 months ago
2.5.9
7 months ago
2.5.8
7 months ago
2.5.7
8 months ago
2.5.6
8 months ago
2.5.5
9 months ago
2.5.4
9 months ago
2.5.3
9 months ago