diff --git a/src/common/modules.js b/src/common/modules.js index 44afe1a5..c7ecb0f1 100644 --- a/src/common/modules.js +++ b/src/common/modules.js @@ -242,7 +242,7 @@ export const wxwork = { injectJWeixin({state, commit, rootState}, apis) { const inject = (jsApiList) => new Promise((resolve, reject) => { jsApiList = jsApiList || [] - if (timer.injectJWeixin) {//节流设置,50ms内的多次请求合并到一处 + if (timer.injectJWeixin) {//节流设置,500ms内的多次请求合并到一处 clearTimeout(timer.injectJWeixin) jsApiList = [...new Set([...state.apiList, ...jsApiList])] commit("setApiList", jsApiList) @@ -257,7 +257,7 @@ export const wxwork = { reject(err) } }) - }, 50) + }, 500) }) return inject([apis].flat().filter(Boolean)) }, @@ -356,10 +356,10 @@ export const wxwork = { window?.WWOpenData?.checkSession({ success: () => init(), fail: () => { - dispatch('agentSign', params).then(() => dispatch("injectJWeixin")).then(() => init()) + dispatch('agentSign', params).then(() => dispatch("injectJWeixin", "initWwOpenData")).then(() => init()) } }) - }, 50) + }, 500) } else if (count > 10) { console.log("无法获取WWOpenData") } else { @@ -368,7 +368,7 @@ export const wxwork = { }, 200) } } - dispatch('agentSign', params).then(() => dispatch("injectJWeixin")).then(() => loadSdk()) + dispatch('agentSign', params).then(() => dispatch("injectJWeixin", "initWwOpenData")).then(() => loadSdk()) }, bindElements() { const nodes = document.querySelectorAll('.AiOpenData')