|
|
@@ -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绑定失败"));
|