yhtx 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -66,6 +66,7 @@ async function call(path, { apiKey, secret, data, method, recvWindow } = {}) {
|
|
|
66
66
|
.then((r) => {
|
|
67
67
|
let dt = r.data;
|
|
68
68
|
let rs = r.data.data;
|
|
69
|
+
|
|
69
70
|
if (dt?.code == 403 && msg == "Verification failure [校验失败]") {
|
|
70
71
|
console.log("api bug: null"); //{code:403,msg:'Verification failure [校验失败]',data:null,ts:1758849372250}
|
|
71
72
|
} else if (dt?.status == "error") {
|
|
@@ -79,8 +80,12 @@ async function call(path, { apiKey, secret, data, method, recvWindow } = {}) {
|
|
|
79
80
|
console.log(dt);
|
|
80
81
|
rs = dt; //rs={status:'error',}
|
|
81
82
|
}
|
|
82
|
-
} else if (dt?.message == "Verification failure [校验失败]"
|
|
83
|
-
|
|
83
|
+
} else if (dt?.message == "Verification failure [校验失败]") {
|
|
84
|
+
if (dt?.code == 1003) {
|
|
85
|
+
console.log("api bug4: undefined"); //{ message: 'Verification failure [校验失败]', code: 1003, success: false }
|
|
86
|
+
} else if (dt?.code == 513) {
|
|
87
|
+
console.log("api bug4.1: undefined"); //{code: 513,data: null,message:"Verification failure [校验失败]",success:false,"print-log":true}
|
|
88
|
+
}
|
|
84
89
|
} else if (dt?.message == "Verification failure" && dt?.code == 12008) {
|
|
85
90
|
console.log("api bug5: null"); //{ code: 12008, message: "Verification failure", data: null };
|
|
86
91
|
} else if (!(r.data?.code == 200 /*success*/ || r.data?.status == "ok")) {
|
|
@@ -90,7 +95,10 @@ async function call(path, { apiKey, secret, data, method, recvWindow } = {}) {
|
|
|
90
95
|
console.log(dt);
|
|
91
96
|
rs = dt; //eg rs={message:'The account API interface queried is empty',code:40237,success:false}
|
|
92
97
|
} // rs=DATA(if ok)|{status:'error',}|null(api fail)|undefined(api fail)
|
|
93
|
-
else if (!rs
|
|
98
|
+
else if (!rs /*null*/) {
|
|
99
|
+
console.log(dt);
|
|
100
|
+
rs = dt;
|
|
101
|
+
} //else rs=DATA
|
|
94
102
|
|
|
95
103
|
return rs; //rs=DATA | {status:'error','err=code','err-msg',data:null} | null(if api fail) | undefined(if apiFail)
|
|
96
104
|
})
|