|
|
@@ -659,6 +659,7 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
let options = {
|
|
|
url: 'https://wxpusher.zjiecode.com/api/send/message',
|
|
|
body: JSON.stringify(data),
|
|
|
+ headers: this.getJsonDoneHeaders(),
|
|
|
};
|
|
|
this.post(options, async (error, _response, rdata) => {
|
|
|
if (!error) {
|
|
|
@@ -1072,5 +1073,29 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
}
|
|
|
return newObj;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ getBaseDoneHeaders(mixHeaders = {}) {
|
|
|
+ return Object.assign(
|
|
|
+ {
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
+ 'Access-Control-Allow-Methods': 'POST,GET,OPTIONS,PUT,DELETE',
|
|
|
+ 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
|
|
|
+ },
|
|
|
+ mixHeaders
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ getHtmlDoneHeaders() {
|
|
|
+ return this.getBaseDoneHeaders({
|
|
|
+ 'Content-Type': 'text/html;charset=UTF-8'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ getJsonDoneHeaders() {
|
|
|
+ return this.getBaseDoneHeaders({
|
|
|
+ 'Content-Type': 'text/json; charset=utf-8'
|
|
|
+ })
|
|
|
+ }
|
|
|
})(scriptName, scriptId, options)
|
|
|
}
|