From 9eb23ff8903f76fdd11eba913d28d4083af932b4 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 27 Jan 2022 16:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E5=8A=A0CorpId=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index d98e6bde..28e46387 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -63,11 +63,11 @@ const store = new Vuex.Store({ }, redirectCode(state, url = location.href) { let REDIRECT_URI = encodeURIComponent(url), - corpid = state.corpId + corpid = state.corpId const redirectTo = cid => { location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base#wechat_redirect' - .replace(/CORPID/g, cid) - .replace(/REDIRECT_URI/g, REDIRECT_URI) + .replace(/CORPID/g, cid) + .replace(/REDIRECT_URI/g, REDIRECT_URI) } if (corpid) { redirectTo(corpid) @@ -227,16 +227,16 @@ const store = new Vuex.Store({ }) } else { return http.post("/app/wxcp/wxuser/getUserInfoByToken") - .then(res => { - if (res?.code == 0) { - state.commit("setOpenUser", res.data) - } - }) + .then(res => { + if (res?.code == 0) { + state.commit("setOpenUser", res.data) + } + }) } }, agentSign(state, params) { let url = window.location.href, - {corpId, suiteId} = state.state.config + {corpId, suiteId} = state.state.config if (agentSignURL == url) { return Promise.resolve() } else { @@ -249,7 +249,7 @@ const store = new Vuex.Store({ params = params || {corpId, suiteId} } return http.post("/app/wxcp/portal/agentSign", null, { - params: {...params, url} + params: {corpId: "ww596787bb70f08288", ...params, url} }).then(res => { if (res?.data) { let config = { @@ -373,7 +373,7 @@ const store = new Vuex.Store({ } }) }, 300) - }).catch(e => { + }).catch(() => { reject('error') }) })