修改系统模式判定

This commit is contained in:
Anyon 2020-09-30 10:07:13 +08:00
parent 57b6a00437
commit 50d3420043
2 changed files with 7 additions and 6 deletions

View File

@ -36,13 +36,14 @@ class Index extends Controller
*/
public function index()
{
if ($this->app->isDebug()) {
AdminService::instance()->apply(true);
} else {
AdminService::instance()->apply(false);
}
/*! 根据运行模式刷新权限 */
$clear = $this->app->isDebug();
AdminService::instance()->apply($clear);
/*! 读取当前权限菜单树 */
$this->menus = MenuService::instance()->getTree();
/*! 判断用户是否已经登录 */
$this->login = AdminService::instance()->isLogin();
/*! 菜单为空并且未登录跳转到登录页 */
if (empty($this->menus) && empty($this->login)) {
$this->redirect(sysuri('admin/login/index'));
} else {

View File

@ -62,7 +62,7 @@ class Login extends Controller
if (!CaptchaService::instance()->check($data['verify'], $data['uniqid'])) {
$this->error('图形验证码验证失败,请重新输入!');
}
// 用户信息验证
/*! 用户信息验证 */
$map = ['username' => $data['username'], 'is_deleted' => '0'];
$user = $this->app->db->name('SystemUser')->where($map)->order('id desc')->find();
if (empty($user)) {