追加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) {
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')
})
})