fix. 修正一些之前 login 的命名導致program error

This commit is contained in:
ukyo 2025-02-08 17:02:42 +08:00
parent ffede88eec
commit e86160cb63
4 changed files with 17 additions and 17 deletions

View File

@ -157,7 +157,7 @@ public function memberNormalLogin(Request $request)
return redirect()->route('member.index'); return redirect()->route('member.index');
} else { } else {
return redirect()->route('front.login.view')->with('error', '帳號密碼錯誤'); return redirect()->route('login')->with('error', '帳號密碼錯誤');
} }
} }

View File

@ -35,14 +35,8 @@ public function create(Request $request)
'phone' => $request->phone ?? '', 'phone' => $request->phone ?? '',
]); ]);
if (isset($newUser->email)) { return redirect()->route('login')->with('sucess', '完成註冊,請登入');
return redirect()->route('member.index')->with('sucess', '完成註冊');
} else {
return redirect()->route('member.profile')->with('sucess', '完成註冊,請完善你得資料');
}
} }

View File

@ -231,6 +231,14 @@
</body> </body>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
@if (session('error')) @if (session('error'))
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
@ -244,11 +252,4 @@
}); });
</script> </script>
@endif @endif
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

View File

@ -157,7 +157,7 @@
<p class="text-center"> <p class="text-center">
<span>已經有帳號?</span> <span>已經有帳號?</span>
<a href="{{ route('front.login.view') }}" class="text-body"> <a href="{{ route('login') }}" class="text-body">
<span>由此登入</span> <span>由此登入</span>
</a> </a>
</p> </p>
@ -388,6 +388,11 @@ function validateEmailField(field) {
// 如果所有欄位均有效,執行表單提交 // 如果所有欄位均有效,執行表單提交
if (isFormValid && isPhoneValid) { if (isFormValid && isPhoneValid) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({ $.ajax({
url: "{{ route('member.register.create') }}", url: "{{ route('member.register.create') }}",
type: 'POST', type: 'POST',