This commit is contained in:
liushiwei
2024-05-18 16:06:44 +08:00
parent 98fa8fc150
commit 2e1a84681d
18 changed files with 7445 additions and 7664 deletions

View File

@@ -172,6 +172,20 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
resolve(res.json());
});
}).then(sendResponse);
} else if (request.type == 'geiwohuoApi') {
new Promise((resolve) => {
let headers = {};
headers['Content-Type'] = 'application/json';
headers['X-Req-Zone-Id'] = 'Asia/Shanghai';
headers['X-Lt-Language'] = 'CN';
Promise.resolve().then(() => fetch(request.url, {
'headers': headers, 'method': request.method, 'referrerPolicy': 'no-referrer', 'credentials': 'include', 'body': JSON.stringify(request.data), 'mode': 'cors'
})).then((res) => {
resolve(res.json());
}).catch(() => {
resolve({success: false, errorCode: -1})
});
}).then(sendResponse);
} else if (request.type == 'notify') {
chrome.notifications.create("" + Math.random(), {
type: "basic", title: "TEMU助手", message: "您店铺【" + request.mallName + "】的商品【" + request.productName + "】成功加入发货台,请尽快处理", iconUrl: "./icons/48.png"