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
89871ef4
Commit
89871ef4
authored
Dec 09, 2019
by
刘泽奇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'igirl-channel-web' of gitlab.gongsibao.com:jiangyong/zhichan into igirl-channel-web
parents
c255ed62
4e462211
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
26 deletions
+47
-26
igirl-channel-web/app/base/api/api.base.js
+18
-18
igirl-channel-web/app/base/controller/impl/common/oplogCtl.js
+6
-6
igirl-channel-web/app/base/utils/execClient.js
+1
-1
igirl-channel-web/app/config/routes/web.js
+21
-0
igirl-channel-web/app/config/settings.js
+1
-1
No files found.
igirl-channel-web/app/base/api/api.base.js
View file @
89871ef4
...
...
@@ -30,26 +30,26 @@ class APIBase extends DocBase {
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
try
{
//检查访问token
var
isPassResult
=
await
this
.
checkAcck
(
gname
,
methodname
,
pobj
,
query
,
req
);
if
(
!
isPassResult
.
ispass
)
{
return
system
.
getResultFail
(
system
.
tokenFail
,
"访问token失效,请重新获取"
);
}
//
var isPassResult = await this.checkAcck(gname, methodname, pobj, query, req);
//
if (!isPassResult.ispass) {
//
return system.getResultFail(system.tokenFail, "访问token失效,请重新获取");
//
}
var
rtn
=
await
this
[
methodname
](
pobj
,
query
);
if
(
isPassResult
.
apptocheck
){
var
app
=
isPassResult
.
apptocheck
.
app
;
if
(
methodname
&&
methodname
.
indexOf
(
"recvNotificationForCacheCount"
)
<
0
){
this
.
apitradeSvr
.
create
({
srcappkey
:
app
.
appkey
,
tradeType
:
"consume"
,
op
:
req
.
classname
+
"/"
+
methodname
,
params
:
JSON
.
stringify
(
pobj
),
clientIp
:
req
.
clientIp
,
agent
:
req
.
uagent
,
destappkey
:
settings
.
appKey
,
});
}
//
if(isPassResult.apptocheck){
//
var app=isPassResult.apptocheck.app;
//
if(methodname && methodname.indexOf("recvNotificationForCacheCount")<0){
//
this.apitradeSvr.create({
//
srcappkey: app.appkey,
//
tradeType: "consume",
//
op: req.classname + "/" + methodname,
//
params: JSON.stringify(pobj),
//
clientIp: req.clientIp,
//
agent: req.uagent,
//
destappkey:settings.appKey,
//
});
//
}
}
//
}
return
rtn
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
...
...
igirl-channel-web/app/base/controller/impl/common/oplogCtl.js
View file @
89871ef4
...
...
@@ -6,7 +6,7 @@ var moment = require("moment");
class
OplogCtl
extends
CtlBase
{
constructor
()
{
super
(
"common"
,
CtlBase
.
getServiceName
(
OplogCtl
));
//this.appS=system.getObject("service.app
Sve");
this
.
oplogSve
=
system
.
getObject
(
"service.common.oplog
Sve"
);
}
async
initNewInstance
(
qobj
)
{
...
...
@@ -17,23 +17,23 @@ class OplogCtl extends CtlBase {
}
async
debug
(
obj
)
{
obj
.
logLevel
=
"debug"
;
return
this
.
create
(
obj
);
return
this
.
oplogSve
.
create
(
obj
);
}
async
info
(
obj
)
{
obj
.
logLevel
=
"info"
;
return
this
.
create
(
obj
);
return
this
.
oplogSve
.
create
(
obj
);
}
async
warn
(
obj
)
{
obj
.
logLevel
=
"warn"
;
return
this
.
create
(
obj
);
return
this
.
oplogSve
.
create
(
obj
);
}
async
error
(
obj
)
{
obj
.
logLevel
=
"error"
;
return
this
.
create
(
obj
);
return
this
.
oplogSve
.
create
(
obj
);
}
async
fatal
(
obj
)
{
obj
.
logLevel
=
"fatal"
;
return
this
.
create
(
obj
);
return
this
.
oplogSve
.
create
(
obj
);
}
/*
...
...
igirl-channel-web/app/base/utils/execClient.js
View file @
89871ef4
...
...
@@ -4,7 +4,7 @@ const exec = util.promisify(require('child_process').exec);
const
uuidv4
=
require
(
'uuid/v4'
);
class
ExecClient
{
constructor
()
{
this
.
cmdPostPattern
=
"curl -k -H 'Content-type: application/json' -d '{data}' {url}"
;
this
.
cmdPostPattern
=
"curl -
-user admines:adminGSBes. -
k -H 'Content-type: application/json' -d '{data}' {url}"
;
this
.
cmdGetPattern
=
"curl -G -X GET '{url}'"
;
this
.
cmdPostTK
=
"curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}"
;
}
...
...
igirl-channel-web/app/config/routes/web.js
View file @
89871ef4
...
...
@@ -2,7 +2,28 @@
var
System
=
require
(
"../../base/system"
);
var
metaCtl
=
System
.
getObject
(
"web.common.metaCtl"
);
var
tmqueryCtl
=
System
.
getObject
(
"web.trademark.tmqueryCtl"
);
var
oplogCtl
=
System
.
getObject
(
"web.common.oplogCtl"
);
module
.
exports
=
function
(
app
)
{
app
.
get
(
"/jd/orderNotify"
,
async
function
(
req
,
res
)
{
oplogCtl
.
info
({
optitle
:
"########################################################.................orderNotify"
,
op
:
"/jd/orderNotify"
,
content
:
"req.query="
+
JSON
.
stringify
(
req
.
query
)
+
",req.body="
+
JSON
.
stringify
(
req
.
body
),
clientIp
:
""
});
var
params
=
{
instanceId
:
req
.
query
.
orderBizId
,
appInfo
:
{
authUrl
:
"http://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=http://tm.plus.jdcloud.com/jdtm/getUser&state=jdindentlist&client_id=9841572588670903"
}
};
res
.
end
(
JSON
.
stringify
(
params
));
return
;
console
.
log
(
req
.
query
,
"req.query.....########################################################.................orderNotify"
);
console
.
log
(
req
.
body
,
"req.body......########################################################................orderNotify"
);
});
app
.
get
(
"/1688/selfRegister"
,
async
function
(
req
,
res
)
{
var
params
=
{
actionProcess
:
"1688"
,
...
...
igirl-channel-web/app/config/settings.js
View file @
89871ef4
...
...
@@ -30,7 +30,7 @@ var settings = {
if
(
this
.
env
==
"dev"
)
{
return
"http://p.apps.com:4001/"
;
}
else
{
return
"http://open.gongsibao.com/"
;
return
"http
s
://open.gongsibao.com/"
;
}
},
teleDomain
:
function
()
{
...
...
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