Commit f079fd08 authored by 刘燕芳's avatar 刘燕芳

save

parent ec413ab4
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"*://myseller.taobao.com/*", "*://myseller.taobao.com/*",
"*://admin.rtxmdz.com/*", "*://admin.rtxmdz.com/*",
"http://localhost:10823/*", "http://localhost:10823/*",
"http://localhost:64032/*", "http://localhost:*/*",
"*://*.rtxmdz.com/*", "*://*.rtxmdz.com/*",
"https://item.upload.taobao.com/*", "https://item.upload.taobao.com/*",
"https://sell.publish.tmall.com/*" "https://sell.publish.tmall.com/*"
......
...@@ -46,6 +46,8 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) { ...@@ -46,6 +46,8 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
url: tbIssueUrls, url: tbIssueUrls,
}, },
function (tabs) { function (tabs) {
console.log('如果图动力登录的账号和千牛云登录的账号不一致,则popup页面爆红tabs',tabs);
// 如果图动力登录的账号和千牛云登录的账号不一致,则popup页面爆红 // 如果图动力登录的账号和千牛云登录的账号不一致,则popup页面爆红
tabs &&tabs.forEach((tab) => { tabs &&tabs.forEach((tab) => {
// chrome.tabs.update(tab.id!,{ active: true },function (tab1) {}) // chrome.tabs.update(tab.id!,{ active: true },function (tab1) {})
...@@ -123,13 +125,12 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => { ...@@ -123,13 +125,12 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
// let cnaui: any = await getCookies('https://*.mmstat.com', 'cnaui') // let cnaui: any = await getCookies('https://*.mmstat.com', 'cnaui')
// console.log('cookie', 'https://.mmstat.com', cnaui.value) // console.log('cookie', 'https://.mmstat.com', cnaui.value)
// userId = cnaui.value // userId = cnaui.value
// taIssueId&&chrome.tabs.remove(taIssueId)
chrome.tabs.query( chrome.tabs.query(
{ {
url: [tbIssueUrl], url: [tbIssueUrl],
}, },
async function (tabs) { async function (tabs) {
console.log('tabs', tabs) console.log('tabs', tabs,tab)
let complete_tabs: any = [] let complete_tabs: any = []
if (tabs.length) { if (tabs.length) {
complete_tabs = tabs.filter((item) => item.status === 'complete') complete_tabs = tabs.filter((item) => item.status === 'complete')
...@@ -140,7 +141,6 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => { ...@@ -140,7 +141,6 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
} }
} }
) )
let tuDe1 = decodeURI(userNickCookie.value) let tuDe1 = decodeURI(userNickCookie.value)
let tuDe2 = unescape(tuDe1.replace(/\\(u[0-9a-fA-F]{4})/gm, '%$1')) let tuDe2 = unescape(tuDe1.replace(/\\(u[0-9a-fA-F]{4})/gm, '%$1'))
if (tuDe2.indexOf(':') != -1) tuDe2 = tuDe2.split(':')[0] if (tuDe2.indexOf(':') != -1) tuDe2 = tuDe2.split(':')[0]
......
...@@ -58,10 +58,10 @@ async function booking(info: any) { ...@@ -58,10 +58,10 @@ async function booking(info: any) {
let msg = JSON.stringify(rJson.models); let msg = JSON.stringify(rJson.models);
reqMsg.msg = msg; reqMsg.msg = msg;
} }
// else { else {
// let numIid = getUrlParam(rSuccessUrl, "primaryId"); let numIid = getUrlParam(rSuccessUrl, "primaryId");
// reqMsg.goods_id = numIid; reqMsg.msg = numIid;
// } }
} }
return reqMsg return reqMsg
} catch (e) { } catch (e) {
......
...@@ -15,15 +15,16 @@ interface Message { ...@@ -15,15 +15,16 @@ interface Message {
value: Params value: Params
} }
// web页面通信 // web页面通信
let task_id:any = null
window.addEventListener("message",function(message:any){ window.addEventListener("message",function(message:any){
// console.log('web页面通信1',message,new Date()); // console.log('web页面通信1',message,new Date());
if(message.data.action == ACTION.task){ if(message.data.action == ACTION.task){
window.postMessage({isResult:2},"*") window.postMessage({isResult:2},"*")
task_id = message.data.value.task_id
chrome.runtime.sendMessage(message.data,(ret)=>{ chrome.runtime.sendMessage(message.data,(ret)=>{
// console.log(2222,ret,new Date().getTime(),new Date().getSeconds()); // console.log(2222,ret,new Date().getTime(),new Date().getSeconds());
window.postMessage({isResult:1,...ret},"*") window.postMessage({isResult:1,task_id:task_id,...ret},"*")
console.log("message ret:1",ret,message.data); console.log("message ret:1",task_id,ret,message.data);
}) })
} }
}) })
......
...@@ -116,7 +116,7 @@ const WayBillModel = function () { ...@@ -116,7 +116,7 @@ const WayBillModel = function () {
<div className="waybill-model-title" key="two">通信状态:{link?'连接成功':'连接中断'}</div> <div className="waybill-model-title" key="two">通信状态:{link?'连接成功':'连接中断'}</div>
<div className="waybill-model-title tips">{info}</div> <div className="waybill-model-title tips">{info}</div>
</div> </div>
{/* <Button className="btn" type="primary" loading={loading} disabled={loading} onClick={ refresh }>刷新连接状态</Button> */} <Button className="btn" type="primary" loading={loading} disabled={loading} onClick={ refresh }>刷新连接状态</Button>
</> </>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment