|
|
@@ -9,11 +9,15 @@ import com.tuoheng.common.core.utils.DateUtils; |
|
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
|
import com.tuoheng.common.core.utils.StringUtils; |
|
|
|
import com.tuoheng.miniprogram.dao.UserAuthorizeMapper; |
|
|
|
import com.tuoheng.miniprogram.dao.UserMapper; |
|
|
|
import com.tuoheng.miniprogram.entity.User; |
|
|
|
import com.tuoheng.miniprogram.entity.UserAuthorize; |
|
|
|
import com.tuoheng.miniprogram.entity.dto.TemplateMinDto; |
|
|
|
import com.tuoheng.miniprogram.entity.wx.WxMessageRequest; |
|
|
|
import com.tuoheng.miniprogram.enums.AuthorizeStatusEnum; |
|
|
|
import com.tuoheng.miniprogram.enums.MarkEnum; |
|
|
|
import com.tuoheng.miniprogram.enums.UserAuthorizeEnum; |
|
|
|
import com.tuoheng.miniprogram.enums.UserCodeEnum; |
|
|
|
import com.tuoheng.miniprogram.param.WxSendMessageParam; |
|
|
|
import com.tuoheng.miniprogram.service.IWxService; |
|
|
|
import com.tuoheng.miniprogram.utils.CurrentUserUtil; |
|
|
@@ -40,6 +44,9 @@ public class WxServiceImpl implements IWxService { |
|
|
|
@Autowired |
|
|
|
private UserAuthorizeMapper userAuthorizeMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
private static String accessToken; |
|
|
|
|
|
|
|
private static long expiresTime; |
|
|
@@ -79,7 +86,18 @@ public class WxServiceImpl implements IWxService { |
|
|
|
return JsonResult.error("授权数据入库失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//关联登录用户,已经做过授权 修改授权标识 |
|
|
|
User user = CurrentUserUtil.getUserInfo(); |
|
|
|
if(ObjectUtil.isEmpty(user)){ |
|
|
|
return JsonResult.error(UserCodeEnum.USER_IS_NULL.getCode(),UserCodeEnum.USER_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
user.setAuthorize(AuthorizeStatusEnum.AUTHORIZE_ON.getCode()); |
|
|
|
user.setUpdateTime(DateUtils.now()); |
|
|
|
user.setUpdateUser(userId); |
|
|
|
int count = userMapper.updateById(user); |
|
|
|
if(count <= 0){ |
|
|
|
return JsonResult.error("用户授权标识更新失败"); |
|
|
|
} |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|