Commit f5fcf8db by 李伟康

提交代码

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