From bbe0a2fd03063316e50cf141986bda984599bbda Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Tue, 22 Feb 2022 23:41:42 +0800
Subject: [PATCH] Merge branch 'developer'

---
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java |   35 +++++++++++++++++------------------
 1 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java
index 8940122..e055e95 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java
@@ -45,12 +45,24 @@
 	 * @param code
 	 * @return
 	 */
-	public  String getXcxLoginUrl(String code,Long companyId, String type) {
+	public  String getXcxLoginUrl(String code,Long companyId) {
 		String wechatLoginUrl = PropertiesUtil.getString(WECHAT_LOGIN_URL);
-		if (AppConstance.MINIPROGRAM_APPID.equals(type)) {
-			return String.format(wechatLoginUrl, getAppid(companyId), getSecret(companyId), code);
-		} else {
-			return String.format(wechatLoginUrl, getManagerAppId(companyId), getManagerSecret(companyId), code);		}
+
+		return String.format(wechatLoginUrl, getAppid(companyId), getSecret(companyId), code);
+	}
+
+	/**
+	 * 获取管理端小程序登录地址
+	 *
+	 * @param code
+	 * @return
+	 */
+	public String getManagerXcxLoginUrl(String code) {
+		String wechatLoginUrl = PropertiesUtil.getString(WECHAT_LOGIN_URL);
+		String appId = PropertiesUtil.getString(AppConstance.MINI_PROGRAM_MANAGER_APP_ID);
+		String secret = PropertiesUtil.getString(AppConstance.MINI_PROGRAM_MANAGER_SECRET);
+
+		return String.format(wechatLoginUrl, appId, secret, code);
 	}
 
 	/**
@@ -70,19 +82,6 @@
 		BusParameterSettings secret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_SECRET, companyId);
 		return  secret.getParamValue();
 	}
-
-	public String getManagerAppId(Long companyId) {
-		BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINI_PROGRAM_MANAGER_APP_ID, companyId);
-		return  appId.getParamValue();
-	}
-
-	public  String  getManagerSecret(Long companyId){
-		BusParameterSettings secret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINI_PROGRAM_MANAGER_SECRET, companyId);
-		return  secret.getParamValue();
-	}
-
-
-
 
 	/**
 	 * 清空token

--
Gitblit v1.9.1