追加CorpId默认值

This commit is contained in:
aixianling
2022-01-27 16:18:43 +08:00
parent 2ebe93f991
commit 9eb23ff890

View File

@@ -63,11 +63,11 @@ const store = new Vuex.Store({
}, },
redirectCode(state, url = location.href) { redirectCode(state, url = location.href) {
let REDIRECT_URI = encodeURIComponent(url), let REDIRECT_URI = encodeURIComponent(url),
corpid = state.corpId corpid = state.corpId
const redirectTo = cid => { 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' 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(/CORPID/g, cid)
.replace(/REDIRECT_URI/g, REDIRECT_URI) .replace(/REDIRECT_URI/g, REDIRECT_URI)
} }
if (corpid) { if (corpid) {
redirectTo(corpid) redirectTo(corpid)
@@ -227,16 +227,16 @@ const store = new Vuex.Store({
}) })
} else { } else {
return http.post("/app/wxcp/wxuser/getUserInfoByToken") return http.post("/app/wxcp/wxuser/getUserInfoByToken")
.then(res => { .then(res => {
if (res?.code == 0) { if (res?.code == 0) {
state.commit("setOpenUser", res.data) state.commit("setOpenUser", res.data)
} }
}) })
} }
}, },
agentSign(state, params) { agentSign(state, params) {
let url = window.location.href, let url = window.location.href,
{corpId, suiteId} = state.state.config {corpId, suiteId} = state.state.config
if (agentSignURL == url) { if (agentSignURL == url) {
return Promise.resolve() return Promise.resolve()
} else { } else {
@@ -249,7 +249,7 @@ const store = new Vuex.Store({
params = params || {corpId, suiteId} params = params || {corpId, suiteId}
} }
return http.post("/app/wxcp/portal/agentSign", null, { return http.post("/app/wxcp/portal/agentSign", null, {
params: {...params, url} params: {corpId: "ww596787bb70f08288", ...params, url}
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
let config = { let config = {
@@ -373,7 +373,7 @@ const store = new Vuex.Store({
} }
}) })
}, 300) }, 300)
}).catch(e => { }).catch(() => {
reject('error') reject('error')
}) })
}) })