1.大致流程
登录跟之前注册的代码差不多
登录大致流程就是
修改表单,添加name与表单提交地址,认证服务后台封装vo获取后调用member服务内的登录功能 service的登录方法内先 根据用户名或者手机号获取密码,使用md5的matches
方法比较,如果密码相同则登录成功跳转到首页,如果不同 则把报错信息带回登录页显示
因为跟上一篇注册的代码结构基本差不多,所以这里代码就不贴了
2.报错
期间授权服务启动时 报了一个错,bean 重复了
才发现注册跟登录服务接口都是调的member服务中的,把他俩整合到 一个 接口中,再启动就没报错了
package com.atguigu.gulimall.auth.feign;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.auth.vo.UserLoginVo;
import com.atguigu.gulimall.auth.vo.UserRegistVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @author rengang
* @version 1.0
* @date 2021/4/25 23:56
*/
@FeignClient("gulimall-member")
public interface MemberFeignService {
@PostMapping("member/member/login")
R login(@RequestBody UserLoginVo memberLoginVo);
@PostMapping("member/member/regist")
R regist(@RequestBody UserRegistVo userRegistVo);
}
428



被折叠的 条评论
为什么被折叠?



