|
|
@ -7,9 +7,7 @@ import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.utils.MemberValidateUtil; |
|
|
|
import com.hfkj.common.utils.*; |
|
|
|
import com.hfkj.common.utils.RedisUtil; |
|
|
|
|
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
|
|
|
|
import com.hfkj.config.WxMaConfig; |
|
|
|
import com.hfkj.config.WxMaConfig; |
|
|
|
import com.hfkj.entity.BsUser; |
|
|
|
import com.hfkj.entity.BsUser; |
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
import com.hfkj.model.ResponseData; |
|
|
@ -26,14 +24,12 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
@ -139,6 +135,23 @@ public class BsUserController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getH5AccessToken", method = RequestMethod.GET) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "【H5】获取AccessToken") |
|
|
|
|
|
|
|
public ResponseData getH5AccessToken(@RequestParam(value = "code", required = true) String code) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|
|
|
|
params.put("appid", "wxa075e8509802f826"); |
|
|
|
|
|
|
|
params.put("secret", "0e606fc1378d35e359fcf3f15570b2c5"); |
|
|
|
|
|
|
|
params.put("code", code); |
|
|
|
|
|
|
|
params.put("grant_type", "authorization_code"); |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(HttpsUtils.doGet("https://api.weixin.qq.com/sns/oauth2/access_token", params)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/wechatMaPhone", method = RequestMethod.POST) |
|
|
|
@RequestMapping(value = "/wechatMaPhone", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "微信小程序手机号登录") |
|
|
|
@ApiOperation(value = "微信小程序手机号登录") |
|
|
|