fixbug
This commit is contained in:
parent
d83c9c568b
commit
833c685954
|
|
@ -63,24 +63,31 @@ function ($attribute, $value, $fail) {
|
||||||
return abort(400);
|
return abort(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$now_time = Carbon::now();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$key = Crypt::decryptString($key);
|
$key = Crypt::decryptString($key);
|
||||||
|
$key = Carbon::parse($key);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
return abort(400);
|
return abort(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = Carbon::parse($key);
|
// $now_time = Carbon::now();
|
||||||
if ($key->diffInMinutes($now_time) > 5) {
|
// if ($key->diffInMinutes($now_time) > 5) {
|
||||||
$key = $now_time;
|
// $key = $now_time;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$to_hash = hash('sha256', $email);
|
$to_hash = hash('sha256', $email);
|
||||||
|
|
||||||
|
$max_received_at = Mail::where([
|
||||||
|
['to_hash', '=', $to_hash],
|
||||||
|
['received_at', '>=', $key],
|
||||||
|
])
|
||||||
|
->orderBy('received_at', 'desc')
|
||||||
|
->value("received_at");
|
||||||
|
|
||||||
$new_email_list = Mail::where([
|
$new_email_list = Mail::where([
|
||||||
['to_hash', '=', $to_hash],
|
['to_hash', '=', $to_hash],
|
||||||
['created_at', '>=', $key],
|
['received_at', '>=', $key],
|
||||||
])
|
])
|
||||||
->select([
|
->select([
|
||||||
'id as key',
|
'id as key',
|
||||||
|
|
@ -102,7 +109,7 @@ function ($attribute, $value, $fail) {
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'data' => [
|
'data' => [
|
||||||
'list' => $new_email_list,
|
'list' => $new_email_list,
|
||||||
'new_key' => Crypt::encryptString($now_time->format('Y-m-d H:i:s')),
|
'new_key' => Crypt::encryptString(Carbon::parse($max_received_at)->format('Y-m-d H:i:s')),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@
|
||||||
|
|
||||||
function isValidDomain(domain) {
|
function isValidDomain(domain) {
|
||||||
console.log(domain);
|
console.log(domain);
|
||||||
var pattern = /^(?!:\/\/)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[a-zA-Z]{2,11}?$/;
|
var pattern = /^(?!:\/\/)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,11}$/;
|
||||||
return pattern.test(domain);
|
return pattern.test(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user