Browse Source

chore: 更新登录接口响应格式

Gudge-ZL 2 years ago
parent
commit
49e9b6c1f6

+ 2 - 7
src/main/java/com/seecoder/BlueWhale/Controller/UserController.java

@@ -4,9 +4,6 @@ import com.seecoder.BlueWhale.Service.UserService;
 import com.seecoder.BlueWhale.VO.ResultVO;
 import com.seecoder.BlueWhale.VO.UserVO;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -27,9 +24,7 @@ public class UserController {
     }
 
     @PostMapping("/login")
-    public ResultVO<Map<String, String>> login(@RequestParam("phone") String phone, @RequestParam("password") String password){
-        Map<String, String> tokenMap = new HashMap<>();
-        tokenMap.put("token", userService.login(phone, password));
-        return ResultVO.buildSuccess(tokenMap);
+    public ResultVO<String> login(@RequestParam("phone") String phone, @RequestParam("password") String password){
+        return ResultVO.buildSuccess(userService.login(phone, password));
     }
 }