Browse Source

报销小程序发起、审核、修改站内+微信订阅消息+邮件+日志开发

anderx 2 years ago
parent
commit
9552700d7f

+ 13 - 3
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -171,6 +171,11 @@ public class AdminApiController extends CertifyApiController {
 	@Value(value = "${wx.appSecret}")
 	private String appSecret;
 
+	@Value(value = "${wx.expense.appId}")
+	private String expenseAppId;
+	@Value(value = "${wx.expense.appSecret}")
+	private String expenseAppSecret;
+
 
 	/**
 	 * 获取营销员及营销经理下拉
@@ -3031,18 +3036,23 @@ public class AdminApiController extends CertifyApiController {
 		return res;
 	}
 	@RequestMapping(value ="/setOpenId" , method = RequestMethod.POST)
-	public Result setOpenId(String code) {
+	public Result setOpenId(String code,Integer type) {
 		Result res =new Result();
 		String url = "https://api.weixin.qq.com/sns/jscode2session?";
-		url=url+"appid="+appId+"&secret="+appSecret+"&js_code="+code+"&grant_type=authorization_code";
+		if (type!=null&&type==1){
+			url=url+"appid="+expenseAppId+"&secret="+expenseAppSecret+"&js_code="+code+"&grant_type=authorization_code";
+		}else{
+			url=url+"appid="+appId+"&secret="+appSecret+"&js_code="+code+"&grant_type=authorization_code";
+		}
 		JSONObject json= HttpUtils.httpGet(url);
+		System.out.println(json.toJSONString());
 		String openid=json.getString("openid");
 		if (StringUtils.isNotBlank(openid)) {
 			LoggerUtils.debug(getClass(), "获取openid"+openid);
 			Admin a=new Admin();
 			a.setId(TokenManager.getAdminId());
 			a.setOpenId(openid);
-			adminService.updateByPrimaryKey(a);
+//			adminService.updateByPrimaryKey(a);
 			res.data(1);
 		}else {
 			res.getError().add(buildError("openid绑定失败"));

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -66,7 +66,7 @@ wx.state=trial
 wx.clockInRange=1000
 #\u5FAE\u4FE1\u62A5\u9500\u5C0F\u7A0B\u5E8F
 wx.expense.appId=wx4f6bec93d9863623
-wx.expense.appSecret=081744369d42405be58fe37f892631f7
+wx.expense.appSecret=2dcd42ba9876562eb1b3268d1c46f6f2
 
 
 portal.host=//sf.jishutao.com/portal/2.0.6