|
@@ -5,9 +5,11 @@ import java.util.Set; |
|
@@ -5,9 +5,11 @@ import java.util.Set; |
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
6
|
import org.springframework.web.bind.annotation.GetMapping;
|
6
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
7
|
import org.springframework.web.bind.annotation.PostMapping;
|
7
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
8
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
8
|
import org.springframework.web.bind.annotation.RestController;
|
9
|
import org.springframework.web.bind.annotation.RestController;
|
|
9
|
import com.ruoyi.common.constant.Constants;
|
10
|
import com.ruoyi.common.constant.Constants;
|
|
10
|
import com.ruoyi.common.utils.ServletUtils;
|
11
|
import com.ruoyi.common.utils.ServletUtils;
|
|
|
|
12
|
+import com.ruoyi.framework.security.LoginBody;
|
|
11
|
import com.ruoyi.framework.security.LoginUser;
|
13
|
import com.ruoyi.framework.security.LoginUser;
|
|
12
|
import com.ruoyi.framework.security.service.SysLoginService;
|
14
|
import com.ruoyi.framework.security.service.SysLoginService;
|
|
13
|
import com.ruoyi.framework.security.service.SysPermissionService;
|
15
|
import com.ruoyi.framework.security.service.SysPermissionService;
|
|
@@ -47,11 +49,12 @@ public class SysLoginController |
|
@@ -47,11 +49,12 @@ public class SysLoginController |
|
47
|
* @return 结果
|
49
|
* @return 结果
|
|
48
|
*/
|
50
|
*/
|
|
49
|
@PostMapping("/login")
|
51
|
@PostMapping("/login")
|
|
50
|
- public AjaxResult login(String username, String password, String code, String uuid)
|
52
|
+ public AjaxResult login(@RequestBody LoginBody loginBody)
|
|
51
|
{
|
53
|
{
|
|
52
|
AjaxResult ajax = AjaxResult.success();
|
54
|
AjaxResult ajax = AjaxResult.success();
|
|
53
|
// 生成令牌
|
55
|
// 生成令牌
|
|
54
|
- String token = loginService.login(username, password, code, uuid);
|
56
|
+ String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
|
|
|
57
|
+ loginBody.getUuid());
|
|
55
|
ajax.put(Constants.TOKEN, token);
|
58
|
ajax.put(Constants.TOKEN, token);
|
|
56
|
return ajax;
|
59
|
return ajax;
|
|
57
|
}
|
60
|
}
|