MCPcopy Create free account
hub / github.com/chavyleung/scripts / sign

Function sign

zxhc/zxhc.js:16–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 .finally(() => $.done())
15
16function sign() {
17 return new Promise((resolve) => {
18 const signheaderVal = $.getdata(signheaderKey)
19 const signBodyVal = $.getdata(signbodyKey)
20 if (!signheaderVal || !signBodyVal) {
21 return resolve(null)
22 }
23 const opts = {
24 url: signURL,
25 headers: JSON.parse(signheaderVal),
26 body: signBodyVal,
27 }
28 $.post(opts, (err, resp, data) => {
29 try {
30 $.log(`${$.name}, sign data: ${data}`)
31 const res = JSON.parse(data)
32 $.sign = res
33 resolve()
34 } catch (e) {
35 $.logErr(e, data)
36 reject(e)
37 } finally {
38 resolve()
39 }
40 })
41 })
42}
43
44function getCreditInfo() {
45 return new Promise((resolve) => {

Callers 1

zxhc.jsFile · 0.70

Calls 4

getdataMethod · 0.45
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected