package cn.feast.coding.controller.system;

import cn.feast.coding.model.system.User;
import cn.feast.coding.service.system.UserService;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;

@Controller
public class BaseController {
    public User getCurrentUser(UserService userService){
        String username = (String)SecurityUtils.getSubject().getPrincipal();
        return userService.findByUsername(username);
    }
}
