| | |
| | | @Service |
| | | public class WeChatApiTools { |
| | | |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public String getXcxLoginUrl(String code,Long companyId) { |
| | | public String getXcxLoginUrl(String code,Long companyId, String type) { |
| | | String wechatLoginUrl = PropertiesUtil.getString(WECHAT_LOGIN_URL); |
| | | return String.format(wechatLoginUrl, getAppid(companyId), getSecret(companyId), code); |
| | | 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 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(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |