forked from XiaoLFeng/XF_Index
AddFeature: 处理页面返回内容
添加 viewPageNotFounded 方法 添加 viewNoPermission 方法 添加 构造 方法 中登录用户判断管理员方案 Signed-off-by: XiaoLFeng <gm@x-lf.cn>
This commit is contained in:
parent
8accafd615
commit
6597cbcaca
|
@ -41,10 +41,11 @@ public function __construct()
|
||||||
$this->data = array_merge($this->data, ['GonganCode' => $data[0]]);
|
$this->data = array_merge($this->data, ['GonganCode' => $data[0]]);
|
||||||
}
|
}
|
||||||
if (Auth::check()) {
|
if (Auth::check()) {
|
||||||
$this->data = array_merge($this->data,[
|
$this->data = array_merge($this->data, [
|
||||||
'userName' => Auth::user()->username,
|
'userName' => Auth::user()->username,
|
||||||
'userEmail' => Auth::user()->email,
|
'userEmail' => Auth::user()->email,
|
||||||
'userIcon' => Auth::user()->icon]);
|
'userIcon' => Auth::user()->icon,
|
||||||
|
'userAdmin' => Auth::user()->admin]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +64,18 @@ protected function ViewAboutMe(): Factory|View|Application
|
||||||
return view('about', $this->data);
|
return view('about', $this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function viewPageNotFounded(): Factory|View|Application
|
||||||
|
{
|
||||||
|
$this->data['webSubTitle'] = '页面未找到';
|
||||||
|
return view('modules.404', $this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function viewNoPermission(): Factory|View|Application
|
||||||
|
{
|
||||||
|
$this->data['webSubTitle'] = '没有权限';
|
||||||
|
return view('modules.no-permission', $this->data);
|
||||||
|
}
|
||||||
|
|
||||||
private function MarkdownToStringReplace(string $dataBase): string
|
private function MarkdownToStringReplace(string $dataBase): string
|
||||||
{
|
{
|
||||||
$decodeText = MarkdownExtra::defaultTransform($dataBase);
|
$decodeText = MarkdownExtra::defaultTransform($dataBase);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user