|
@@ -16,6 +16,7 @@ import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.entity.TBSession;
|
|
import com.qmth.teachcloud.common.entity.TBSession;
|
|
import com.qmth.teachcloud.common.enums.AppSourceEnum;
|
|
import com.qmth.teachcloud.common.enums.AppSourceEnum;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.teachcloud.common.enums.RoleTypeEnum;
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
@@ -23,6 +24,7 @@ import com.qmth.teachcloud.common.util.*;
|
|
import com.qmth.teachcloud.mark.bean.sys.ActiveTimeVo;
|
|
import com.qmth.teachcloud.mark.bean.sys.ActiveTimeVo;
|
|
import com.qmth.teachcloud.mark.bean.sys.ApiStatusVo;
|
|
import com.qmth.teachcloud.mark.bean.sys.ApiStatusVo;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -87,6 +89,9 @@ public class ScanController {
|
|
}
|
|
}
|
|
// 是否有打印端和扫描端权限
|
|
// 是否有打印端和扫描端权限
|
|
Set<String> roles = clientService.getRoleByUserId(sysUser.getId());
|
|
Set<String> roles = clientService.getRoleByUserId(sysUser.getId());
|
|
|
|
+ if(CollectionUtils.isEmpty(roles) || (!roles.contains(RoleTypeEnum.PRINT.name()) && !roles.contains(RoleTypeEnum.SCANNER.name()))){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("没有客户端登录权限");
|
|
|
|
+ }
|
|
|
|
|
|
LoginResult loginResult = teachcloudCommonService.login(login.getPassword(), sysUser, AppSourceEnum.SYSTEM);
|
|
LoginResult loginResult = teachcloudCommonService.login(login.getPassword(), sysUser, AppSourceEnum.SYSTEM);
|
|
LoginClientResult loginClientResult = new LoginClientResult(sysUser, loginResult);
|
|
LoginClientResult loginClientResult = new LoginClientResult(sysUser, loginResult);
|