Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
6e7ec790
Commit
6e7ec790
authored
Jun 11, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
98315672
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
center-manage/app/base/controller/ctl.base.js
+1
-1
center-manage/app/base/service/impl/common/appSve.js
+3
-4
No files found.
center-manage/app/base/controller/ctl.base.js
View file @
6e7ec790
...
...
@@ -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
;
}
...
...
center-manage/app/base/service/impl/common/appSve.js
View file @
6e7ec790
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment