退出方法
parent
0856e6a335
commit
4f0e881554
|
@ -50,4 +50,9 @@ public class AuthController {
|
||||||
public Result info(){
|
public Result info(){
|
||||||
return authService.info();
|
return authService.info();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 退出登录
|
||||||
|
*/
|
||||||
|
@GetMapping("/lout")
|
||||||
|
public Result lout(){return authService.lout();}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,7 @@ public interface AuthService {
|
||||||
|
|
||||||
Result info();
|
Result info();
|
||||||
|
|
||||||
|
Result lout();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,10 @@ public class AuthServicelmpl implements AuthService{
|
||||||
return Result.success(token,"登录成功");
|
return Result.success(token,"登录成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录人
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result info() {
|
public Result info() {
|
||||||
String token = request.getHeader(TokenConstants.TOKEN);
|
String token = request.getHeader(TokenConstants.TOKEN);
|
||||||
|
@ -138,6 +142,19 @@ public class AuthServicelmpl implements AuthService{
|
||||||
return Result.success(user);
|
return Result.success(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出登录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result lout() {
|
||||||
|
String token = request.getHeader(TokenConstants.TOKEN);
|
||||||
|
String userKey = JwtUtils.getUserKey(token);
|
||||||
|
//删除键
|
||||||
|
redisTemplate.delete(TokenConstants.LOGIN_TOKEN_KEY+userKey);
|
||||||
|
return Result.success(200,"退出成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成token
|
* 生成token
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
package com.bwie.common.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author gxb
|
|
||||||
* @description TODO
|
|
||||||
* @date 2023-12-26 8:55
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Book {
|
|
||||||
|
|
||||||
private Integer bookId;
|
|
||||||
private String bookName;
|
|
||||||
private String bookHoppy;
|
|
||||||
private BigDecimal bookPrice;
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date bookDate;
|
|
||||||
private Integer userId;
|
|
||||||
private String username;
|
|
||||||
/**
|
|
||||||
* 图片
|
|
||||||
*/
|
|
||||||
private List<String> pics;
|
|
||||||
/**
|
|
||||||
* 爱好
|
|
||||||
*/
|
|
||||||
private List<String> hoppys;
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.bwie.common.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author gxb
|
|
||||||
* @description TODO
|
|
||||||
* @date 2023-12-26 8:55
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Pic {
|
|
||||||
private Integer picId;
|
|
||||||
private String picImages;
|
|
||||||
private Integer bookId;
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.bwie.common.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author gxb
|
|
||||||
* @description TODO
|
|
||||||
* @date 2023-12-26 8:55
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Procut {
|
|
||||||
private Integer procutId;
|
|
||||||
private String procutName;
|
|
||||||
private Integer treeId;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
package com.bwie.common.domain.request;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author gxb
|
|
||||||
* @description TODO
|
|
||||||
* @date 2023-12-26 9:02
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class BookRequest {
|
|
||||||
/**
|
|
||||||
* 模糊
|
|
||||||
*/
|
|
||||||
private String bookName;
|
|
||||||
/**
|
|
||||||
* 区间
|
|
||||||
*/
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date bookDate;
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date bookDates;
|
|
||||||
/**
|
|
||||||
* 分页
|
|
||||||
*/
|
|
||||||
private Integer pageNum;
|
|
||||||
private Integer pageSize;
|
|
||||||
/**
|
|
||||||
* 精确
|
|
||||||
*/
|
|
||||||
private Integer bookId;
|
|
||||||
}
|
|
Loading…
Reference in New Issue