We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccb16ff commit 55d3d69Copy full SHA for 55d3d69
laravel/app/Http/Controllers/AuthController.php
@@ -71,8 +71,11 @@ public function info()
71
// return response()->json(auth('api')->user());
72
// 输出管理员 roles
73
$userInfo = auth('api')->user();
74
+ $roles = $userInfo->roles->map(function($item) {
75
+ return $item->name;
76
+ });
77
$data = [
- 'roles' => 'admin',
78
+ 'roles' => $roles,
79
'name' => $userInfo['name'],
80
// 'avatar' => 'https://note.youdao.com/favicon.ico',
81
'avatar' => 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
0 commit comments