Commit 719d57a0 authored by zhoujun's avatar zhoujun

Merge branch 'test'

parents 548a2794 b140596c
Pipeline #1606 passed with stage
in 8 seconds
......@@ -5,6 +5,8 @@
/public/*.htaccess
/storage/*.key
/storage/logs/*
/public/card
/public/cardImg
/vendor
.env
.env.backup
......
......@@ -34,8 +34,21 @@ class AdminController extends Controller
* @date 2021/06/02
* @author live
*/
public function getLogin()
public function getLogin(Request $request)
{
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$ips = explode(',',$ip);
if(!in_array($ips[0],['116.227.124.169','116.227.126.145'])){
abort(404);
exit();
}
if(Auth::check()) return redirect(route('checkImg'));
$data['ERROR'] = Session::get('error','');
return $this->view('admin.login',$data);
......@@ -48,6 +61,19 @@ class AdminController extends Controller
*/
public function getPostLogin(Request $request)
{
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$ips = explode(',',$ip);
if(!in_array($ips[0],['116.227.124.169','116.227.126.145'])){
exit('页面走丢了');
return false;
}
$postData = $request->all();
if( Auth::check()) return redirect(route('checkImg'));
if($request->isMethod('post'))
......@@ -95,7 +121,7 @@ class AdminController extends Controller
return $query->where('updated_at','<',$endTime);
})->when($status == 0, function ($query) use ($status) {
return $query->orderBy('status','ASC');
})->orderBy('updated_at','DESC')->select('id', 'uid', 'loacl_url','img_url', 'status','is_upload', 'updated_at')->paginate($pageNum);
})->orderBy('updated_at','DESC')->select('id', 'uid','role_id','role', 'loacl_url','img_url', 'status','is_upload', 'updated_at')->paginate($pageNum);
if($startTime != '') $paginateAppends['startTime'] = $startTime;
if($endTime != '') $paginateAppends['endTime'] = $endTime;
if($userName != '') $paginateAppends['user'] = $userName;
......@@ -159,4 +185,30 @@ class AdminController extends Controller
return $this->getErrorMsg('10063', '审核失败');
}
/**
* 删除角色信息
* @date 2021/06/10
* @author live
*/
public function getDeleteRole(Request $request)
{
$postData = $request->all();
$serverId = $postData['serverId'] ?? '';
$roleId = $postData['roleId'] ?? '';
$tableName = 'wx_card_role_'.$serverId;
if($serverId == '' || $roleId == '') return $this->getErrorMsg('10060', '参数错误');
$verity = DB::connection('wx_mysql')->table($tableName)->where('role_id',$roleId)->first();
if(!$verity) return $this->getErrorMsg('10061', '区服角色不匹配');
$uid = $verity->uid;
$result = DB::connection('wx_mysql')->table($tableName)->where('role_id',$roleId)->delete();
if($result){
$row = WxUserImg::where('uid',$uid)->where('server_id',$serverId)->where('role',$roleId)->first();
$row->delete();
return $this->getSuccessMsg([]);
}
return $this->getErrorMsg('10062', '清除角色失败');
}
}
\ No newline at end of file
......@@ -293,7 +293,7 @@ class CardController extends Controller
$tableName = 'wx_card_role_'.$serverId;
$role = DB::connection('wx_mysql')->table($tableName)->where('uid',$userId)->where('role_id',$roleId)->select('id')->first();
$img = $this->getUpdateImg($result['data'],$userId,$role->id,$serverId);
$img = $this->getUpdateImg($result['data'],$userId,$role->id,$serverId,$roleId);
if($img) return $this->jsonReturn(0, '上传成功');
Cache::forget($userId.':card:upload:image');
return $this->jsonReturn(10060, '上传失败');
......@@ -306,7 +306,7 @@ class CardController extends Controller
* @date 2021/06/01
* @author live
*/
public function getUpdateImg($data,$userId,$roleId,$serverId)
public function getUpdateImg($data,$userId,$roleId,$serverId,$role='')
{
$img = WxUserImg::where('uid',$userId)->where('role_id',$roleId)->where('server_id',$serverId)->first();
if($img){
......@@ -321,6 +321,7 @@ class CardController extends Controller
$row->uid = $userId;
$row->role_id = $roleId;
$row->server_id = $serverId;
$row->role = $role;
$row->loacl_url = $data['url'];
$row->img_url = $data['yunUrl'];
$row->status = 0;
......@@ -341,9 +342,16 @@ class CardController extends Controller
$userId = $request->session()->get("uid");
$roleId = $request->input('roleId');
$serverId = $request->input('serverId');
if(Cache::has('card:num:'.$userId.':'.$roleId)){
$num = Cache::get('card:num:'.$userId.':'.$roleId);
if($num > 3) return exit('页面走丢了,请稍后再试!');
}
if(Cache::has('card:info:'.$userId.':'.$roleId)){
$data = Cache::get('card:info:'.$userId.':'.$roleId,[]);
$data = Cache::get('card:info:'.$userId.':'.$roleId);
}else{
$data = [];
$result = $this->getVerityLogin($userId);
if($result['code'] != 200) return $this->jsonReturn($result['code'], $result['msg']);
if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误');
......@@ -455,6 +463,14 @@ class CardController extends Controller
}
Cache::put('card:info:'.$userId.':'.$roleId,300,$data);
}
if(Cache::has('card:num:'.$userId.':'.$roleId)){
$num = Cache::get('card:num:'.$userId.':'.$roleId) + 1;
Cache::forget('card:num:'.$userId.':'.$roleId);
Cache::put('card:num:'.$userId.':'.$roleId,$num,3);
}else{
Cache::put('card:num:'.$userId.':'.$roleId,1,3);
}
return view('card.card', $data);
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ use Carbon\Carbon;
use Illuminate\Validation\Rule;
use App\Services\UtilService;
use App\Models\User;
use App\Services\UtilService;
class HomeController extends Controller
......@@ -28,6 +29,8 @@ class HomeController extends Controller
*/
public function getHome(Request $request)
{
$isWx = UtilService::getIsWx($_SERVER['HTTP_USER_AGENT']);
if(!$isWx) return redirect(route('wxIndex'));
$data = [];
$isWx = UtilService::getIsWx($_SERVER['HTTP_USER_AGENT']);
if(!$isWx) return redirect(route("wxIndex"));
......
......@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Validator;
use Throwable;
use Exception;
use Carbon\Carbon;
use App\Services\UtilService;
class HomeController extends Controller
{
......@@ -27,4 +28,10 @@ class HomeController extends Controller
$data = [];
return view('index', $data);
}
public function getError()
{
$data = [];
return view('404', $data);
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -54,7 +54,7 @@
.postcard-container {
padding-bottom: 1rem;
background: url("../images/body_bg2.jpg?v=20210609") no-repeat center top, url("../images/bg.jpg") repeat-y center;
background: url("../images/body_bg3.jpg") no-repeat center top, url("../images/bg.jpg") repeat-y center;
background-size: 100% auto;
}
......@@ -105,46 +105,38 @@
}
li {
.lh(.62rem);
.fs(.24rem, @baseColor);
font-weight: bold;
text-align: center;
margin-top: .5rem;
font-size: 0;
padding-top: .15rem;
img{
height: .32rem;
}
span {
margin-left: .2rem;
display: inline-block;
width: 3.23rem;
width: 2.6rem;
.lh(.5rem);
background: url("../images/wn_bg.png") no-repeat center;
background-size: 100% auto;
.ells();
.fs(.24rem, @baseColor);
}
}
.left {
.fl();
width: 50%;
li {
.fs(.26rem, @baseColor)
ul{
padding-top: .2rem;
}
}
.right {
.fr();
width: 50%;
padding-top: .25rem;
li {
margin-top: 0;
margin-bottom: .45rem;
span {
margin-left: .5rem;
width: 3rem;
}
//&.role4 {
// margin-bottom: .7rem;
//}
ul{
padding-top: .2rem;
}
}
......@@ -301,11 +293,11 @@
background-size: 100% auto;
.mr {
.pr();
height: 5.27rem;
width: 8.6rem;
margin: 0 auto;
overflow: hidden;
span {
margin: 3.6rem 0 0 3.5rem;
display: block;
......
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>404</title>
<style>
.no-found{
text-align: center;
font-size: 12px;
color: #333;
}
.no-found img{
width: 120px;
display: block;
margin: 100px auto 12px;
}
</style>
</head>
<body>
<div class="no-found">
<img src="https://aldzn-ios-cdn.aldzn.cn/ucCard/postcard/images/404.png" alt="">
<span>页面走丢了。。。</span>
</div>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>404</title>
<style>
.no-found{
text-align: center;
font-size: 12px;
color: #333;
}
.no-found img{
width: 120px;
display: block;
margin: 100px auto 12px;
}
</style>
</head>
<body>
<div class="no-found">
<img src="https://aldzn-ios-cdn.aldzn.cn/ucCard/postcard/images/404.png" alt="">
<span>页面走丢了。。。</span>
</div>
</body>
</html>
\ No newline at end of file
......@@ -8,6 +8,7 @@
<div class="panel col-lg-12">
<div class="panel-content">
<div class="text-md mt-md bg-scale-0 mb-sm" style="height: 30px;"><a href="">图片审核</a>
<button class="add-item btn btn-o btn-primary btn-xs pull-right" onclick="return deleteRole();" style="height: 30px;">清除角色信息<i class="fa fa-plus coloff"></i></button>
</div>
<div class="table-responsive">
<form action="" method="GET" onsubmit="return check();">
......@@ -43,6 +44,7 @@
<th>操作 <input type="checkbox" value="all" onclick="return imgCheck(this);"/><label class="ml-sm">全选</label><button type="button" class="btn btn-success" onclick="return setAllStatus();">审核</button></th>
<th>编号</th>
<th>用户名</th>
<th>角色</th>
<th>审核</th>
<th>状态</th>
<th>图片</th>
......@@ -56,6 +58,7 @@
<td> <input type="checkbox" name="ids[]" value="{{ $li->id }}" class="imgIDCheckbox" /></td>
<td>{{ @$li->id }}</td>
<td>{{ $USER_INFO[$li->uid] ?? '' }}</td>
<td>{{ $li->role ?? '' }}</td>
<td>
@if($li->status == 0)
<button type="button" class="btn btn-success" onclick="return setStatus({{ $li->id }});">审核</button>
......@@ -106,6 +109,39 @@
@include('admin.common.foot')
<script>
function deleteRole(){
$('#DELETE_ROLE').modal('show')
}
function delRoleSave(){
var serverId = $('#del_server_id').val();
var token = $("input[name='_token']").val();
var roleId = $('#del_role_id').val();
$('#del_cir_role').attr("disabled",true);
$('#del_cir_role_shut').attr("disabled",true);
$.ajax({
type: 'POST',
url: '/admin/delete/role',
data: {_token:token,serverId:serverId,roleId:roleId},
success:function(data){
$('#show_error_info').html(data.info);
$('#show_success_info').html(data.info);
$('#del_cir_role').attr("disabled",false);
$('#del_cir_role_shut').attr("disabled",false);
$('#DELETE_ROLE').modal('hide')
if(data.code == 200){
$('#message-success-modal').modal('show')
}else{
verity_field(data.info,'show_error_info');
$("#message-error-modal").modal('show');
}
}
});
}
function setAllStatus(){
$('#ALL_VERITY').modal('show')
}
......
......@@ -106,4 +106,31 @@
</div>
</div>
<div class="modal fade" id="DELETE_ROLE" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">删除角色信息</h4>
</div>
<div class="modal-body">
<div class="panel-content">
<div class="row">
<div class="form-group col-lg-6">
<h6>区服ID</h6>
<input type="text" class="form-control" id="del_server_id" placeholder="区服ID">
</div>
<div class="form-group col-lg-6">
<h6>角色ID</h6>
<input type="text" class="form-control" id="del_role_id" placeholder="角色ID">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary active" id="del_cir_role" onclick="return delRoleSave();">提交</button>
<button type="button" class="btn btn-default active" id="del_cir_role_shut" onclick="return cir_cancel('DELETE_ROLE');">取消</button>
</div>
</div>
</div>
</div>
......@@ -44,26 +44,44 @@
@endif
</div>
<ul>
<li class="role1"><span>{{ $info->role_name ?? '' }}</span></li>
<li class="role2"><span>{{ $serverName }}</span></li>
<li class="role1">
<img src="{{ asset('postcard/images/role_img1.png') }}" alt="">
<span>{{ $info->role_name ?? '' }}</span>
</li>
<li class="role2">
<img src="{{ asset('postcard/images/role_img2.png') }}" alt="">
<span>{{ $serverName }}</span>
</li>
</ul>
</div>
<div class="right">
<ul>
<li class="role3"><span>{{ $info->job ?? '' }}</span></li>
<li class="role4"><span>{{ $info->guild ?? '' }}</span></li>
<li class="role5"><span>
@if($info->online_time > 0)
{{ ceil($info->online_time / 3600) }}
@else
0
@endif
小时</span></li>
<li class="role6"><span>{{ $honor }}</span></li>
<li class="role3">
<img src="{{ asset('postcard/images/role_img3.png') }}" alt="">
<span>{{ $info->job ?? '' }}</span>
</li>
<li class="role4">
<img src="{{ asset('postcard/images/role_img4.png') }}" alt="">
<span>{{ $info->guild ?? '' }}</span>
</li>
<li class="role5">
<img src="{{ asset('postcard/images/role_img5.png') }}" alt="">
<span>
@if($info->online_time > 0)
{{ ceil($info->online_time / 3600) }}
@else
0
@endif
小时</span>
</li>
<li class="role6">
<img src="{{ asset('postcard/images/role_img6.png') }}" alt="">
<span>{{ $honor }}</span>
</li>
</ul>
</div>
<div class="bottom">
<img src="{{ asset('postcard/images/img1.png') }}" class="img1" alt="">
<img src="{{ asset('postcard/images/img1.png?v=20210610') }}" class="img1" alt="">
<div id="bNum" class="b-num"></div>
<img src="{{ asset('postcard/images/img2.png') }}" class="img2" alt="">
</div>
......@@ -103,7 +121,8 @@
<!--佣兵团信息-->
<div class="mr-container">
<div class="mr">
<span class="{{ $ybImg }}"></span>
<span class="{{ $ybImg }}">
</span>
</div>
</div>
<!--勇者之塔-->
......
......@@ -11,6 +11,7 @@
|
*/
Route::any('/wx/home','HomeController@getIndex')->name('wxIndex');
Route::any('/404','HomeController@getError');
Route::prefix('service')->group(function() {
Route::post('/get_authcode', 'ToolController@authcode');
......@@ -34,6 +35,7 @@ Route::prefix('admin')->namespace('Admin')->middleware('check.adminLogin')->grou
Route::get('/image/list', 'AdminController@getImgList')->name('checkImg');
Route::post('/save/status', 'AdminController@getSaveStatus');
Route::post('/save/status/all', 'AdminController@getSaveStatusAll');
Route::post('/delete/role', 'AdminController@getDeleteRole');
});
......
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 to comment