|
@@ -16,15 +16,10 @@ import com.qmth.teachcloud.common.bean.result.LoginResult;
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
-import com.qmth.teachcloud.common.enums.DownloadFileEnum;
|
|
|
|
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
|
-import com.qmth.teachcloud.common.enums.RoleTypeEnum;
|
|
|
|
-import com.qmth.teachcloud.common.enums.UploadFileEnum;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.service.*;
|
|
import com.qmth.teachcloud.common.service.*;
|
|
-import com.qmth.teachcloud.common.util.RedisUtil;
|
|
|
|
-import com.qmth.teachcloud.common.util.Result;
|
|
|
|
-import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
|
-import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.util.*;
|
|
|
|
+import com.qmth.teachcloud.report.business.service.ReportCommonService;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -36,7 +31,10 @@ import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.servlet.http.HttpSession;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.net.URLEncoder;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -86,6 +84,9 @@ public class SysController {
|
|
@Resource
|
|
@Resource
|
|
SysConfigService sysConfigService;
|
|
SysConfigService sysConfigService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ ReportCommonService reportCommonService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 登录
|
|
* 登录
|
|
*
|
|
*
|
|
@@ -159,7 +160,7 @@ public class SysController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return ResultUtil.ok(teachcloudCommonService.login(login.getPassword(), sysUser));
|
|
|
|
|
|
+ return ResultUtil.ok(teachcloudCommonService.login(login.getPassword(), sysUser, AppSourceEnum.SYSTEM));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -170,7 +171,7 @@ public class SysController {
|
|
@ApiOperation(value = "登出")
|
|
@ApiOperation(value = "登出")
|
|
@RequestMapping(value = "/logout", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/logout", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
|
|
- public Result logout() {
|
|
|
|
|
|
+ public void logout() throws IOException {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
|
|
TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
|
|
AuthBean authBean = cacheService.userAuthCache(sysUser.getId());
|
|
AuthBean authBean = cacheService.userAuthCache(sysUser.getId());
|
|
@@ -181,7 +182,9 @@ public class SysController {
|
|
redisUtil.deleteUserSession(tbSession.getId());
|
|
redisUtil.deleteUserSession(tbSession.getId());
|
|
cacheService.removeUserCache(sysUser.getId());
|
|
cacheService.removeUserCache(sysUser.getId());
|
|
cacheService.removeUserAuthCache(sysUser.getId());
|
|
cacheService.removeUserAuthCache(sysUser.getId());
|
|
- return ResultUtil.ok(new EditResult(sysUser.getId()));
|
|
|
|
|
|
+ if (Objects.nonNull(tbSession.getAppSource()) && tbSession.getAppSource() == AppSourceEnum.WHU_THIRD) {//武汉大学
|
|
|
|
+ reportCommonService.whuLogout();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|