Commit 7bf4c33d by 蒋勇

d

parent 5c43bed9
...@@ -11,8 +11,8 @@ class AppCtl extends CtlBase { ...@@ -11,8 +11,8 @@ class AppCtl extends CtlBase {
super("common", CtlBase.getServiceName(AppCtl)); super("common", CtlBase.getServiceName(AppCtl));
this.userCtl = system.getObject("service.auth.userSve"); this.userCtl = system.getObject("service.auth.userSve");
} }
async findAllApps() { async findAllApps(p,q,req) {
var rtns = await this.service.findAllApps(); var rtns = await this.service.findAllApps(p.userid);
return system.getResult(rtns); return system.getResult(rtns);
} }
......
...@@ -18,7 +18,7 @@ module.exports={ ...@@ -18,7 +18,7 @@ module.exports={
"ctls":[ "ctls":[
{"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""}, {"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""},
{"type":"switch","label":"是否公共服务","prop":"isCommon","acText":"是","inactText":"否","placeHolder":"","style":""}, {"type":"switch","label":"是否公共服务","prop":"isCommon","acText":"是","inactText":"否","placeHolder":"","style":""},
{"type":"switch","label":"是否对外","prop":"isPublic","acText":"是","inactText":"否","placeHolder":"","style":""}, {"type":"switch","label":"是否私有","prop":"isPublish","acText":"否","inactText":"是","placeHolder":"","style":""},
{ "type": "select", "label": "应用类型", "dicKey": "app_type", "prop": "appType", "labelField": "label", "valueField": "value", "placeHolder": "请选择支付类型", "style": "" }, { "type": "select", "label": "应用类型", "dicKey": "app_type", "prop": "appType", "labelField": "label", "valueField": "value", "placeHolder": "请选择支付类型", "style": "" },
// {"type":"switch","label":"启用多租户","prop":"isSaas","acText":"启用","inactText":"停用","placeHolder":"","style":""}, // {"type":"switch","label":"启用多租户","prop":"isSaas","acText":"启用","inactText":"停用","placeHolder":"","style":""},
] ]
......
...@@ -15,6 +15,8 @@ module.exports={ ...@@ -15,6 +15,8 @@ module.exports={
"colnum":1, "colnum":1,
"ctls":[ "ctls":[
{"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""}, {"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""},
{"type":"switch","label":"是否私有","prop":"isPublish","acText":"否","inactText":"是","placeHolder":"","style":""},
{ "type": "select", "label": "应用类型", "dicKey": "app_type", "prop": "appType", "labelField": "label", "valueField": "value", "placeHolder": "请选择支付类型", "style": "" },
] ]
}, },
{ {
......
...@@ -12,9 +12,27 @@ class AppService extends ServiceBase { ...@@ -12,9 +12,27 @@ class AppService extends ServiceBase {
async getApp(appkey) { async getApp(appkey) {
return this.cacheManager["AppCache"].cache(appkey, null); return this.cacheManager["AppCache"].cache(appkey, null);
} }
async findAllApps() { async findAllApps(uid) {
var apps=null;
var dicRtn = {}; var dicRtn = {};
var apps = await this.dao.model.findAll({ where: { isEnabled: true }, attributes: ['id', 'name', 'appkey', 'showimgUrl', 'appType', 'docUrl','homePage'] }); var wheresql= {};
if(uid){
wheresql[this.db.Op.and]={
[this.db.Op.or]:
[
{isPublish:false, creator_id: uid},
{isEnabled: true,isPublish:true}
],
};
apps = await this.dao.model.findAll({
where: wheresql,
attributes: ['id', 'name', 'appkey', 'showimgUrl', 'appType', 'docUrl','homePage'] });
}else{
wheresql= {isEnabled: true,isPublish:true};
apps = await this.dao.model.findAll({
where: wheresql,
attributes: ['id', 'name', 'appkey', 'showimgUrl', 'appType', 'docUrl','homePage'] });
}
for (var app of apps) { for (var app of apps) {
var tmk = uiconfig.config.pdict.app_type[app.appType]; var tmk = uiconfig.config.pdict.app_type[app.appType];
if (!dicRtn[tmk]) { if (!dicRtn[tmk]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment