Explorar el Código

修改项目申报 没登录不能访问的问题

wangjiang988 hace 5 años
padre
commit
2a27c4a0f6

+ 4 - 0
src/main/java/platform/modules/company/web/ProjectProvincesController.java

@@ -1,6 +1,7 @@
 package platform.modules.company.web;
 
 import com.github.pagehelper.PageInfo;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
@@ -72,6 +73,9 @@ public class ProjectProvincesController extends BaseController {
     public String add(ModelMap modelMap, @PathVariable("declarationId") Integer declarationId,
                       @RequestParam(value = "companyId", required = false) Integer companyId) {
         log.info("跳转到项目省市申报申请新增页面!");
+        if (!ShiroUtils.isLogin()) {
+            return "redirect:/home/login";
+        }
 
         if (ShiroUtils.getUserType().equals(Constant.UserType.COMPANY)) {
             companyId = ShiroUtils.getCompanyId();