Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有几点实际使用中的疑问or bug #1

Closed
justmd5 opened this issue Mar 3, 2017 · 8 comments
Closed

有几点实际使用中的疑问or bug #1

justmd5 opened this issue Mar 3, 2017 · 8 comments

Comments

@justmd5
Copy link

justmd5 commented Mar 3, 2017

public function permissions()
    {
        return $this->role->permissions();
    }
  • 这个地方默认注册用户,因为没有角色,所以会报错,
  • 是否可以考虑任何节点都没有的用户,进入admin直接跳转到站点首页呢。

thanks

@DukeAnn
Copy link
Owner

DukeAnn commented Mar 3, 2017

原本上是这么设计的,明天我看一下

@DukeAnn
Copy link
Owner

DukeAnn commented Mar 4, 2017

app/Http/Controllers/Auth/RegisterController.php
默认注册的用户是用户用组

   /**
     * The user has been registered.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  mixed  $user
     * @return mixed
     */
    protected function registered(Request $request, $user)
    {
        $role_user = Role::where(['name' => 'user'])->first();
        $user->attachRole($role_user);
        if ($user->hasRole('user')) {
            return false;
        }
        return true;
    }

@DukeAnn
Copy link
Owner

DukeAnn commented Mar 4, 2017

第二点你可以在用户的用户组里面设置一下权限,取消勾选后台首页

@DukeAnn
Copy link
Owner

DukeAnn commented Mar 4, 2017

member/index 是我写的一个小前台会员中心

@cnxfire
Copy link
Contributor

cnxfire commented Aug 2, 2017

5000个用户,在用户管理里面翻页 本地测试要13秒左右,查询语句是不是能优化下?

@DukeAnn
Copy link
Owner

DukeAnn commented Aug 2, 2017

恩好的,回头检查一下,具体怎么操作的呢

@cnxfire
Copy link
Contributor

cnxfire commented Aug 2, 2017

我用factory创建了5000个用户 然后在后台里面的用户管理列表里面翻页 翻页一次10几秒才能正常加载出来

@DukeAnn
Copy link
Owner

DukeAnn commented Aug 2, 2017

这是有点过分,回头我试一下

@DukeAnn DukeAnn closed this as completed Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants