Commit befb7829 by chamberone

feat: 登录接口更新

1 parent 2896b157
package com.dituhui.pea.user;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.enums.ThirdPartyEnum;
import com.dituhui.pea.pojo.ThirdUserInfo;
import com.dituhui.pea.pojo.UserInfo;
import com.dituhui.pea.pojo.UserLoginDTO;
import com.dituhui.pea.pojo.WebResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 用户相关接口
......@@ -24,7 +24,7 @@ public interface IUser {
public Result<?> userLogin(@RequestBody UserLoginDTO user);
@RequestMapping(value = "/user/userInfo", method = RequestMethod.GET)
public Result<?> getUserInfo(@RequestHeader(name="Authorization", required = true) String authorization);
public Result<?> getUserInfo(@RequestParam(name = "token") String token);
/**
* 获取当前登陆用户信息
......
......@@ -58,7 +58,7 @@ public class UserService {
public Result<?> userLogin(String account, String password) {
UserEntity user = userDao.findByAccountAndPassword(account, SecureUtil.md5(password));
if (null == user) {
if (null != user) {
// 生成token
UserLoginDTO userDTO = BeanUtil.copyProperties(user, UserLoginDTO.class);
// 生成token
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!