whycxzp
6 天以前 9f475b23410a0a68fdc76699ff9462253824b476
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.db_user.User;
import com.whyc.service.LoginService;
import com.whyc.service.UserService;
import com.whyc.util.UserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletRequest;
 
@RequestMapping("login")
@RestController
@Api(tags = "登录")
public class LoginController extends BaseController{
 
    @Autowired
    private LoginService service;
    @Autowired
    private UserService userService;
 
    @GetMapping("loginByRSA")
    @ApiOperation(value ="登录-账号密码加密")
    public Response loginByRSA(@RequestParam String userName, String password,String deliveredCode,HttpServletRequest request,Integer validCode){
        return service.loginByRSA(userName,password,deliveredCode,request,validCode);
    }
 
 
    @PostMapping("logout")
    @ApiOperation(value ="退出登录")
    public void logout(){
        service.logout();
    }
 
 
 
 
    @ApiOperation(value = "修改密码")
    @GetMapping("changeSnId")
    public Response changeSnId(@RequestParam String oldSnId,@RequestParam String newSnId){
        User uinf= UserUtil.getUser();
        return userService.changeSnId(uinf.getName(),oldSnId,newSnId);
    }
 
    @ApiOperation(value = "校验密码")
    @GetMapping("checkSnId")
    public Response checkSnId(@RequestParam String checksnId){
        User uinf= UserUtil.getUser();
        return userService.checkSnId(uinf.getName(),checksnId);
    }
 
}