Commit fec9a8d6 by 蒋勇

d

parent c83d1d23
......@@ -9,9 +9,19 @@ var cacheBaseComp = null;
class RouteCtl extends CtlBase {
constructor() {
super("common", CtlBase.getServiceName(RouteCtl));
this.appS=system.getObject("service.common.appSve")
}
async create(p,q,req){
let rtn= await this.service.create(p,q);
let appid=p.app_id;
let apptmp= await this.appS.findById(appid)
let routedata={
name:p.name,
hosts:p.hosts.split(","),
paths:p.paths.split(","),
isstrip:false,
app_id:appid
}
let rtn= await this.service.create(apptmp.name, routedata, req);
return system.getResult(rtn)
}
}
......
......@@ -16,11 +16,12 @@ class RouteService extends ServiceBase {
var rtn=null;
try {
//添加路由
let routeobj = await self.cjsonregister(this.newRouteUrl(serviceName), { name: routedata.name, hosts: routedata.hosts, paths: routedata.paths, strip_path: routedata.isstrip })
let routeobj = await self.cjsonregister(RouteService.newRouteUrl(serviceName), { name: routedata.name, hosts: routedata.hosts, paths: routedata.paths, strip_path: routedata.isstrip })
routedata.center_id = routeobj.id;
rtn = await self.dao.create(routedata, t);
} catch (e) {
await self.cdel(AppService.routeUrl(routedata.name));
console.log(e)
await self.cdel(RouteService.routeUrl(routedata.name));
}
return rtn;
});
......
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