|
@@ -19,6 +19,7 @@ const config = {
|
|
};
|
|
};
|
|
|
|
|
|
const fixedPath = `/api/corpWXAuth`; // 授权回调页面 (需要拼接)
|
|
const fixedPath = `/api/corpWXAuth`; // 授权回调页面 (需要拼接)
|
|
|
|
+const fixedPathAgentId = `/api/corpInsideWXAuth`
|
|
|
|
|
|
export function obtainCorrespondingConfigurationInformation() {
|
|
export function obtainCorrespondingConfigurationInformation() {
|
|
const hostname = window.location.hostname; // 获取域名和端口,(不包括http 和 https)
|
|
const hostname = window.location.hostname; // 获取域名和端口,(不包括http 和 https)
|
|
@@ -26,8 +27,9 @@ export function obtainCorrespondingConfigurationInformation() {
|
|
const agentId = row.agentId;
|
|
const agentId = row.agentId;
|
|
const appId = row.appId;
|
|
const appId = row.appId;
|
|
const tokenUrl = `${row.path}${fixedPath}`;
|
|
const tokenUrl = `${row.path}${fixedPath}`;
|
|
|
|
+ const tokenUrlAgentId = `${row.path}${fixedPathAgentId}`;
|
|
const authorizationCallback = agentId
|
|
const authorizationCallback = agentId
|
|
- ? `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(tokenUrl)}&response_type=code&scope=snsapi_base&state=STATE&agentid=${agentId}#wechat_redirect`
|
|
|
|
|
|
+ ? `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(tokenUrlAgentId)}&response_type=code&scope=snsapi_base&state=index&agentid=${agentId}#wechat_redirect`
|
|
: `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(tokenUrl)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
|
|
: `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURI(tokenUrl)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
|
|
return {
|
|
return {
|
|
appId,
|
|
appId,
|