Commit 6e7ec790 by 蒋勇

d

parent 98315672
......@@ -65,7 +65,7 @@ class CtlBase {
// if(!req.xctx.companyid && !req.xctx.companykey){
// return [-200,"请求头缺少应用x-app-key"]
// }
if(!req.xctx.companyid && req.xctx.fromcompanykey && req.xctx.fromcompanykey!="null"){
if(!req.xctx.companyid && req.xctx.fromcompanykey && req.xctx.fromcompanykey!="null" && req.xctx.fromcompanykey!="undefined"){
let comptmp=await this.cacheManager["CompanyCache"].cache(req.xctx.fromcompanykey);
req.xctx.companyid=comptmp.id;
}
......
......@@ -87,9 +87,6 @@ class AppService extends ServiceBase {
return dicRtn;
}
//创建应用
//每个应用建立两个路由,一个api路由
//对api路由启用jwt插件
......@@ -102,11 +99,13 @@ class AppService extends ServiceBase {
if (app.backport) {
urltmp += ":" + app.backport
}
//先检查后端服务是否存在,如果存在
let svobj = await self.cjsonregister(AppService.newServiceUrl(), { name: app.name, url: urltmp })
//添加路由
//添加路由,下面的绕过jwt检查
let ps = ["/web/auth/userCtl/pmgetUserByCode", "/web/auth/userCtl/pmlogin", "/web/auth/userCtl/pmregister", "/web/auth/userCtl/pmSendVCode", "/web/auth/userCtl/pmloginByVCode"]
let routeobj = await self.cjsonregister(AppService.newRouteUrl(app.name),
{ name: app.name, paths: ps, hosts: [app.domainName], strip_path: false })
//如下要经过jwt检查
let ps2 = ["/api", "/web"]
let routeapi = await self.cjsonregister(AppService.newRouteUrl(app.name), { name: app.name + "_api", hosts: [app.domainName], paths: ps2, strip_path: false })
let r1 = await self.routeDao.create({ name: app.name, center_id: routeobj.id, app_id: app.id, shosts: app.domainName, spaths: ps.join(",") }, t);
......
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