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
d065091a
Commit
d065091a
authored
Mar 30, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
8fd06d73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
center-app/app/base/api/api.base.js
+1
-1
center-app/app/base/api/impl/auth/channelAccessAuth.js
+6
-0
center-app/app/base/service/impl/utilsSve/utilsuserSve.js
+7
-6
No files found.
center-app/app/base/api/api.base.js
View file @
d065091a
...
@@ -53,7 +53,7 @@ class APIBase {
...
@@ -53,7 +53,7 @@ class APIBase {
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
req
.
requestId
=
this
.
getUUID
();
try
{
try
{
if
([
"getTokenByHosts"
,
"receiveCallBackNotify"
,
"getAppInfo"
,
"getPayInfo"
].
indexOf
(
methodname
)
<
0
)
{
if
([
"getTokenByHosts"
,
"receiveCallBackNotify"
,
"getAppInfo"
,
"getPayInfo"
,
"test"
].
indexOf
(
methodname
)
<
0
)
{
if
(
!
pobj
.
appInfo
)
{
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
}
}
...
...
center-app/app/base/api/impl/auth/channelAccessAuth.js
View file @
d065091a
...
@@ -22,5 +22,10 @@ class ChannelAccessAuthAPI extends APIBase {
...
@@ -22,5 +22,10 @@ class ChannelAccessAuthAPI extends APIBase {
var
opResult
=
await
this
.
utilsuserSve
.
getDingJsApiAuthentication
(
pobj
);
var
opResult
=
await
this
.
utilsuserSve
.
getDingJsApiAuthentication
(
pobj
);
return
opResult
;
return
opResult
;
}
}
async
test
(
pobj
,
qobj
,
req
)
{
var
opResult
=
await
this
.
utilsuserSve
.
getJsApiSingnature
(
"ticket"
,
"nonce"
,
"timeStamp"
,
"http://alitm.qifu.gongsibao.com"
);
return
system
.
getResultSuccess
(
opResult
);
}
}
}
module
.
exports
=
ChannelAccessAuthAPI
;
module
.
exports
=
ChannelAccessAuthAPI
;
\ No newline at end of file
center-app/app/base/service/impl/utilsSve/utilsuserSve.js
View file @
d065091a
...
@@ -72,7 +72,7 @@ class UtilsUserSve extends AppServiceBase {
...
@@ -72,7 +72,7 @@ class UtilsUserSve extends AppServiceBase {
timeStamp
:
timeStamp
.
toString
(),
timeStamp
:
timeStamp
.
toString
(),
nonceStr
:
nonceStr
.
toUpperCase
()
nonceStr
:
nonceStr
.
toUpperCase
()
};
};
var
signature
=
await
this
.
getJsApiSingnature
(
ticketResult
.
data
.
ticket
,
parameters
.
nonceStr
,
parameters
.
timeStamp
,
nowPageUrl
);
var
signature
=
await
this
.
getJsApiSingnature
(
pobj
,
ticketResult
.
data
.
ticket
,
parameters
.
nonceStr
,
parameters
.
timeStamp
,
nowPageUrl
);
parameters
.
signature
=
signature
;
parameters
.
signature
=
signature
;
return
system
.
getResultSuccess
(
parameters
);
return
system
.
getResultSuccess
(
parameters
);
}
}
...
@@ -134,17 +134,18 @@ class UtilsUserSve extends AppServiceBase {
...
@@ -134,17 +134,18 @@ class UtilsUserSve extends AppServiceBase {
* @param {*} timeStamp
* @param {*} timeStamp
* @param {*} url
* @param {*} url
*/
*/
async
getJsApiSingnature
(
ticket
,
nonce
,
timeStamp
,
url
)
{
//获取JsApi鉴权签名信息----本类中调用
async
getJsApiSingnature
(
pobj
,
ticket
,
nonce
,
timeStamp
,
url
)
{
//获取JsApi鉴权签名信息----本类中调用
let
plainTex
=
"jsapi_ticket="
+
ticket
+
"&noncestr="
+
nonce
+
"×tamp="
+
timeStamp
+
"&url="
+
url
;
let
plainTex
=
"jsapi_ticket="
+
ticket
+
"&noncestr="
+
nonce
+
"×tamp="
+
timeStamp
+
"&url="
+
url
;
// var BufferList= new Buffer(plainTex).toString("base64");
this
.
logCtl
.
info
({
this
.
logCtl
.
info
({
//
appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
:
""
,
//
appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
:
""
,
// op: "https://oapi.dingtalk.com/get_jsapi_ticket
",
op
:
"center-app/app/base/service/impl/utilsSve/utilsuserSve.js/getJsApiSingnature
"
,
content
:
"参数:"
+
plainTex
,
content
:
"参数:"
+
plainTex
,
optitle
:
"记录钉钉鉴权签名信息参数"
,
optitle
:
"记录钉钉鉴权签名信息参数"
,
});
});
let
signature
=
cryptoJS
.
SHA1
(
plainTex
).
toString
();
let
signature
=
cryptoJS
.
SHA1
(
plainTex
).
toString
(
cryptoJS
.
enc
.
Hex
);
//cryptoJS.SHA1(plainTex).toString(
);
return
signature
;
return
signature
;
}
}
}
}
...
...
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