Commit 79116365 by lujunyi

店铺登录

parent b1b102f9
...@@ -78,10 +78,10 @@ ...@@ -78,10 +78,10 @@
<fieldset class="form-label-group form-group position-relative has-icon-left"> <fieldset class="form-label-group form-group position-relative has-icon-left">
<input <input
type="text" type="text"
class="form-control {{ $errors->has('phone') ? 'is-invalid' : '' }}" class="form-control {{ $errors->has('username') ? 'is-invalid' : '' }}"
name="phone" name="username"
placeholder="手机号" placeholder="手机号"
value="{{ old('phone') }}" value="{{ old('username') }}"
required required
autofocus autofocus
> >
...@@ -90,12 +90,12 @@ ...@@ -90,12 +90,12 @@
<i class="feather icon-user"></i> <i class="feather icon-user"></i>
</div> </div>
<label for="phone">手机号</label> <label for="username">手机号</label>
<div class="help-block with-errors"></div> <div class="help-block with-errors"></div>
@if($errors->has('phone')) @if($errors->has('username'))
<span class="invalid-feedback text-danger" role="alert"> <span class="invalid-feedback text-danger" role="alert">
@foreach($errors->get('phone') as $message) @foreach($errors->get('username') as $message)
<span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br> <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
@endforeach @endforeach
</span> </span>
...@@ -176,18 +176,19 @@ ...@@ -176,18 +176,19 @@
let timer; let timer;
function getVerificationCode() { function getVerificationCode() {
const phone = $('input[name="phone"]').val(); const username = $('input[name="username"]').val();
if (!phone) { if (!username) {
alert('请输入手机号'); alert('请输入手机号');
return; return;
} }
// 发送 AJAX 请求获取验证码 // 发送 AJAX 请求获取验证码
$.ajax({ $.ajax({
url: '{{ admin_url('auth/get-verification-code') }}', // 替换为您的接口地址 url: "{{ admin_url('auth/get-verification-code') }}", // 替换为您的接口地址
method: 'POST', method: 'POST',
data: { data: {
phone: phone, username: username,
role: store,
_token: '{{ csrf_token() }}' _token: '{{ csrf_token() }}'
}, },
success: function(response) { success: function(response) {
...@@ -211,7 +212,7 @@ function startCountdown() { ...@@ -211,7 +212,7 @@ function startCountdown() {
$('#get-verification-code').text(`重新获取(${countdown}s)`); $('#get-verification-code').text(`重新获取(${countdown}s)`);
if (countdown <= 0) { if (countdown <= 0) {
clearInterval(timer); clearInterval(timer);
$('#get-verification-code').prop('disabled', false).text('{{ __('admin.get_verification_code') }}'); $('#get-verification-code').prop('disabled', false).text('获取验证码');
countdown = 60; // 重置倒计时 countdown = 60; // 重置倒计时
} }
}, 1000); }, 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment