Commit 79116365 by lujunyi

店铺登录

parent b1b102f9
......@@ -78,10 +78,10 @@
<fieldset class="form-label-group form-group position-relative has-icon-left">
<input
type="text"
class="form-control {{ $errors->has('phone') ? 'is-invalid' : '' }}"
name="phone"
class="form-control {{ $errors->has('username') ? 'is-invalid' : '' }}"
name="username"
placeholder="手机号"
value="{{ old('phone') }}"
value="{{ old('username') }}"
required
autofocus
>
......@@ -90,12 +90,12 @@
<i class="feather icon-user"></i>
</div>
<label for="phone">手机号</label>
<label for="username">手机号</label>
<div class="help-block with-errors"></div>
@if($errors->has('phone'))
@if($errors->has('username'))
<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>
@endforeach
</span>
......@@ -176,18 +176,19 @@
let timer;
function getVerificationCode() {
const phone = $('input[name="phone"]').val();
if (!phone) {
const username = $('input[name="username"]').val();
if (!username) {
alert('请输入手机号');
return;
}
// 发送 AJAX 请求获取验证码
$.ajax({
url: '{{ admin_url('auth/get-verification-code') }}', // 替换为您的接口地址
url: "{{ admin_url('auth/get-verification-code') }}", // 替换为您的接口地址
method: 'POST',
data: {
phone: phone,
username: username,
role: store,
_token: '{{ csrf_token() }}'
},
success: function(response) {
......@@ -211,7 +212,7 @@ function startCountdown() {
$('#get-verification-code').text(`重新获取(${countdown}s)`);
if (countdown <= 0) {
clearInterval(timer);
$('#get-verification-code').prop('disabled', false).text('{{ __('admin.get_verification_code') }}');
$('#get-verification-code').prop('disabled', false).text('获取验证码');
countdown = 60; // 重置倒计时
}
}, 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