|
@@ -44,6 +44,9 @@ public class StudentAdminController extends BaseController {
|
|
|
@PostMapping(value = "/delete")
|
|
|
public void delete(@ApiParam("考生ID") @RequestParam Long[] ids) {
|
|
|
LoginUser loginUser = this.curLoginUser();
|
|
|
+ if (loginUser.getRole().equals(Role.TEACHING)) {
|
|
|
+ throw new StatusException("没有权限");
|
|
|
+ }
|
|
|
studentService.delete(ids, loginUser);
|
|
|
}
|
|
|
|
|
@@ -60,11 +63,15 @@ public class StudentAdminController extends BaseController {
|
|
|
@ApiOperation(value = "上传考生的照片")
|
|
|
@PostMapping(value = "upload/photo")
|
|
|
public void uploadStudentPhoto(@RequestParam MultipartFile file) {
|
|
|
+ LoginUser loginUser = this.curLoginUser();
|
|
|
+ if (loginUser.getRole().equals(Role.TEACHING)) {
|
|
|
+ throw new StatusException("没有权限");
|
|
|
+ }
|
|
|
+
|
|
|
String filename = file.getOriginalFilename();
|
|
|
if (filename != null && !filename.toLowerCase().endsWith(".jpg") && !filename.toLowerCase().endsWith(".png")) {
|
|
|
throw new StatusException("请上传后缀为jpg或者png的考生头像");
|
|
|
}
|
|
|
- LoginUser loginUser = this.curLoginUser();
|
|
|
studentService.uploadStudentPhoto(loginUser.getId(), file);
|
|
|
}
|
|
|
|