修改BUG

This commit is contained in:
songmingsong
2024-12-10 10:36:37 +08:00
parent 45d66d01e6
commit c5977252fc
5 changed files with 39 additions and 13 deletions

View File

@ -28,7 +28,6 @@ public class AppMemberController {
/**
* 登录
*
* @param code
* @param userInfoDTO
* @return
* @throws Exception
@ -36,9 +35,8 @@ public class AppMemberController {
@ApiOperation("登录")
@PostMapping("/login")
@IgnoreToken
public ApiResponse<?> login(@RequestParam(value = "code") String code,
@RequestParam(value = "userInfoDTO") WeChatUserInfoDTO userInfoDTO) throws Exception {
return memberService.login(code, userInfoDTO);
public ApiResponse<?> login(@RequestBody WeChatUserInfoDTO userInfoDTO) throws Exception {
return memberService.login(userInfoDTO.getCode(), userInfoDTO);
}
/**

View File

@ -11,6 +11,11 @@ import lombok.Data;
*/
@Data
public class WeChatUserInfoDTO {
/**
* code
*/
private String code;
/**
* 头像
*/

View File

@ -1,6 +1,5 @@
package com.ycwl.basic.model.pc.member.resp;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -21,6 +20,11 @@ public class MemberRespVO {
*/
@ApiModelProperty("微信openId")
private String openId;
/**
* 微信头像
*/
@ApiModelProperty("微信头像")
private String avatarUrl;
/**
* 微信昵称
*/

View File

@ -99,6 +99,7 @@ public class AppMemberServiceImpl implements AppMemberService {
if (list.isEmpty()) {
MemberEntity memberEntity = new MemberEntity();
memberEntity.setId(SnowFlakeUtil.getLongId());
memberEntity.setOpenId(openId.toString());
BeanCopierUtils.copyProperties(userInfoDTO, memberEntity);
memberMapper.add(memberEntity);
BeanCopierUtils.copyProperties(memberEntity, memberRespVO);