|
@@ -22,6 +22,8 @@ import com.miaxis.wx.dto.WxResult;
|
|
|
import com.miaxis.wx.service.WxService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -56,6 +58,8 @@ public class SysLoginController
|
|
|
|
|
|
@Autowired
|
|
|
private WxService wxService;
|
|
|
+ private static Logger logger = LoggerFactory.getLogger(SysLoginController.class);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -113,7 +117,9 @@ public class SysLoginController
|
|
|
@ApiOperation("用户授权码模式登录")
|
|
|
public Response<TokenDTO> loginByAuthorizationCode(String authorizationCode ){
|
|
|
String wxResultStr = wxService.getWxToken(appid, appSecret, authorizationCode, "authorization_code");
|
|
|
+ logger.info("微信授权码登录返回值:"+wxResultStr);
|
|
|
WxResult wxResult = JSONObject.parseObject(wxResultStr,WxResult.class);
|
|
|
+
|
|
|
// 生成令牌
|
|
|
if (wxResult.getErrcode() != null){
|
|
|
throw new CustomException(wxResult.getErrmsg());
|