From 8e87162e9437c91d948b58005a1db70e965393e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BB=95=E4=BC=9F?= <499672082@qq.com> Date: Fri, 23 Feb 2024 10:29:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/rules_1.json | 6 +-- public/rules_2.json | 2 +- public/rules_3.json | 2 +- public/rules_4.json | 8 ++-- src/api/chromeApi.js | 2 +- src/api/cnPdd.js | 2 +- src/api/pddjs.js | 2 +- src/entry/background.js | 10 ++--- src/entry/popup.js | 2 +- src/manifest.development.json | 2 +- src/manifest.production.json | 4 +- src/utils/image.js | 2 +- src/utils/product.js | 2 +- src/view/product/CopyProduct.vue | 63 ++++++++++++++++++++++++--- src/view/shipping/NormalSendGoods.vue | 2 +- 15 files changed, 81 insertions(+), 30 deletions(-) diff --git a/public/rules_1.json b/public/rules_1.json index a6009ad..3cbf1a4 100644 --- a/public/rules_1.json +++ b/public/rules_1.json @@ -8,17 +8,17 @@ { "header": "Origin", "operation": "set", - "value": "https://kuajing.pinduoduo.com" + "value": "https://seller.kuajingmaihuo.com" }, { "header": "Referer", "operation": "set", - "value": "https://kuajing.pinduoduo.com/main/order-manage" + "value": "https://seller.kuajingmaihuo.com/main/order-manage" } ] }, "condition": { - "urlFilter": "||kuajing.pinduoduo.com" + "urlFilter": "||seller.kuajingmaihuo.com" } } ] \ No newline at end of file diff --git a/public/rules_2.json b/public/rules_2.json index 7eec281..885b473 100644 --- a/public/rules_2.json +++ b/public/rules_2.json @@ -1,6 +1,6 @@ [ { - "id": 12, + "id": 13, "priority": 1, "action": { "type": "modifyHeaders", diff --git a/public/rules_3.json b/public/rules_3.json index cd069df..bb191dd 100644 --- a/public/rules_3.json +++ b/public/rules_3.json @@ -1,6 +1,6 @@ [ { - "id": 12, + "id": 14, "priority": 1, "action": { "type": "modifyHeaders", diff --git a/public/rules_4.json b/public/rules_4.json index 4b48258..aeeef5f 100644 --- a/public/rules_4.json +++ b/public/rules_4.json @@ -1,6 +1,6 @@ [ { - "id": 12, + "id": 15, "priority": 1, "action": { "type": "modifyHeaders", @@ -8,17 +8,17 @@ { "header": "Origin", "operation": "set", - "value": "https://kuajing.pinduoduo.com" + "value": "https://seller.kuajingmaihuo.com" }, { "header": "Referer", "operation": "set", - "value": "https://kuajing.pinduoduo.com" + "value": "https://seller.kuajingmaihuo.com" } ] }, "condition": { - "urlFilter": "||kuajing-file.pinduoduo.com" + "urlFilter": "||file.kuajingmaihuo.com" } } ] \ No newline at end of file diff --git a/src/api/chromeApi.js b/src/api/chromeApi.js index 7ac06d3..d79c3d2 100644 --- a/src/api/chromeApi.js +++ b/src/api/chromeApi.js @@ -8,7 +8,7 @@ import {genAnti} from "@/api/genAnti"; export async function sendChromeAPIMessage(message) { message.type = 'api' if (!message.url.startsWith('http')) { - message.url = "https://kuajing.pinduoduo.com/" + message.url; + message.url = "https://seller.kuajingmaihuo.com/" + message.url; } message.anti = message.anti || false if (message.needMallId) { diff --git a/src/api/cnPdd.js b/src/api/cnPdd.js index 59da800..17ca736 100644 --- a/src/api/cnPdd.js +++ b/src/api/cnPdd.js @@ -2868,7 +2868,7 @@ const o = function() { ]) }; -const gen_anti_content = (url="https://kuajing.pinduoduo.com/main/order-manager/shipping-desk")=>{ +const gen_anti_content = (url="https://seller.kuajingmaihuo.com/main/order-manager/shipping-desk")=>{ return o()()["messagePackSync"](url) } module.exports = {gen_anti_content} diff --git a/src/api/pddjs.js b/src/api/pddjs.js index a3b8329..38a749e 100644 --- a/src/api/pddjs.js +++ b/src/api/pddjs.js @@ -53133,7 +53133,7 @@ export default[function(e, t, r) { )) } , r = new XMLHttpRequest; - r.open("GET", "https://kuajing.pinduoduo.com/api/server/_stm", !0), + r.open("GET", "https://seller.kuajingmaihuo.com/api/server/_stm", !0), r.setRequestHeader("Content-type", "application/json; charset=utf-8"), r.withCredentials = !0, r.onreadystatechange = function() { diff --git a/src/entry/background.js b/src/entry/background.js index 67e0391..0c0146b 100644 --- a/src/entry/background.js +++ b/src/entry/background.js @@ -168,21 +168,21 @@ 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' + name: 'Referer', value: 'https://seller.kuajingmaihuo.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' + details.requestHeaders[i].value = 'https://seller.kuajingmaihuo.com' break; } } } else if (details.url && (details.url.indexOf('mms/userInfo') != -1)) { details.requestHeaders.push({ - name: 'Referer', value: 'https://kuajing.pinduoduo.com/main/order-manage' + name: 'Referer', value: 'https://seller.kuajingmaihuo.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' + details.requestHeaders[i].value = 'https://seller.kuajingmaihuo.com' break; } } @@ -191,7 +191,7 @@ chrome.webRequest.onSendHeaders.addListener(details => { function getCookie() { - const url = new URL("https://kuajing.pinduoduo.com/"); + const url = new URL("https://seller.kuajingmaihuo.com/"); let cStr = ''; chrome.cookies.getAll({domain: url.host}, (cookie) => { cookie.map((c) => { diff --git a/src/entry/popup.js b/src/entry/popup.js index 7aa9b70..8216849 100644 --- a/src/entry/popup.js +++ b/src/entry/popup.js @@ -17,7 +17,7 @@ var relativeTime = require('dayjs/plugin/relativeTime') require('dayjs/locale/zh-cn') dayjs.extend(relativeTime) Vue.prototype.$dayjs = dayjs -Vue.prototype.$base = "https://kuajing.pinduoduo.com" +Vue.prototype.$base = "https://seller.kuajingmaihuo.com" Object.keys(utils).forEach(v => Vue.prototype[`$${v}`] = utils[v]) Vue.prototype.$http = instance diff --git a/src/manifest.development.json b/src/manifest.development.json index 91b1a22..33a5f28 100644 --- a/src/manifest.development.json +++ b/src/manifest.development.json @@ -15,7 +15,7 @@ }, "host_permissions": [ "*://*.jjcp52.com/", - "*://*.pinduoduo.com/", + "*://*.kuajingmaihuo.com/", "*://*.temu.com/", "*://*.aliexpress.com/", "*://*.alicdn.com/", diff --git a/src/manifest.production.json b/src/manifest.production.json index bc297e6..30862a0 100644 --- a/src/manifest.production.json +++ b/src/manifest.production.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "TEMU助手", "description": "TEMU助手 - 自动化提高生产效率", - "version": "3.1.9", + "version": "3.1.11", "background": { "service_worker": "/background.js" }, @@ -15,7 +15,7 @@ }, "host_permissions": [ "*://*.jjcp52.com/", - "*://*.pinduoduo.com/", + "*://*.kuajingmaihuo.com/", "*://*.temu.com/", "*://*.aliexpress.com/", "*://*.alicdn.com/", diff --git a/src/utils/image.js b/src/utils/image.js index 4a1941b..d7d2d50 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -50,7 +50,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { }) let res4 = await sendChromeAPIMessage({ - url: 'https://kuajing-file.pinduoduo.com/api/galerie/v3/store_image?sdk_version=js-0.0.16-alpha.0&tag_name=product-material-tag', + url: 'https://file.kuajingmaihuo.com/api/galerie/v3/store_image?sdk_version=js-0.0.16-alpha.0&tag_name=product-material-tag', isFormData: true, data: { url_width_height: true, diff --git a/src/utils/product.js b/src/utils/product.js index 080b538..76978ab 100644 --- a/src/utils/product.js +++ b/src/utils/product.js @@ -109,7 +109,7 @@ export function transform(leftData) { rightData.productWhExtAttrReq = { outerGoodsUrl: leftData.productWhExtAttr.outerGoodsUrl, productOrigin: { - countryShortName: leftData.productWhExtAttr.productOrigin.countryShortName + countryShortName: leftData.productWhExtAttr.productOrigin ? leftData.productWhExtAttr.productOrigin.countryShortName: 'CN' } }; rightData.productCarouseVideoReqList = leftData.carouseVideoVOList; diff --git a/src/view/product/CopyProduct.vue b/src/view/product/CopyProduct.vue index 6bfb430..cb15b4c 100644 --- a/src/view/product/CopyProduct.vue +++ b/src/view/product/CopyProduct.vue @@ -116,7 +116,7 @@ @close="handleClose"> - + + + + + + + 0) { this.productPage.mallId = this.$store.state.mallList[0].mallId } @@ -269,6 +283,34 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue" this.total = res.data.total }) }, + getSiteList() { + sendChromeAPIMessage({ + url: 'bg-visage-mms/config/common/site/query', + needMallId: true, + mallId: this.productPage.mallId, + data: {}}).then((res) => { + if (res.success) { + this.siteList = res.result.siteBaseList.filter(item => { + return item.matchSemiManaged + }) + } + }) + }, + onMallChange() { + if (!this.form.targetMallId) { + Message.error("请先选择店铺") + return + } + let tempMall = this.$store.state.mallList.filter(item => { + return item.mallId == this.form.targetMallId + }) + if (null == tempMall || tempMall.length == 0) { + Message.error("请先选择店铺") + return + } else { + this.form.isSemi = tempMall[0].isSemiManagedMall + } + }, remove () { if (this.ids.length <= 0) { alert('请选择要删除的商品'); @@ -495,14 +537,18 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue" } else { category = this.form.targetCatId[this.form.targetCatId.length - 1] } + let data = {catId: category} + if (this.form.isSemi) { + data.productSemiManagedReq = { + bindSiteIds: this.form.siteId + } + } setTimeout(() => { sendChromeAPIMessage({ url: 'bg-visage-mms/product/draft/add', needMallId: true, mallId: this.form.targetMallId, - data: { - catId: category - }}).then((res) => { + data: data}).then((res) => { if (res.errorCode == 1000000) { let draftId = res.result.productDraftId if (!this.form.isSameCategory) { @@ -515,6 +561,11 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue" } } content.productDraftId = draftId + if (this.form.isSemi) { + content.productSemiManagedReq = { + bindSiteIds: this.form.siteId + } + } sendChromeAPIMessage({ url: 'bg-visage-mms/product/draft/save', needMallId: true, diff --git a/src/view/shipping/NormalSendGoods.vue b/src/view/shipping/NormalSendGoods.vue index c7470ef..acc03f2 100644 --- a/src/view/shipping/NormalSendGoods.vue +++ b/src/view/shipping/NormalSendGoods.vue @@ -715,7 +715,7 @@ sn: res.result.errorInfoList[0].id, errorMsg: res.result.errorInfoList[0].errorMsg, mallName: mallName, - url: res.result.errorInfoList[0].extraInfoMap?.url + url: 'https://agentseller.temu.com' + res.result.errorInfoList[0].extraInfoMap?.url }) } }