兼容异常,并给出示例
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
const getSign = (token, appKey, formData) => {
|
||||
token = token.split("_")[0]
|
||||
export const getSign = (token, appKey, formData) => {
|
||||
token = token?.split("_")[0]
|
||||
const t = (new Date()).getTime();
|
||||
return {
|
||||
t, sign: function (e) {
|
||||
@@ -158,3 +158,4 @@ const getSign = (token, appKey, formData) => {
|
||||
}(token + "&" + t + "&" + appKey + "&" + formData)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ export function sendChromeNotification(message) {
|
||||
*/
|
||||
export function sendAliexpressAPIMessage(message) {
|
||||
message.type = 'aliexpress'
|
||||
const {mtopConfig = {appKey: "12574478"}} = window
|
||||
message.appKey = message.appKey || mtopConfig.appKey
|
||||
return new Promise((resolve) => {
|
||||
chrome.runtime.sendMessage(message, resolve)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user