|
@@ -5,6 +5,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
|
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
|
|
|
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.app.utils.JwtUtils;
|
|
|
import com.fs.common.core.domain.R;
|
|
@@ -249,10 +250,16 @@ public class WxUserController extends AppBaseController{
|
|
|
@PostMapping("/loginByMiniApp")
|
|
|
@Synchronized
|
|
|
public R loginByMiniApp( @RequestBody LoginMpWxParam param) {
|
|
|
+ logger.info("入参:{}",param);
|
|
|
+ WxMaService wxService = null;
|
|
|
if (StringUtils.isBlank(param.getCode())) {
|
|
|
return R.error("code不存在");
|
|
|
}
|
|
|
- final WxMaService wxService = WxMaConfiguration.getMaService(maProperties.getConfigs().get(0).getAppid());
|
|
|
+ if (ObjectUtil.isNotEmpty(param.getAppId())){
|
|
|
+ wxService = WxMaConfiguration.getMaService(param.getAppId());
|
|
|
+ }else {
|
|
|
+ wxService = WxMaConfiguration.getMaService(maProperties.getConfigs().get(0).getAppid());
|
|
|
+ }
|
|
|
try {
|
|
|
WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode());
|
|
|
// 解密
|