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
c2834e7e
Commit
c2834e7e
authored
Mar 06, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
cb045b5f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
855 additions
and
86 deletions
+855
-86
bpo-admin/app/base/api/impl/ecompanyApi.js
+27
-0
bpo-admin/app/base/controller/impl/channelCtl.js
+107
-0
bpo-admin/app/base/db/impl/ecompanyDao.js
+1
-1
bpo-admin/app/base/db/metadata/apps/platform.js
+10
-0
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/apidebug.js
+27
-0
bpo-admin/app/base/service/impl/channelSve.js
+53
-0
bpo-admin/app/base/service/sve.base.js
+121
-69
bpo-admin/app/base/service/svems.base.js
+130
-0
bpo-admin/app/base/system.js
+19
-0
bpo-admin/app/front/vues/pages/apidebug/apidebug.html
+46
-0
bpo-admin/app/front/vues/pages/apidebug/apidebug.js
+40
-0
bpo-admin/chanle-service.txt
+236
-0
bpo-admin/package-lock.json
+37
-16
bpo-admin/package.json
+1
-0
No files found.
bpo-admin/app/base/api/impl/ecompanyApi.js
0 → 100644
View file @
c2834e7e
var
system
=
require
(
"../../system"
)
const
md5
=
require
(
"MD5"
);
const
logCtl
=
system
.
getObject
(
"web.oplogCtl"
);
const
moment
=
require
(
"moment"
);
class
EcompanyApi
{
constructor
()
{
this
.
ecompanySve
=
system
.
getObject
(
"service.ecompanySve"
);
}
async
merchantNameSuggest
(
queryobj
,
qobj
,
req
)
{
var
name
=
this
.
trim
(
queryobj
.
name
);
if
(
!
name
)
{
return
system
.
getResult2
([])
}
var
list
=
await
this
.
ecompanySve
.
suggest
(
name
);
return
system
.
getResult2
(
list
);
}
trim
(
o
)
{
if
(
!
o
)
{
return
""
;
}
return
o
.
toString
().
trim
();
}
}
module
.
exports
=
EcompanyApi
;
\ No newline at end of file
bpo-admin/app/base/controller/impl/channelCtl.js
0 → 100644
View file @
c2834e7e
var
system
=
require
(
"../../system"
)
var
settings
=
require
(
"../../../config/settings"
);
const
CtlBase
=
require
(
"../ctl.base"
);
class
ChannelCtl
extends
CtlBase
{
constructor
()
{
super
(
CtlBase
.
getServiceName
(
ChannelCtl
));
}
// 来源
async
originDics
(
queryobj
,
obj
,
req
)
{
try
{
let
rs
=
await
this
.
service
.
originDics
(
obj
);
return
rs
;
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
originInfo
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
originInfo
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
originMerchants
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
originMerchants
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
// 渠道
async
channelSuggest
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
channelSuggest
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
channelDicts
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
channelDicts
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
channelInfo
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
channelInfo
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
channelSave
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
channelSave
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
channelPage
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
channelPage
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
// 商户
async
merchantInfo
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
merchantInfo
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
merchantSave
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
merchantSave
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
async
merchantPage
(
queryobj
,
obj
,
req
)
{
try
{
return
await
this
.
service
.
merchantPage
(
obj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
}
module
.
exports
=
ChannelCtl
;
\ No newline at end of file
bpo-admin/app/base/db/impl/ecompanyDao.js
View file @
c2834e7e
...
...
@@ -134,7 +134,7 @@ class EcompanyDao extends Dao {
if
(
ownerIds
&&
ownerIds
.
length
>
0
)
{
sql
=
sql
+
" AND owner_id IN (:ownerIds) "
;
}
sql
=
sql
+
" ORDER BY id ASC "
;
sql
=
sql
+
" ORDER BY id ASC
LIMIT 10
"
;
var
list
=
await
this
.
customQuery
(
sql
,
{
queryLike
:
"%"
+
name
+
"%"
,
ownerIds
:
ownerIds
});
return
list
||
[];
}
...
...
bpo-admin/app/base/db/metadata/apps/platform.js
View file @
c2834e7e
...
...
@@ -47,6 +47,15 @@ module.exports = {
"bizConfig"
:
null
,
"path"
:
""
},
{
"code"
:
"apidebug"
,
"label"
:
"api"
,
"isMenu"
:
true
,
"bizCode"
:
"apidebug"
,
"bizConfig"
:
null
,
"path"
:
""
},
]
}
],
...
...
@@ -1462,6 +1471,7 @@ module.exports = {
"roles"
:
{
"title"
:
"角色管理"
,
"config"
:
null
,
"path"
:
"/roles"
,
"comname"
:
"roles"
},
"cachearches"
:
{
"title"
:
"缓存管理"
,
"config"
:
null
,
"path"
:
"/cachearches"
,
"comname"
:
"cachearches"
},
"tasks"
:
{
"title"
:
"平台任务"
,
"config"
:
null
,
"path"
:
"/tasks"
,
"comname"
:
"tasks"
},
"apidebug"
:
{
"title"
:
"平台任务"
,
"config"
:
null
,
"path"
:
"/apidebug"
,
"comname"
:
"apidebug"
},
"dkaggreement"
:
{
"title"
:
"协议管理"
,
"config"
:
null
,
"path"
:
"/dkaggreement"
,
"comname"
:
"dkaggreement"
},
...
...
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/apidebug.js
0 → 100644
View file @
c2834e7e
module
.
exports
=
{
"bizName"
:
"usercenter"
,
"list"
:{
columnMetaData
:[
]
},
"form"
:[
],
"search"
:[
],
"auth"
:{
"add"
:[
],
"edit"
:[
],
"delete"
:[
],
"common"
:[
],
}
}
\ No newline at end of file
bpo-admin/app/base/service/impl/channelSve.js
0 → 100644
View file @
c2834e7e
var
system
=
require
(
"../../system"
);
var
settings
=
require
(
"../../../config/settings"
);
const
microService
=
require
(
"../svems.base"
);
// 渠道服务
class
ChannelService
extends
microService
{
constructor
()
{
super
();
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
ossClient
=
system
.
getObject
(
"util.ossClient"
);
}
// 来源api
async
originDics
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"originDics"
,
params
);
}
async
originInfo
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"originInfo"
,
params
);
}
async
originMerchants
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"originMerchants"
,
params
);
}
// 渠道api
async
channelSuggest
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"channelSuggest"
,
params
);
}
async
channelDicts
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"channelDicts"
,
params
);
}
async
channelInfo
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"channelInfo"
,
params
);
}
async
channelSave
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"channelSave"
,
params
);
}
async
channelPage
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"channelPage"
,
params
);
}
// 商户api
async
merchantInfo
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"merchantInfo"
,
params
);
}
async
merchantSave
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"merchantSave"
,
params
);
}
async
merchantPage
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"merchantPage"
,
params
);
}
}
module
.
exports
=
ChannelService
;
\ No newline at end of file
bpo-admin/app/base/service/sve.base.js
View file @
c2834e7e
const
system
=
require
(
"../system"
);
const
settings
=
require
(
"../../config/settings"
);
const
system
=
require
(
"../system"
);
const
settings
=
require
(
"../../config/settings"
);
const
moment
=
require
(
"moment"
);
class
ServiceBase
{
constructor
(
daoName
){
//this.dbf=system.getObject("db.connection");
this
.
db
=
system
.
getObject
(
"db.connection"
).
getCon
();
this
.
cacheManager
=
system
.
getObject
(
"db.cacheManager"
);
this
.
daoName
=
daoName
;
this
.
dao
=
system
.
getObject
(
"db."
+
daoName
);
this
.
md5
=
require
(
"MD5"
);
}
static
getDaoName
(
ClassObj
){
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Service"
)).
toLowerCase
()
+
"Dao"
;
}
async
findAll
(
obj
){
const
objs
=
await
this
.
dao
.
model
.
findAll
();
class
ServiceBase
{
constructor
(
daoName
)
{
//this.dbf=system.getObject("db.connection");
this
.
db
=
system
.
getObject
(
"db.connection"
).
getCon
();
this
.
cacheManager
=
system
.
getObject
(
"db.cacheManager"
);
this
.
daoName
=
daoName
;
this
.
dao
=
system
.
getObject
(
"db."
+
daoName
);
this
.
md5
=
require
(
"MD5"
);
this
.
micro
=
system
.
microsetting
();
}
static
getDaoName
(
ClassObj
)
{
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Service"
)).
toLowerCase
()
+
"Dao"
;
}
async
findAll
(
obj
)
{
const
objs
=
await
this
.
dao
.
model
.
findAll
();
return
objs
;
}
async
findAndCountAll
(
obj
){
const
apps
=
await
this
.
dao
.
findAndCountAll
(
obj
);
return
apps
;
}
async
refQuery
(
qobj
){
async
findAndCountAll
(
obj
)
{
const
apps
=
await
this
.
dao
.
findAndCountAll
(
obj
);
return
apps
;
}
async
refQuery
(
qobj
)
{
return
this
.
dao
.
refQuery
(
qobj
);
}
async
bulkDelete
(
ids
){
var
en
=
await
this
.
dao
.
bulkDelete
(
ids
);
async
bulkDelete
(
ids
)
{
var
en
=
await
this
.
dao
.
bulkDelete
(
ids
);
return
en
;
}
async
delete
(
qobj
){
return
this
.
dao
.
delete
(
qobj
);
async
delete
(
qobj
)
{
return
this
.
dao
.
delete
(
qobj
);
}
async
create
(
qobj
){
async
create
(
qobj
)
{
return
this
.
dao
.
create
(
qobj
);
}
async
update
(
qobj
,
tm
=
null
)
{
return
this
.
dao
.
update
(
qobj
,
tm
);
async
update
(
qobj
,
tm
=
null
)
{
return
this
.
dao
.
update
(
qobj
,
tm
);
}
async
updateByWhere
(
setObj
,
whereObj
,
t
)
{
return
this
.
dao
.
updateByWhere
(
setObj
,
whereObj
,
t
);
async
updateByWhere
(
setObj
,
whereObj
,
t
)
{
return
this
.
dao
.
updateByWhere
(
setObj
,
whereObj
,
t
);
}
async
customExecAddOrPutSql
(
sql
,
paras
=
null
)
{
return
this
.
dao
.
customExecAddOrPutSql
(
sql
,
paras
);
async
customExecAddOrPutSql
(
sql
,
paras
=
null
)
{
return
this
.
dao
.
customExecAddOrPutSql
(
sql
,
paras
);
}
async
customQuery
(
sql
,
paras
,
t
)
{
return
this
.
dao
.
customQuery
(
sql
,
paras
,
t
);
async
customQuery
(
sql
,
paras
,
t
)
{
return
this
.
dao
.
customQuery
(
sql
,
paras
,
t
);
}
async
findCount
(
whereObj
=
null
)
{
async
findCount
(
whereObj
=
null
)
{
return
this
.
dao
.
findCount
(
whereObj
);
}
async
findSum
(
fieldName
,
whereObj
=
null
)
{
return
this
.
dao
.
findSum
(
fieldName
,
whereObj
);
async
findSum
(
fieldName
,
whereObj
=
null
)
{
return
this
.
dao
.
findSum
(
fieldName
,
whereObj
);
}
async
getPageList
(
pageIndex
,
pageSize
,
whereObj
=
null
,
orderObj
=
null
,
attributesObj
=
null
,
includeObj
=
null
)
{
return
this
.
dao
.
getPageList
(
pageIndex
,
pageSize
,
whereObj
,
orderObj
,
attributesObj
,
includeObj
);
async
getPageList
(
pageIndex
,
pageSize
,
whereObj
=
null
,
orderObj
=
null
,
attributesObj
=
null
,
includeObj
=
null
)
{
return
this
.
dao
.
getPageList
(
pageIndex
,
pageSize
,
whereObj
,
orderObj
,
attributesObj
,
includeObj
);
}
async
findOne
(
obj
){
async
findOne
(
obj
)
{
return
this
.
dao
.
findOne
(
obj
);
}
async
findById
(
oid
){
async
findById
(
oid
)
{
return
this
.
dao
.
findById
(
oid
);
}
/**
* 请求微服务
* @param {*} sveName 服务名称
* @param {*} apiName api名称
* @param {*} params 参数
*/
async
callms
(
sveName
,
apiName
,
params
)
{
var
reqUrl
=
this
.
micro
[
sveName
];
console
.
log
(
reqUrl
,
"-----------------------------"
);
if
(
!
reqUrl
)
{
return
system
.
getResult
(
null
,
"未找到【"
+
sveName
+
"】服务,请检查settings文件是否存在"
);
}
if
(
!
apiName
)
{
return
system
.
getResult
(
null
,
"apiName不能为空"
);
}
try
{
var
params
=
{
"action_process"
:
"bpo-admin"
,
"action_type"
:
apiName
,
"action_body"
:
params
||
{},
}
if
(
settings
.
env
==
'dev'
)
{
let
rs
=
await
axios
({
method
:
'post'
,
url
:
reqUrl
,
data
:
params
});
console
.
log
(
rs
);
return
rs
.
data
;
}
var
rs
=
await
this
.
restClient
.
execPost
(
params
,
reqUrl
);
if
(
rs
&&
rs
.
stdout
)
{
return
JSON
.
parse
(
rs
.
stdout
);
}
return
system
.
getResult
(
null
,
rs
);
}
catch
(
error
)
{
console
.
log
(
error
);
this
.
logCtl
.
error
({
optitle
:
"微服务请求失败"
,
op
:
"sveName = "
+
sveName
+
"; apiName = "
+
apiName
,
content
:
"params = "
+
JSON
.
stringify
(
params
),
clientIp
:
""
});
return
system
.
getResult
(
null
,
error
.
message
);
}
}
async
getUidInfo
(
len
,
radix
)
{
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
if
(
len
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
uuid
[
i
]
=
chars
[
0
|
Math
.
random
()
*
radix
];
}
else
{
var
r
;
uuid
[
8
]
=
uuid
[
13
]
=
uuid
[
18
]
=
uuid
[
23
]
=
'-'
;
uuid
[
14
]
=
'4'
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
!
uuid
[
i
])
{
r
=
0
|
Math
.
random
()
*
16
;
uuid
[
i
]
=
chars
[(
i
==
19
)
?
(
r
&
0x3
)
|
0x8
:
r
];
}
}
}
return
uuid
.
join
(
''
);
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
if
(
len
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
uuid
[
i
]
=
chars
[
0
|
Math
.
random
()
*
radix
];
}
else
{
var
r
;
uuid
[
8
]
=
uuid
[
13
]
=
uuid
[
18
]
=
uuid
[
23
]
=
'-'
;
uuid
[
14
]
=
'4'
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
!
uuid
[
i
])
{
r
=
0
|
Math
.
random
()
*
16
;
uuid
[
i
]
=
chars
[(
i
==
19
)
?
(
r
&
0x3
)
|
0x8
:
r
];
}
}
}
return
uuid
.
join
(
''
);
}
encryptPasswd
(
passwd
)
{
if
(
!
passwd
)
{
throw
new
Error
(
"请输入密码"
);
}
var
md5
=
this
.
md5
(
passwd
+
"_"
+
settings
.
salt
);
return
md5
.
toString
().
toLowerCase
();
if
(
!
passwd
)
{
throw
new
Error
(
"请输入密码"
);
}
var
md5
=
this
.
md5
(
passwd
+
"_"
+
settings
.
salt
);
return
md5
.
toString
().
toLowerCase
();
}
handleDate
(
row
,
fields
,
pattern
,
addHours
)
{
pattern
=
pattern
||
"YYYY-MM-DD HH:mm"
;
...
...
@@ -95,18 +147,18 @@ class ServiceBase{
}
for
(
var
field
of
fields
)
{
if
(
row
[
field
])
{
if
(
addHours
)
{
row
[
field
]
=
moment
(
row
[
field
]).
add
(
addHours
,
"hours"
).
format
(
pattern
);
if
(
addHours
)
{
row
[
field
]
=
moment
(
row
[
field
]).
add
(
addHours
,
"hours"
).
format
(
pattern
);
}
else
{
row
[
field
]
=
moment
(
row
[
field
]).
format
(
pattern
);
}
}
}
}
addWhereTime
(
where
,
field
,
begin
,
end
)
{
if
(
!
begin
&&
!
end
)
{
if
(
!
begin
&&
!
end
)
{
return
;
}
...
...
@@ -126,10 +178,10 @@ class ServiceBase{
}
trim
(
o
)
{
if
(
!
o
)
{
if
(
!
o
)
{
return
""
;
}
return
o
.
toString
().
trim
();
}
}
module
.
exports
=
ServiceBase
;
module
.
exports
=
ServiceBase
;
bpo-admin/app/base/service/svems.base.js
0 → 100644
View file @
c2834e7e
const
system
=
require
(
"../system"
);
const
settings
=
require
(
"../../config/settings"
);
const
moment
=
require
(
"moment"
);
const
axios
=
require
(
"axios"
);
class
ServiceBase
{
constructor
(
daoName
)
{
this
.
md5
=
require
(
"MD5"
);
this
.
micro
=
system
.
microsetting
();
}
/**
* 请求微服务
* @param {*} sveName 服务名称
* @param {*} apiName api名称
* @param {*} params 参数
*/
async
callms
(
sveName
,
apiName
,
params
)
{
var
reqUrl
=
this
.
micro
[
sveName
];
console
.
log
(
reqUrl
,
"-----------------------------"
);
if
(
!
reqUrl
)
{
return
system
.
getResult
(
null
,
"未找到【"
+
sveName
+
"】服务,请检查settings文件是否存在"
);
}
if
(
!
apiName
)
{
return
system
.
getResult
(
null
,
"apiName不能为空"
);
}
try
{
var
params
=
{
"action_process"
:
"bpo-admin"
,
"action_type"
:
apiName
,
"action_body"
:
params
||
{},
}
if
(
settings
.
env
==
'dev'
)
{
let
rs
=
await
axios
({
method
:
'post'
,
url
:
reqUrl
,
data
:
params
});
console
.
log
(
rs
);
return
rs
.
data
;
}
var
rs
=
await
this
.
restClient
.
execPost
(
params
,
reqUrl
);
if
(
rs
&&
rs
.
stdout
)
{
return
JSON
.
parse
(
rs
.
stdout
);
}
return
system
.
getResult
(
null
,
rs
);
}
catch
(
error
)
{
console
.
log
(
error
);
this
.
logCtl
.
error
({
optitle
:
"微服务请求失败"
,
op
:
"sveName = "
+
sveName
+
"; apiName = "
+
apiName
,
content
:
"params = "
+
JSON
.
stringify
(
params
),
clientIp
:
""
});
return
system
.
getResult
(
null
,
error
.
message
);
}
}
async
getUidInfo
(
len
,
radix
)
{
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
if
(
len
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
uuid
[
i
]
=
chars
[
0
|
Math
.
random
()
*
radix
];
}
else
{
var
r
;
uuid
[
8
]
=
uuid
[
13
]
=
uuid
[
18
]
=
uuid
[
23
]
=
'-'
;
uuid
[
14
]
=
'4'
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
!
uuid
[
i
])
{
r
=
0
|
Math
.
random
()
*
16
;
uuid
[
i
]
=
chars
[(
i
==
19
)
?
(
r
&
0x3
)
|
0x8
:
r
];
}
}
}
return
uuid
.
join
(
''
);
}
encryptPasswd
(
passwd
)
{
if
(
!
passwd
)
{
throw
new
Error
(
"请输入密码"
);
}
var
md5
=
this
.
md5
(
passwd
+
"_"
+
settings
.
salt
);
return
md5
.
toString
().
toLowerCase
();
}
handleDate
(
row
,
fields
,
pattern
,
addHours
)
{
pattern
=
pattern
||
"YYYY-MM-DD HH:mm"
;
if
(
!
row
)
{
return
;
}
for
(
var
field
of
fields
)
{
if
(
row
[
field
])
{
if
(
addHours
)
{
row
[
field
]
=
moment
(
row
[
field
]).
add
(
addHours
,
"hours"
).
format
(
pattern
);
}
else
{
row
[
field
]
=
moment
(
row
[
field
]).
format
(
pattern
);
}
}
}
}
addWhereTime
(
where
,
field
,
begin
,
end
)
{
if
(
!
begin
&&
!
end
)
{
return
;
}
if
(
begin
&&
end
)
{
where
[
field
]
=
{
[
this
.
db
.
Op
.
between
]:
[
begin
,
end
]
};
}
else
if
(
begin
&&
!
end
)
{
where
[
field
]
=
{
[
this
.
db
.
Op
.
gte
]:
begin
};
}
else
if
(
!
begin
&&
end
)
{
where
[
field
]
=
{
[
this
.
db
.
Op
.
lte
]:
end
};
}
}
trim
(
o
)
{
if
(
!
o
)
{
return
""
;
}
return
o
.
toString
().
trim
();
}
}
module
.
exports
=
ServiceBase
;
bpo-admin/app/base/system.js
View file @
c2834e7e
...
...
@@ -252,6 +252,25 @@ class System {
// return p;
// }
// }
static
microsetting
()
{
console
.
log
(
settings
.
env
,
"-------------- microsetting env ------------------"
);
var
path
=
"/api/op/action/springboard"
;
if
(
settings
.
env
==
"dev"
)
{
// var domain = "http://192.168.18.237";
var
domain2
=
"http://127.0.0.1"
;
var
domain
=
"http://39.107.234.14"
;
return
{
// 渠道服务
channel
:
domain
+
":3003"
+
path
,
}
}
else
{
// var odomain = "http://123.57.217.203"
return
{
channel
:
"bpochannel-service"
+
path
,
}
}
}
}
Date
.
prototype
.
Format
=
function
(
fmt
)
{
//author: meizz
...
...
bpo-admin/app/front/vues/pages/apidebug/apidebug.html
0 → 100644
View file @
c2834e7e
<gsb-pcpage>
<div>
<div
style=
"height: auto;"
>
<el-card
style=
"background-color: #FFFFFF;min-height: 700px;"
>
<div
style=
"line-height: 15px;padding-bottom:40px;padding: 9px 0px 0px 9px;"
>
<div
style=
"width:2px;height:15px;float: left;background-color: #54C4A7"
>
</div>
<span
style=
"font-size:16px;float: left;font-weight:bold;margin-left: 7px;color: #333333"
>
ctl调试
</span>
</div>
<div
style=
"clear:both; padding: 0px 0px 0px 23px;"
>
<el-form
:model=
"apiForm"
ref=
"apiForm"
label-position=
"left"
label-width=
"100px"
style=
"padding:0px 65px;"
>
<el-form-item
label=
"api"
prop=
"uri"
>
<el-input
v-model=
"apiForm.uri"
placeholder=
"api路径"
style=
"width:550px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"请求参数"
prop=
"req"
>
<el-input
v-model=
"apiForm.req"
type=
"textarea"
:autosize=
"{ minRows: 8, maxRows: 20}"
style=
"width:550px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"返回结果"
prop=
"res"
>
<el-input
v-model=
"apiForm.res"
type=
"textarea"
:autosize=
"{ minRows: 10, maxRows: 20}"
style=
"width:550px;"
clearable
></el-input>
</el-form-item>
<div
style=
"width: 100%;text-align: center;"
>
<el-button
type=
"primary"
@
click=
"doreq()"
>
请求
</el-button>
<el-button
@
click=
"cleareq()"
>
重置
</el-button>
</div>
</el-form>
</div>
</div>
</div>
<el-dialog
width=
"524px"
:visible
.
sync=
"dialogFormVisible"
>
<div
slot=
"title"
>
<span
style=
"margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;"
>
修改密码
</span>
<div
style=
"width: 524px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"
></div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel()"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"save()"
>
保存修改
</el-button>
</div>
</el-dialog>
</gsb-pcpage>
\ No newline at end of file
bpo-admin/app/front/vues/pages/apidebug/apidebug.js
0 → 100644
View file @
c2834e7e
{
template
:
'${tmpl}'
,
data
:
function
()
{
return
{
currentUser
:
null
,
dialogTableVisible
:
false
,
dialogFormVisible
:
false
,
pwdSaveLoading
:
false
,
apiForm
:
{
uri
:
''
,
req
:
''
,
res
:
''
},
}
},
mounted
:
function
()
{
},
created
:
function
()
{
},
methods
:
{
cleareq
()
{
this
.
apiForm
=
{
uri
:
''
,
req
:
''
,
res
:
''
};
},
doreq
()
{
console
.
log
(
this
.
apiForm
,
'-------------- api form'
);
var
self
=
this
;
let
data
=
JSON
.
parse
(
self
.
apiForm
.
req
||
"{}"
);
self
.
$root
.
postReq
(
self
.
apiForm
.
uri
,
data
).
then
(
function
(
d
)
{
self
.
apiForm
.
res
=
JSON
.
stringify
(
d
);
});
}
},
vname
:
"gsb-bpouser"
}
bpo-admin/chanle-service.txt
0 → 100644
View file @
c2834e7e
渠道服务接口
1 来源
1.1. 商户来源字典
url: /web/channelCtl/originDics
请求参数:
{}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": [{
"id": 10000, // 字典id
"name": "薪必果结算", // 字典名称
"is_api": 1 // 0不需要请求api,1需要请求接口(1.2 商户来源企业suggest)获取来源商户列表
}],
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
1.2 商户来源企业suggest
url: /web/channelCtl/originMerchants
请求参数:
{
"id": 10000, // 来源id
"name" : "xxx", // 商户搜索名称
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": [{
"id": 10000, // 商户id
"name": "北京国美融通科技有限公司", // 商户名称
}],
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
2 渠道管理
2.1 渠道字典
url: /web/channelCtl/channelDicts
请求参数:
{}
返回结果:
{
"status": 0,
"msg": "success",
"data": [{
"id": 10000, // 渠道id
"name": "测试1" // 渠道名称
}],
"requestid": "8e6da5a710cc43e0a11d426ae84a5780"
}
2.2 渠道搜索
url: /web/channelCtl/channelSuggest
请求参数:
{
"name":"测试3333" // 渠道名称
}
返回结果:
{
"status": 0,
"msg": "success",
"data": [{
"id": 10000, // 渠道id
"name": "测试1" // 渠道名称
}],
"requestid": "8e6da5a710cc43e0a11d426ae84a5780"
}
2.3 渠道管理列表
url: /web/channelCtl/channelPage
请求参数:
{
"currentPage":1,
"pageSize": 2,
"name":"测试1" // 渠道名称
}
返回结果:
{
"status": 0,
"msg": "success",
"data": {
"count": 1,
"rows": [{
"id": 10000,
"ctype": 1, // 1机构 2个人
"name": "测试1",
"idcode": "统一社会信用代码or身份证",
"business_license": "营业执照图片路径",
"idcard_front": "身份证正面图",
"idcard_back": "身份证反面图",
"contact_man": "联系人",
"contact_mobile": "联系电话",
"contact_email": "联系偶像",
"contact_addr": "联系地址",
"created_at": "2020-03-06 05:38:49",
}]
},
"requestid": "d3fde2b829244c20966031d8e7f93e2a"
}
2.4 渠道信息
url: /web/channelCtl/channelInfo
请求参数:
{
"id":"10002"
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": {
"id": 10000,
"ctype": 1, // 1机构 2个人
"name": "测试1",
"idcode": "统一社会信用代码or身份证",
"business_license": "营业执照图片路径",
"idcard_front": "身份证正面图",
"idcard_back": "身份证反面图",
"contact_man": "联系人",
"contact_mobile": "联系电话",
"contact_email": "联系偶像",
"contact_addr": "联系地址",
"created_at": "2020-03-06 05:38:49",
},
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
2.3 渠道保存
url: /web/channelCtl/channelSave
请求参数:
{
"id":"10002", // id 为空时新增 不为空时修改
"ctype":"1",
"name":"测试3333",
"idcode":"统一社会信用代码or身份证",
"business_license":"营业执照图片路径",
"idcard_front":"身份证正面图",
"idcard_back":"身份证反面图",
"contact_man":"联系人",
"contact_mobile":"联系电话",
"contact_email":"联系偶像",
"contact_addr":"联系地址"
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
3 商户管理
3.1 商户管理列表
url: /web/channelCtl/merchantPage
请求参数:
{
"currentPage":1,
"pageSize": 2,
"channel_id":10000 // 渠道id,
"origin_id":10000 // 渠道id,
"merchant_name":"商户名称" // 渠道id,
}
返回结果:
{
"status": 0,
"msg": "success",
"data": {
"count": 6,
"rows": [{
"id": 7, // 商户id
"channel_id": 10002, // 渠道id
"channel_name": "测试3333" // 渠道名称
"channel_idcode": "xxxxx", // 渠道统一社会信用代码或者身份证
"origin_id": 10001, // 来源id
"merchant_name": "测试商户7", // 商户名称
"contact_man": "联系人7",
"contact_mobile": "联系电话7",
"contact_email": "联系偶像7",
"contact_addr": "联系地址7",
"created_at": "2020-03-06 06:17:34",
"version": 1,
}]
},
"requestid": "63d4c6f9493a40b58dc31286b9b96c56"
}
3.2 商户信息
url: /web/channelCtl/merchantInfo
请求参数:
{
"id": 7
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": {
"id": 7, // 商户id
"channel_id": 10002, // 渠道id
"channel_name": "测试3333" // 渠道名称
"channel_idcode": "xxxxx", // 渠道统一社会信用代码或者身份证
"origin_id": 10001, // 来源id
"merchant_name": "测试商户7", // 商户名称
"contact_man": "联系人7",
"contact_mobile": "联系电话7",
"contact_email": "联系偶像7",
"contact_addr": "联系地址7",
"created_at": "2020-03-06 06:17:34",
"version": 1,
},
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
3.3 商户保存
url: /web/channelCtl/merchantSave
请求参数:
{
"id": 7, // 为空时添加 不为空时修改
"channel_id": 10002, // 渠道id
"origin_id": 10001, // 来源id
"origin_merchant_id":"", // 来源商户id
"merchant_name":"测试商户7",
"contact_man":"联系人7",
"contact_mobile":"联系电话7",
"contact_email":"联系偶像7",
"contact_addr":"联系地址7"
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
\ No newline at end of file
bpo-admin/package-lock.json
View file @
c2834e7e
...
...
@@ -333,6 +333,14 @@
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz"
,
"integrity"
:
"sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w=="
},
"axios"
:
{
"version"
:
"0.19.2"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-0.19.2.tgz"
,
"integrity"
:
"sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA=="
,
"requires"
:
{
"follow-redirects"
:
"1.5.10"
}
},
"babel-helper-vue-jsx-merge-props"
:
{
"version"
:
"2.0.3"
,
"resolved"
:
"https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz"
,
...
...
@@ -1616,6 +1624,24 @@
}
}
},
"follow-redirects"
:
{
"version"
:
"1.5.10"
,
"resolved"
:
"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz"
,
"integrity"
:
"sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ=="
,
"requires"
:
{
"debug"
:
"=3.1.0"
},
"dependencies"
:
{
"debug"
:
{
"version"
:
"3.1.0"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-3.1.0.tgz"
,
"integrity"
:
"sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g=="
,
"requires"
:
{
"ms"
:
"2.0.0"
}
}
}
},
"forever-agent"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
,
...
...
@@ -1952,11 +1978,6 @@
"resolved"
:
"https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz"
,
"integrity"
:
"sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI="
},
"is-buffer"
:
{
"version"
:
"1.1.6"
,
"resolved"
:
"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
,
"integrity"
:
"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"is-builtin-module"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz"
,
...
...
@@ -2260,16 +2281,6 @@
"es5-ext"
:
"~0.10.2"
}
},
"md5"
:
{
"version"
:
"2.2.1"
,
"resolved"
:
"https://registry.npmjs.org/md5/-/md5-2.2.1.tgz"
,
"integrity"
:
"sha1-U6s41f48iJG6RlMp6iP6wFQBJvk="
,
"requires"
:
{
"charenc"
:
"~0.0.1"
,
"crypt"
:
"~0.0.1"
,
"is-buffer"
:
"~1.1.1"
}
},
"media-typer"
:
{
"version"
:
"0.3.0"
,
"resolved"
:
"https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
,
...
...
@@ -4290,9 +4301,19 @@
"resolved"
:
"https://registry.npmjs.org/wx-pay/-/wx-pay-1.0.2.tgz"
,
"integrity"
:
"sha1-rhQqFRQ0yjgKgDffgytl3f9JdQQ="
,
"requires"
:
{
"md5"
:
"^2.0.0"
,
"request"
:
"^2.54.0"
,
"xml2js"
:
"^0.4.6"
},
"dependencies"
:
{
"md5"
:
{
"version"
:
"1.3.0"
,
"resolved"
:
"https://registry.npmjs.org/md5/-/md5-2.2.1.tgz"
,
"integrity"
:
"sha1-U6s41f48iJG6RlMp6iP6wFQBJvk="
,
"requires"
:
{
"charenc"
:
">= 0.0.1"
,
"crypt"
:
">= 0.0.1"
}
}
}
},
"xlsx"
:
{
...
...
bpo-admin/package.json
View file @
c2834e7e
...
...
@@ -11,6 +11,7 @@
"dependencies"
:
{
"
after
"
:
"^0.8.2"
,
"
ali-oss
"
:
"^4.12.2"
,
"
axios
"
:
"^0.19.2"
,
"
babel-polyfill
"
:
"^6.26.0"
,
"
base64id
"
:
"^1.0.0"
,
"
bluebird
"
:
"^3.5.1"
,
...
...
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