提交代码

dev-discount
胡锐 2 years ago
parent d765e3bd16
commit 8b01a10997
  1. 35
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  2. 1
      hai-service/src/main/java/com/hai/enum_type/LoginPlatform.java
  3. 6
      hai-service/src/main/java/com/hai/service/HighUserService.java
  4. 16
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  5. 2
      hai-user/src/main/java/com/web/controller/LoginController.java
  6. 2
      hai-user/src/main/java/com/web/type/LoginType.java

@ -365,43 +365,8 @@ public class WechatController {
return ResponseMsgUtil.success(so); return ResponseMsgUtil.success(so);
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "微信签名")
public ResponseData verifyWx(@RequestParam(value = "url", required = true) String url) {
try {
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxH5AppId());
params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
Map<String, Object> map = new HashMap<>();
map.put("noncestr",WxUtils.makeNonStr());
map.put("jsapi_ticket",accessTokenObject.getString("ticket"));
map.put("timestamp", new Date().getTime());
map.put("url",url);
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("appId" , params.get("appId"));
objectMap.put("timestamp" , map.get("timestamp"));
objectMap.put("nonceStr" , map.get("nonceStr"));
objectMap.put("signature" , WxUtils.getSHA1(map));
return ResponseMsgUtil.success(objectMap);
} catch (Exception e) {
return null;
}
}
} }

@ -12,6 +12,7 @@ public enum LoginPlatform {
H5("H5", "H5客户端"), H5("H5", "H5客户端"),
WXAPPLETS("WXAPPLETS", "微信小程序"), WXAPPLETS("WXAPPLETS", "微信小程序"),
UNIONPAY("UNIONPAY", "云闪付"), UNIONPAY("UNIONPAY", "云闪付"),
HUIPAY("HUIPAY", "惠支付"),
; ;
private String code; private String code;

@ -30,6 +30,12 @@ public interface HighUserService {
*/ */
SessionObject loginAndRegister(LoginPlatform platForm, String phone, Long popularizeUserId, Map<String, Object> other, HttpServletRequest request, HttpServletResponse response) throws Exception; SessionObject loginAndRegister(LoginPlatform platForm, String phone, Long popularizeUserId, Map<String, Object> other, HttpServletRequest request, HttpServletResponse response) throws Exception;
/**
* 查询用户列表
* @param param
* @return
*/
List<HighUser> getUserList(Map<String, Object> param);
/** /**
* *
* @Title: getListUser * @Title: getListUser

@ -140,6 +140,22 @@ public class HighUserServiceImpl implements HighUserService {
return so; return so;
} }
@Override
public List<HighUser> getUserList(Map<String, Object> param) {
HighUserExample example = new HighUserExample();
HighUserExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (StringUtils.isNotBlank(MapUtils.getString(param, "openId"))) {
criteria.andOpenIdEqualTo(MapUtils.getString(param, "openId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "openIdH5"))) {
criteria.andOpenIdH5EqualTo(MapUtils.getString(param, "openIdH5"));
}
return highUserMapper.selectByExample(example);
}
@Override @Override
public List<HighUser> getListUser(Map<String, String> map) { public List<HighUser> getListUser(Map<String, String> map) {
HighUserExample example = new HighUserExample(); HighUserExample example = new HighUserExample();

File diff suppressed because one or more lines are too long

@ -10,6 +10,8 @@ import java.util.Objects;
**/ **/
public enum LoginType { public enum LoginType {
SMS("SMS", "短信登录"), SMS("SMS", "短信登录"),
WECHAT_MA_OPENID("WECHAT_MA_OPENID", "微信小程序openId"),
WECHAT_MP_OPENID("WECHAT_MP_OPENID", "微信公众号openId"),
; ;
private String code; private String code;

Loading…
Cancel
Save