调整
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user