feat: SaToken
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.landaiqing.domain.service;
|
||||
|
||||
import cn.dev33.satoken.stp.SaTokenInfo;
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
|
||||
@@ -11,5 +12,5 @@ public interface StudentDomainService {
|
||||
|
||||
PageResult<StudentBO> queryAllStudentByPage(StudentBO studentBO);
|
||||
|
||||
Boolean login(StudentBO studentBO);
|
||||
SaTokenInfo login(StudentBO studentBO);
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package com.landaiqing.domain.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.SaTokenInfo;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.auth.common.enums.IsDeletedFlagEnum;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
@@ -58,10 +60,12 @@ public class StudentDomainServiceImpl implements StudentDomainService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean login(StudentBO studentBO) {
|
||||
public SaTokenInfo login(StudentBO studentBO) {
|
||||
Student student = StudentBOConvert.INSTANCE.convertBOToEntity(studentBO);
|
||||
Integer count= studentService.login(student);
|
||||
return count>0;
|
||||
Integer id= studentService.login(student);
|
||||
StpUtil.login(id);
|
||||
SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
|
||||
return tokenInfo;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user