改进 实名认证位置以及提示

This commit is contained in:
iVampireSP.com 2023-02-26 19:31:22 +08:00
parent 4b0acbc74c
commit 2c04c3144b
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 14 additions and 10 deletions

View File

@ -1,15 +1,6 @@
@extends('layouts.app')
@section('content')
@if(!auth('web')->user()->isRealNamed())
<x-alert-warning>
<div>
部分功能需要您<a href="{{ route('real_name.create') }}">实人认证</a>
</div>
</x-alert-warning>
@endif
@if (session('token'))
<x-alert-warning>
<div>

View File

@ -39,7 +39,6 @@
<!-- Left Side Of Navbar -->
<ul class="navbar-nav me-auto">
@auth('web')
<li class="nav-item">
<a class="nav-link" href="{{ route('index') }}">授权</a>
</li>
@ -110,6 +109,9 @@
{{ __('Reset Password') }}
</a>
@if(!auth('web')->user()->isRealNamed())
<a class="dropdown-item" href="{{ route('real_name.create') }}">实名认证</a>
@endif
@if (!session('auth.password_confirmed_at'))
<a class="dropdown-item" href="{{ route('password.confirm') }}">
@ -173,6 +175,17 @@ class="d-none">
nav.classList.remove('bg-body');
@endif
// 根据 URL 自动激活导航栏
const navLinks = document.querySelectorAll('#nav .nav-link, #nav .dropdown-item');
const currentUrl = window.location.href;
for (let i = 0; i < navLinks.length; i++) {
const navLink = navLinks[i];
if (currentUrl === navLink.href) {
navLink.classList.add('active');
}
}
</script>
</body>