Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ruitu-fahuoyi-exension
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖健文
ruitu-fahuoyi-exension
Commits
b83f92d1
Commit
b83f92d1
authored
Mar 20, 2024
by
刘燕芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
22d1556d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
dist.crx
dist.crx
+0
-0
manifest.json
manifest.json
+1
-2
index.ts
src/background/index.ts
+8
-1
bookingV2.ts
src/content/bookingV2.ts
+4
-4
No files found.
dist.crx
View file @
b83f92d1
No preview for this file type
manifest.json
View file @
b83f92d1
...
...
@@ -30,8 +30,7 @@
"http://localhost:10823/*"
,
"*://*.rtxmdz.com/*"
,
"https://item.upload.taobao.com/*"
,
"http://*/*"
,
"https://*/*"
"https://sell.publish.tmall.com/*"
],
"js"
:
[
"content.js"
],
"run_at"
:
"document_idle"
...
...
src/background/index.ts
View file @
b83f92d1
...
...
@@ -13,6 +13,7 @@ let monitoringRemoveTabId = new Map();
let
result_sendResponse
:
boolean
=
false
let
tb_user
:
any
=
{}
let
taIssueId
:
any
=
null
let
userId
:
any
=
null
chrome
.
runtime
.
onMessage
.
addListener
(
function
(
message
,
sender
,
sendResponse
)
{
// console.log('message1',message,sender);
if
(
message
.
action
===
ACTION
.
task
)
{
...
...
@@ -25,7 +26,6 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
chrome
.
storage
.
sync
.
remove
(
"info"
)
if
(
message
.
value
.
seller
.
seller_name
!==
tb_user
.
userNick
){
chrome
.
storage
.
sync
.
set
({
"info"
:
'当前登录的千牛账号与图动力授权的账号信息不一致,请统一登录后重试!'
})
console
.
log
(
222
);
sendResponse
({
status
:
-
200
,
task_id
:
message
.
value
.
task_id
,
msg
:
"当前登录的千牛账号与图动力授权的账号信息不一致,请统一登录后重试!"
});
return
true
}
...
...
@@ -89,6 +89,10 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
result_sendResponse
=
true
;
return
};
let
cnaui
:
any
=
await
getCookies
(
'https://*.mmstat.com'
,
'cnaui'
);
// let aui:any = await getCookies(tab.url, "cnaui");
console
.
log
(
'cookie'
,
'https://.mmstat.com'
,
cnaui
.
value
);
userId
=
cnaui
.
value
// taIssueId&&chrome.tabs.remove(taIssueId)
chrome
.
tabs
.
query
({
url
:[
tbIssueUrl
]
...
...
@@ -103,6 +107,7 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
taIssueId
=
await
createTab
(
tbIssueUrl
);
}
})
let
tuDe1
=
decodeURI
(
userNickCookie
.
value
);
let
tuDe2
=
unescape
(
tuDe1
.
replace
(
/
\\(
u
[
0-9a-fA-F
]{4})
/gm
,
'%$1'
));
if
(
tuDe2
.
indexOf
(
":"
)
!=
-
1
)
tuDe2
=
tuDe2
.
split
(
":"
)[
0
];
...
...
@@ -117,10 +122,12 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
let
userNick
:
string
=
monitoringRemoveTabId
.
get
(
tab
.
id
);
console
.
log
(
'monitoringRemoveTabId'
,
monitoringRemoveTabId
);
let
cookie
=
await
getCookieAll
(
tab
.
url
);
// console.log('cookie22',tab.url,cookie);
let
token
:
any
=
await
getCookies
(
tab
.
url
,
"XSRF-TOKEN"
);
let
userData
:
object
=
{
cookie
:
cookie
,
token
:
token
.
value
,
userId
:
userId
,
userNick
:
userNick
,
}
tb_user
=
userData
...
...
src/content/bookingV2.ts
View file @
b83f92d1
...
...
@@ -19,8 +19,9 @@ async function booking(info: any) {
}
let
goodsId
,
result
;
let
userDataJson
:
any
=
JSON
.
parse
(
userData
)
goodsId
=
await
tbGetIssueGoodsIdV2
(
userDataJson
,
goodsData
,
info
.
goods
);
goodsId
=
await
tbGetIssueGoodsIdV2
(
userDataJson
,
goodsData
);
let
goods
=
info
.
goods
.
replaceAll
(
'775011740120'
,
goodsId
)
goods
=
goods
.
replaceAll
(
'88897371'
,
userDataJson
.
userId
)
let
default_info
=
JSON
.
parse
(
goods
)
tbIssueJsonDataV2
=
default_info
result
=
await
tbDataJoinAndIssueV2
(
userDataJson
,
goodsData
,
goodsId
);
...
...
@@ -359,12 +360,11 @@ async function tbDataJoinAndIssueV2(userData:any, goodsData:any, goodsId:number)
* @param {发布的商品信息} goodsData
* @returns
*/
async
function
tbGetIssueGoodsIdV2
(
userData
:
any
,
goodsData
:
any
,
data
:
any
)
{
async
function
tbGetIssueGoodsIdV2
(
userData
:
any
,
goodsData
:
any
)
{
// let goodsModel = goodsData.data.goodsModel;
// let picPath = goodsModel.masterPics[0];
// let userId = goodsData.data.userId;
let
default_info
=
JSON
.
parse
(
data
)
tbEnsureIssueJsonV2
.
userId
=
default_info
.
userId
;
tbEnsureIssueJsonV2
.
userId
=
userData
.
userId
;
tbEnsureIssueJsonV2
.
catImages
=
[{
"url"
:
'https://img.alicdn.com/imgextra/i3/88897371/O1CN01wCaCGh24JyKxMRdkR_!!88897371.jpg_100x100'
}];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment