Commit 7c8a7b32 by 蒋勇

d

parent 35ccf67f
......@@ -23,6 +23,11 @@ class AppCtl extends CtlBase {
let appkey=p.appkey
let app= await this.cacheManager["AppCache"].cache(appkey, null);
return system.getResult({funcJson:JSON.parse(app.functionJSON)})
//return system.getResult({funcJson:[]})
}
async saveFuncTree(p,q,req){
let rtn=await this.service.saveFuncTree(p)
return system.getResult(rtn)
}
async create(pobj, queryobj, req) {
pobj.creator_id = pobj.userid;//设置创建者
......
......@@ -102,6 +102,24 @@ class AppService extends ServiceBase {
}
})
}
async saveFuncTree(pobj){
var self = this;
return this.db.transaction(async function (t) {
//如果存在functionJSON,那么就需要转换,构建编码路径
if (pobj.funcJson) {
// let funcobjs = JSON.parse(pobj.functionJSON)
// await self.translateWithBizCode(funcobjs,null)
pobj.functionJSON= JSON.stringify(pobj.funcJson)
}
let appcache=await self.cacheManager["AppCache"].cache(pobj.appkey);
let upobj={id:appcache.id,functionJSON:pobj.functionJSON}
await self.dao.update(upobj, t)
//令缓存失效
await self.cacheManager["AppCache"].invalidate(pobj.appkey);
let appcache2=await self.dao.model.findById(appcache.id,{transaction:t});
return {funcJson:JSON.parse(appcache2.functionJSON)}
})
}
//删除应用
async update(pobj, qobj) {
var self = this;
......
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