| | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | * Created by johnny on 15/12/24. |
| | | */ |
| | | public class BaseController implements Serializable { |
| | | |
| | | |
| | | @Value("${institute.name}") |
| | | private String title; |
| | | |
| | | public Subject getSubject() { |
| | | return SecurityUtils.getSubject(); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUserProject() { |
| | | SysUser user = this.getUser(); |
| | | if (user != null) { |
| | | return user.getProject(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getTitle(){ |
| | | if(StringUtils.isBlank(this.title)){ |
| | | return "中国科学院苏州纳米技术与纳米仿生研究所"; |
| | | } |
| | | return this.title; |
| | | } |
| | | } |