From 77edcc8214e6c91460aa33c15f2995fbe521b083 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 19 Jul 2022 16:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/modules.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/common/modules.js b/src/common/modules.js index 25cb05ab..f4946c84 100644 --- a/src/common/modules.js +++ b/src/common/modules.js @@ -56,7 +56,7 @@ export const config = { }, getCode({state, dispatch}, tryAgentSign = false) { let {corpid: corpId, suiteId, agentid: agentId} = state, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_privateinfo" - if (/\/AppForm\//.test(location.search)) { + if (/\/AppForm\//.test(location.pathname)) { scope = "snsapi_base" } else if (suiteId) { corpId = suiteId @@ -230,6 +230,22 @@ export const user = { */ let apiList = [] export const wxwork = { + state: () => ({ + agentSignURL: "", + apiList: [], + config: {} + }), + mutations: { + setConfig(state, config) { + state.config = config + }, + setAgentSignURL(state, url) { + state.agentSignURL = url + }, + setApiList(state, list) { + state.apiList = list + }, + }, actions: { injectJWeixin({commit, dispatch, rootState}, ops) { const inject = (jsApiList, config = rootState.config) => new Promise((resolve, reject) => {