diff --git a/public/rules_1.json b/public/rules_1.json new file mode 100644 index 0000000..646b541 --- /dev/null +++ b/public/rules_1.json @@ -0,0 +1,44 @@ +[ + { + "id": 12, + "priority": 1, + "action": { + "type": "modifyHeaders", + "requestHeaders": [ + { + "header": "Origin", + "operation": "set", + "value": "https://kuajing.pinduoduo.com" + }, + { + "header": "Referer", + "operation": "set", + "value": "https://kuajing.pinduoduo.com/main/order-manage" + }, + { + "header": "Sec-Fetch-Site", + "operation": "set", + "value": "same-origin" + }, + { + "header": "Sec-Ch-Ua", + "operation": "set", + "value": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"" + }, + { + "header": "Sec-Ch-Ua-Mobile", + "operation": "set", + "value": "?0" + }, + { + "header": "Sec-Ch-Ua-Platform", + "operation": "set", + "value": "Windows" + } + ] + }, + "condition": { + "urlFilter": "joinDeliveryGoodsOrderPlatform" + } + } +] \ No newline at end of file diff --git a/src/entry/background.js b/src/entry/background.js index 07694cb..2b222c9 100644 --- a/src/entry/background.js +++ b/src/entry/background.js @@ -46,6 +46,23 @@ chrome.action.onClicked.addListener(function () { }); }); +chrome.webRequest.onSendHeaders.addListener(details => { + if (details.url && (details.url.indexOf('joinDeliveryGoodsOrderPlatform') != -1)) { + details.requestHeaders.push({ + name: 'Referer', + value: 'https://kuajing.pinduoduo.com/main/order-manage' + }) + for (let i = 0 ; i < details.requestHeaders.length; i++) { + if (details.requestHeaders[i].name == 'Origin') { + details.requestHeaders[i].value = 'https://kuajing.pinduoduo.com' + break; + } + } + } +}, +{urls: [""]},["requestHeaders", "extraHeaders"]); + + function getCookie() { const url = new URL("https://kuajing.pinduoduo.com/"); let cStr = ''; diff --git a/src/manifest.development.json b/src/manifest.development.json index 21f9432..ee3fcfc 100644 --- a/src/manifest.development.json +++ b/src/manifest.development.json @@ -21,8 +21,19 @@ "notifications", "tabs", "scripting", + "webRequest", + "declarativeNetRequest", + "declarativeNetRequestWithHostAccess", + "declarativeNetRequestFeedback", "activeTab" ], + "declarative_net_request": { + "rule_resources": [{ + "id": "1", + "enabled": true, + "path": "rules_1.json" + }] + }, "content_scripts": [ { "matches": [ diff --git a/src/manifest.production.json b/src/manifest.production.json index 63e97c0..245a82c 100644 --- a/src/manifest.production.json +++ b/src/manifest.production.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "TEMU助手", "description": "TEMU助手 - 自动化提高生产效率", - "version": "2.1.0", + "version": "2.2.0", "background": { "service_worker": "/background.js" }, @@ -18,7 +18,11 @@ ], "permissions": [ "cookies", - "notifications" + "notifications", + "declarativeNetRequest", + "declarativeNetRequestWithHostAccess", + "declarativeNetRequestFeedback", + "webRequest" ], "content_scripts": [ { diff --git a/src/router/index.js b/src/router/index.js index ba92718..a730ea0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -28,23 +28,37 @@ const router = new VueRouter({ { path: 'normalSendGoods', name: 'NormalSendGoods', - component: () => import('../view/NormalSendGoods.vue') + component: () => import('../view/shipping/NormalSendGoods.vue') }, + { + path: 'shippingList', + name: 'shippingList', + component: () => import('../view/shipping/ShippingList.vue') + }, + { + path: 'waitShippingList', + name: 'waitShippingList', + component: () => import('../view/shipping/WaitShippingList.vue') + }, + + { + path: 'copyProduct', + name: 'copyProduct', + component: () => import('../view/product/CopyProduct.vue') + }, + { path: 'message', name: 'message', component: () => import('../view/Message.vue') }, - { - path: 'copyProduct', - name: 'copyProduct', - component: () => import('../view/CopyProduct.vue') - }, + { path: 'saleData', name: 'saleData', component: () => import('../view/ExportSaleData.vue') }, + // { // path: 'statistics', // name: 'statistics', diff --git a/src/utils/date.js b/src/utils/date.js index 8ff399b..6dace26 100644 --- a/src/utils/date.js +++ b/src/utils/date.js @@ -12,3 +12,13 @@ export function timestampToTime(timestamp) { let s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()); return Y + M + D + h + m + s; } + +export function formatDate(date) { + let Y = date.getFullYear() + "-"; + let M = + (date.getMonth() + 1 < 10 + ? "0" + (date.getMonth() + 1) + : date.getMonth() + 1) + "-"; + let D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()); + return Y + M + D; +} diff --git a/src/view/ExportSaleData.vue b/src/view/ExportSaleData.vue index 6933048..c1e121f 100644 --- a/src/view/ExportSaleData.vue +++ b/src/view/ExportSaleData.vue @@ -8,7 +8,7 @@
- + - + + diff --git a/src/view/shipping/WaitShippingList.vue b/src/view/shipping/WaitShippingList.vue new file mode 100644 index 0000000..b65aaf3 --- /dev/null +++ b/src/view/shipping/WaitShippingList.vue @@ -0,0 +1,250 @@ + + + + +