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
dd843138
Commit
dd843138
authored
May 19, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
00499818
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
center-manage/app/base/controller/impl/common/appCtl.js
+3
-4
center-manage/app/base/db/models/common/app.js
+5
-0
center-manage/app/base/service/impl/common/appSve.js
+7
-3
No files found.
center-manage/app/base/controller/impl/common/appCtl.js
View file @
dd843138
...
...
@@ -59,10 +59,9 @@ class AppCtl extends CtlBase {
// pobj.password=super.encryptPasswd(settings.defaultpwd);
//构造默认的应用相关的URL
pobj
.
authUrl
=
settings
.
protocalPrefix
+
pobj
.
domainName
+
"/auth"
;
pobj
.
docUrl
=
settings
.
protocalPrefix
+
pobj
.
domainName
+
"/web/common/metaCtl/getApiDoc"
;
pobj
.
uiconfigUrl
=
settings
.
protocalPrefix
+
pobj
.
domainName
+
"/api/meta/config/fetchAppConfig"
;
pobj
.
opCacheUrl
=
settings
.
protocalPrefix
+
pobj
.
domainName
+
"/api/meta/opCache/opCacheData"
;
pobj
.
notifyCacheCountUrl
=
settings
.
protocalPrefix
+
pobj
.
domainName
+
"/api/meta/opCache/recvNotificationForCacheCount"
;
// pobj.uiconfigUrl = settings.protocalPrefix + pobj.domainName + "/api/meta/config/fetchAppConfig";
// pobj.opCacheUrl = settings.protocalPrefix + pobj.domainName + "/api/meta/opCache/opCacheData";
// pobj.notifyCacheCountUrl = settings.protocalPrefix + pobj.domainName + "/api/meta/opCache/recvNotificationForCacheCount";
var
app
=
await
super
.
create
(
pobj
,
queryobj
,
req
);
return
system
.
getResult
(
app
);
}
...
...
center-manage/app/base/db/models/common/app.js
View file @
dd843138
...
...
@@ -7,12 +7,17 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
title
:{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
name
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
//和user的from相同,在注册user时,去创建
domainName
:
DataTypes
.
STRING
,
//域名
backend
:
DataTypes
.
STRING
,
//域名
backport
:
DataTypes
.
INTEGER
,
//后台端口
homePage
:
DataTypes
.
STRING
,
//首页
functionJSON
:
DataTypes
.
TEXT
,
//功能清单地址--前端通过loadJson下载数据
docUrl
:
DataTypes
.
STRING
,
//接口文档地址
...
...
center-manage/app/base/service/impl/common/appSve.js
View file @
dd843138
...
...
@@ -58,13 +58,17 @@ class AppService extends ServiceBase {
return
this
.
db
.
transaction
(
async
function
(
t
)
{
var
app
=
await
self
.
dao
.
create
(
pobj
,
t
);
//创建后台应用服务
let
svobj
=
await
self
.
cjsonregister
(
AppService
.
newServiceUrl
(),
{
name
:
app
.
name
,
url
:
"http://"
+
app
.
backend
})
let
urltmp
=
"http://"
+
app
.
backend
if
(
app
.
backport
){
urltmp
+=
":"
+
app
.
backport
}
let
svobj
=
await
self
.
cjsonregister
(
AppService
.
newServiceUrl
(),
{
name
:
app
.
name
,
url
:
urltmp
})
//添加路由
let
ps
=
[
"/web/auth/userCtl/pmlogin"
,
"/web/auth/userCtl/pmregister"
,
"/web/auth/userCtl/pmSendVCode"
,
"/web/auth/userCtl/pmloginByVCode"
]
let
ps
=
[
"/web/auth/userCtl/pm
getUserByCode"
,
"/web/auth/userCtl/pm
login"
,
"/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
})
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
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
);
let
r2
=
await
self
.
routeDao
.
create
({
name
:
app
.
name
+
"_api"
,
center_id
:
routeapi
.
id
,
app_id
:
app
.
id
,
shosts
:
app
.
domainName
,
spaths
:
ps2
.
join
(
","
)
},
t
);
//给api路由启动插件
...
...
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