diff --git a/src/common/modules.js b/src/common/modules.js index 520a88a1..674e0d6c 100644 --- a/src/common/modules.js +++ b/src/common/modules.js @@ -59,7 +59,7 @@ export const config = { } }, getCode({state, dispatch}, tryAgentSign = false) { - let {corpId} = state.config, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_base" + let {corpId} = state, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_base" if (/\/AppForm\//.test(location.search)) { scope = "snsapi_userinfo" } @@ -228,8 +228,8 @@ export const user = { let apiList = [] export const wxwork = { actions: { - injectJWeixin({commit, dispatch, state}, ops) { - const inject = (jsApiList, config = state.config) => new Promise((resolve, reject) => { + injectJWeixin({commit, dispatch, rootState}, ops) { + const inject = (jsApiList, config = rootState.config) => new Promise((resolve, reject) => { setTimeout(() => { let sdk = wx?.agentConfig ? wx : jWeixin sdk?.agentConfig({