This commit is contained in:
刘仕伟
2024-02-23 10:29:39 +08:00
parent cd08530b62
commit 8e87162e94
15 changed files with 81 additions and 30 deletions

View File

@@ -8,17 +8,17 @@
{ {
"header": "Origin", "header": "Origin",
"operation": "set", "operation": "set",
"value": "https://kuajing.pinduoduo.com" "value": "https://seller.kuajingmaihuo.com"
}, },
{ {
"header": "Referer", "header": "Referer",
"operation": "set", "operation": "set",
"value": "https://kuajing.pinduoduo.com/main/order-manage" "value": "https://seller.kuajingmaihuo.com/main/order-manage"
} }
] ]
}, },
"condition": { "condition": {
"urlFilter": "||kuajing.pinduoduo.com" "urlFilter": "||seller.kuajingmaihuo.com"
} }
} }
] ]

View File

@@ -1,6 +1,6 @@
[ [
{ {
"id": 12, "id": 13,
"priority": 1, "priority": 1,
"action": { "action": {
"type": "modifyHeaders", "type": "modifyHeaders",

View File

@@ -1,6 +1,6 @@
[ [
{ {
"id": 12, "id": 14,
"priority": 1, "priority": 1,
"action": { "action": {
"type": "modifyHeaders", "type": "modifyHeaders",

View File

@@ -1,6 +1,6 @@
[ [
{ {
"id": 12, "id": 15,
"priority": 1, "priority": 1,
"action": { "action": {
"type": "modifyHeaders", "type": "modifyHeaders",
@@ -8,17 +8,17 @@
{ {
"header": "Origin", "header": "Origin",
"operation": "set", "operation": "set",
"value": "https://kuajing.pinduoduo.com" "value": "https://seller.kuajingmaihuo.com"
}, },
{ {
"header": "Referer", "header": "Referer",
"operation": "set", "operation": "set",
"value": "https://kuajing.pinduoduo.com" "value": "https://seller.kuajingmaihuo.com"
} }
] ]
}, },
"condition": { "condition": {
"urlFilter": "||kuajing-file.pinduoduo.com" "urlFilter": "||file.kuajingmaihuo.com"
} }
} }
] ]

View File

@@ -8,7 +8,7 @@ import {genAnti} from "@/api/genAnti";
export async function sendChromeAPIMessage(message) { export async function sendChromeAPIMessage(message) {
message.type = 'api' message.type = 'api'
if (!message.url.startsWith('http')) { 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 message.anti = message.anti || false
if (message.needMallId) { if (message.needMallId) {

View File

@@ -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) return o()()["messagePackSync"](url)
} }
module.exports = {gen_anti_content} module.exports = {gen_anti_content}

View File

@@ -53133,7 +53133,7 @@ export default[function(e, t, r) {
)) ))
} }
, r = new XMLHttpRequest; , 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.setRequestHeader("Content-type", "application/json; charset=utf-8"),
r.withCredentials = !0, r.withCredentials = !0,
r.onreadystatechange = function() { r.onreadystatechange = function() {

View File

@@ -168,21 +168,21 @@ chrome.action.onClicked.addListener(function () {
chrome.webRequest.onSendHeaders.addListener(details => { chrome.webRequest.onSendHeaders.addListener(details => {
if (details.url && (details.url.indexOf('joinDeliveryGoodsOrderPlatform') != -1)) { if (details.url && (details.url.indexOf('joinDeliveryGoodsOrderPlatform') != -1)) {
details.requestHeaders.push({ 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++) { for (let i = 0; i < details.requestHeaders.length; i++) {
if (details.requestHeaders[i].name == 'Origin') { if (details.requestHeaders[i].name == 'Origin') {
details.requestHeaders[i].value = 'https://kuajing.pinduoduo.com' details.requestHeaders[i].value = 'https://seller.kuajingmaihuo.com'
break; break;
} }
} }
} else if (details.url && (details.url.indexOf('mms/userInfo') != -1)) { } else if (details.url && (details.url.indexOf('mms/userInfo') != -1)) {
details.requestHeaders.push({ 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++) { for (let i = 0; i < details.requestHeaders.length; i++) {
if (details.requestHeaders[i].name == 'Origin') { if (details.requestHeaders[i].name == 'Origin') {
details.requestHeaders[i].value = 'https://kuajing.pinduoduo.com' details.requestHeaders[i].value = 'https://seller.kuajingmaihuo.com'
break; break;
} }
} }
@@ -191,7 +191,7 @@ chrome.webRequest.onSendHeaders.addListener(details => {
function getCookie() { function getCookie() {
const url = new URL("https://kuajing.pinduoduo.com/"); const url = new URL("https://seller.kuajingmaihuo.com/");
let cStr = ''; let cStr = '';
chrome.cookies.getAll({domain: url.host}, (cookie) => { chrome.cookies.getAll({domain: url.host}, (cookie) => {
cookie.map((c) => { cookie.map((c) => {

View File

@@ -17,7 +17,7 @@ var relativeTime = require('dayjs/plugin/relativeTime')
require('dayjs/locale/zh-cn') require('dayjs/locale/zh-cn')
dayjs.extend(relativeTime) dayjs.extend(relativeTime)
Vue.prototype.$dayjs = dayjs 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]) Object.keys(utils).forEach(v => Vue.prototype[`$${v}`] = utils[v])
Vue.prototype.$http = instance Vue.prototype.$http = instance

View File

@@ -15,7 +15,7 @@
}, },
"host_permissions": [ "host_permissions": [
"*://*.jjcp52.com/", "*://*.jjcp52.com/",
"*://*.pinduoduo.com/", "*://*.kuajingmaihuo.com/",
"*://*.temu.com/", "*://*.temu.com/",
"*://*.aliexpress.com/", "*://*.aliexpress.com/",
"*://*.alicdn.com/", "*://*.alicdn.com/",

View File

@@ -2,7 +2,7 @@
"manifest_version": 3, "manifest_version": 3,
"name": "TEMU助手", "name": "TEMU助手",
"description": "TEMU助手 - 自动化提高生产效率", "description": "TEMU助手 - 自动化提高生产效率",
"version": "3.1.9", "version": "3.1.11",
"background": { "background": {
"service_worker": "/background.js" "service_worker": "/background.js"
}, },
@@ -15,7 +15,7 @@
}, },
"host_permissions": [ "host_permissions": [
"*://*.jjcp52.com/", "*://*.jjcp52.com/",
"*://*.pinduoduo.com/", "*://*.kuajingmaihuo.com/",
"*://*.temu.com/", "*://*.temu.com/",
"*://*.aliexpress.com/", "*://*.aliexpress.com/",
"*://*.alicdn.com/", "*://*.alicdn.com/",

View File

@@ -50,7 +50,7 @@ export async function uploadImage(folderId, imageUrl, mallId) {
}) })
let res4 = await sendChromeAPIMessage({ 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, isFormData: true,
data: { data: {
url_width_height: true, url_width_height: true,

View File

@@ -109,7 +109,7 @@ export function transform(leftData) {
rightData.productWhExtAttrReq = { rightData.productWhExtAttrReq = {
outerGoodsUrl: leftData.productWhExtAttr.outerGoodsUrl, outerGoodsUrl: leftData.productWhExtAttr.outerGoodsUrl,
productOrigin: { productOrigin: {
countryShortName: leftData.productWhExtAttr.productOrigin.countryShortName countryShortName: leftData.productWhExtAttr.productOrigin ? leftData.productWhExtAttr.productOrigin.countryShortName: 'CN'
} }
}; };
rightData.productCarouseVideoReqList = leftData.carouseVideoVOList; rightData.productCarouseVideoReqList = leftData.carouseVideoVOList;

View File

@@ -116,7 +116,7 @@
@close="handleClose"> @close="handleClose">
<el-form class="ai-form" :model="form" label-width="160px" ref="form"> <el-form class="ai-form" :model="form" label-width="160px" ref="form">
<el-form-item label="店铺" style="width: 100%;" prop="targetMallId" :rules="[{ required: true, message: '请选择店铺', trigger: 'blur' }]"> <el-form-item label="店铺" style="width: 100%;" prop="targetMallId" :rules="[{ required: true, message: '请选择店铺', trigger: 'blur' }]">
<el-select style="width: 380px" v-model="form.targetMallId" placeholder="请选择"> <el-select style="width: 380px" v-model="form.targetMallId" @change="onMallChange" placeholder="请选择">
<el-option <el-option
v-for="item in $store.state.mallList" v-for="item in $store.state.mallList"
:key="item.mallId" :key="item.mallId"
@@ -125,6 +125,16 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="form.isSemi" label="经营站点" style="width: 100%;" prop="siteId" :rules="[{ required: true, message: '请选择经营站点', trigger: 'blur' }]">
<el-select style="width: 380px" multiple v-model="form.siteId" placeholder="请选择">
<el-option
v-for="item in siteList"
:key="item.siteId"
:label="item.siteName"
:value="item.siteId">
</el-option>
</el-select>
</el-form-item>
<el-form-item <el-form-item
prop="isSameCategory" prop="isSameCategory"
label="是否保持相同类目:" label="是否保持相同类目:"
@@ -246,13 +256,17 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
form: { form: {
targetMallId: '', targetMallId: '',
targetCatId: [], targetCatId: [],
isSameCategory: true isSemi: false,
} isSameCategory: true,
siteId: []
},
siteList: []
} }
}, },
created () { created () {
this.getList() this.getList()
this.getSiteList()
if (this.$store.state.mallList.length > 0) { if (this.$store.state.mallList.length > 0) {
this.productPage.mallId = this.$store.state.mallList[0].mallId this.productPage.mallId = this.$store.state.mallList[0].mallId
} }
@@ -269,6 +283,34 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
this.total = res.data.total 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 () { remove () {
if (this.ids.length <= 0) { if (this.ids.length <= 0) {
alert('请选择要删除的商品'); alert('请选择要删除的商品');
@@ -495,14 +537,18 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
} else { } else {
category = this.form.targetCatId[this.form.targetCatId.length - 1] category = this.form.targetCatId[this.form.targetCatId.length - 1]
} }
let data = {catId: category}
if (this.form.isSemi) {
data.productSemiManagedReq = {
bindSiteIds: this.form.siteId
}
}
setTimeout(() => { setTimeout(() => {
sendChromeAPIMessage({ sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/add', url: 'bg-visage-mms/product/draft/add',
needMallId: true, needMallId: true,
mallId: this.form.targetMallId, mallId: this.form.targetMallId,
data: { data: data}).then((res) => {
catId: category
}}).then((res) => {
if (res.errorCode == 1000000) { if (res.errorCode == 1000000) {
let draftId = res.result.productDraftId let draftId = res.result.productDraftId
if (!this.form.isSameCategory) { if (!this.form.isSameCategory) {
@@ -515,6 +561,11 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
} }
} }
content.productDraftId = draftId content.productDraftId = draftId
if (this.form.isSemi) {
content.productSemiManagedReq = {
bindSiteIds: this.form.siteId
}
}
sendChromeAPIMessage({ sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/save', url: 'bg-visage-mms/product/draft/save',
needMallId: true, needMallId: true,

View File

@@ -715,7 +715,7 @@
sn: res.result.errorInfoList[0].id, sn: res.result.errorInfoList[0].id,
errorMsg: res.result.errorInfoList[0].errorMsg, errorMsg: res.result.errorInfoList[0].errorMsg,
mallName: mallName, mallName: mallName,
url: res.result.errorInfoList[0].extraInfoMap?.url url: 'https://agentseller.temu.com' + res.result.errorInfoList[0].extraInfoMap?.url
}) })
} }
} }