Fix bugs and increase security entrance (#179)

* 修正用户文章详情显示错误

* 新增安全入口,修复部分错误文字显示

Co-Authored-By: garhing <garhing@fxxsj.xyz>
This commit is contained in:
fxxsj
2021-06-23 12:18:43 +08:00
committed by 兔姬桑
parent 634aba049d
commit b177272c02
6 changed files with 21 additions and 9 deletions

View File

@@ -29,13 +29,7 @@ class isSecurity
if ($code !== $websiteSecurityCode) {
Log::info(trans('error.unsafe_enter').$ip);
return Response::view(
'auth.error',
[
'message' => trans('error.unsafe_enter').','.trans('error.visit').'<a href="'.route('login').'?securityCode=" target="_self">'.trans('error.safe_enter').'</a>',
],
403
);
return Response::view('auth.safe');
}
Cache::put($cacheKey, $ip, 7200); // 2小时之内无需再次输入安全码访问

View File

@@ -13,6 +13,7 @@ return [
'refresh_page' => 'Please Refresh Page, Then Try Again',
'report' => 'Error comes back with log: ',
'safe_enter' => 'Secure Entrance',
'safe_code' => 'Please enter the security code',
'system' => 'System Error',
'title' => '⚠Error Detected',
'unauthorized' => 'Unauthorized Access',

View File

@@ -92,7 +92,7 @@ return [
'total' => 'Total: num invitation codes',
'tips' => 'Can generate <strong> :num <strong> invitation codes, valid within :days',
'logs' => 'Invitation Record',
'promotion' => 'Register and activate with your invitation code, Both sides will get <mark>:traffic<mark> traffic as rewards; when invitees purchase services, you will get <mark>:referral percent%<mark> of their spend amount as commission.',
'promotion' => 'Register and activate with your invitation code, Both sides will get <mark>:traffic</mark> traffic as rewards; when invitees purchase services, you will get <mark>:referral_percent%</mark> of their spend amount as commission.',
'generate_failed' => 'Failed to generate',
],
'reset_data' => [

View File

@@ -13,6 +13,7 @@ return [
'refresh_page' => '请刷新页面后,再访问',
'report' => '错❌误携带了报告:',
'safe_enter' => '安全入口访问',
'safe_code' => '请输入安全码',
'system' => '系统错误',
'title' => '⚠️错误触发',
'unauthorized' => '未授权访问',

View File

@@ -23,7 +23,7 @@
const hours = Math.floor(distance % 86400000 / 3600000);
const minutes = Math.floor(distance % 3600000 / 60000);
const seconds = Math.floor(distance % 60000 / 1000);
document.getElementById('countdown').innerHTML = '<h2>' + days + ' <span> {{trans('validation.attributes.date')}} </span>: ' +
document.getElementById('countdown').innerHTML = '<h2>' + days + ' <span> {{trans('validation.attributes.day')}} </span>: ' +
hours + ' <span>{{trans('validation.attributes.hour')}}</span>: ' + minutes + ' <span>{{trans('validation.attributes.minute')}} </span>: ' +
seconds + '<span> {{trans('validation.attributes.second')}}</span> </h2>';
if (distance <= 0) {

View File

@@ -0,0 +1,16 @@
@extends('auth.layouts')
@section('title', sysConfig('website_name').' - '.trans('error.safe_enter'))
@section('content')
<form role="form" action="/login?securityCode=">
<div class="form-group">
<div class="form-group form-material floating" data-plugin="formMaterial">
<input class="form-control" id="securityCode" name="securityCode"
placeholder="" type="text">
<label class="floating-label" for="securityCode">{{trans('error.safe_code')}}</label>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-lg btn-block mt-40 bg-indigo-500 text-white">{{trans('common.confirm')}}</button>
</div>
</form>
@endsection