Commit f5fcf8db by 李伟康

提交代码

1 parent cf05e3c8
......@@ -11,7 +11,7 @@ module.exports = {
envVersion: 'trial',
title: '嘀加企微管家',
request: {
baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间
timeout: 180000,
// 携带凭证
......
......@@ -121,11 +121,13 @@ const actions = {
} else {
util.showLoading()
let appid = getParams('corpId') //从链接获取
let agentid = getParams('agentid') //从链接获取
let dj_scrm = util.getLocalStorage('dj_scrm_corpId')
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
if (!appid) {
if (dj_scrm) {
appid = dj_scrm.corpId
agentid = dj_scrm.agentid
} else {
if (IS_PROD) {
Notify({
......@@ -133,12 +135,18 @@ const actions = {
duration: 15000
})
return
} else appid = 'ww7ee69c648ae1b7e6'
} else {
appid = 'ww7ee69c648ae1b7e6'
agentid = 1000003
}
}
}
util.setLocalStorage('dj_scrm_corpId', { corpId: appid })
const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
window.location.href = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
util.setLocalStorage('dj_scrm_corpId', { corpId: appid, agentid })
let wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
wxUrl = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_privateinfo&state=STATE`
if (agentid) wxUrl = `${wxUrl}&agentid=${agentid}`
console.log(`${wxUrl}#wechat_redirect`)
window.location.href = `${wxUrl}#wechat_redirect`
}
},
navigation ({ dispatch }, to) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!