Commit 7b9f04b3 authored by liyadong's avatar liyadong

Merge branch 'test' of http://gitlab.cccwangluo.com/zhoujun/uc_card into test

parents 234e789c c105c75c
...@@ -95,7 +95,7 @@ class AdminController extends Controller ...@@ -95,7 +95,7 @@ class AdminController extends Controller
return $query->where('updated_at','<',$endTime); return $query->where('updated_at','<',$endTime);
})->when($status == 0, function ($query) use ($status) { })->when($status == 0, function ($query) use ($status) {
return $query->orderBy('status','ASC'); 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($startTime != '') $paginateAppends['startTime'] = $startTime;
if($endTime != '') $paginateAppends['endTime'] = $endTime; if($endTime != '') $paginateAppends['endTime'] = $endTime;
if($userName != '') $paginateAppends['user'] = $userName; if($userName != '') $paginateAppends['user'] = $userName;
......
...@@ -293,7 +293,7 @@ class CardController extends Controller ...@@ -293,7 +293,7 @@ class CardController extends Controller
$tableName = 'wx_card_role_'.$serverId; $tableName = 'wx_card_role_'.$serverId;
$role = DB::connection('wx_mysql')->table($tableName)->where('uid',$userId)->where('role_id',$roleId)->select('id')->first(); $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, '上传成功'); if($img) return $this->jsonReturn(0, '上传成功');
Cache::forget($userId.':card:upload:image'); Cache::forget($userId.':card:upload:image');
return $this->jsonReturn(10060, '上传失败'); return $this->jsonReturn(10060, '上传失败');
...@@ -306,7 +306,7 @@ class CardController extends Controller ...@@ -306,7 +306,7 @@ class CardController extends Controller
* @date 2021/06/01 * @date 2021/06/01
* @author live * @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(); $img = WxUserImg::where('uid',$userId)->where('role_id',$roleId)->where('server_id',$serverId)->first();
if($img){ if($img){
...@@ -321,6 +321,7 @@ class CardController extends Controller ...@@ -321,6 +321,7 @@ class CardController extends Controller
$row->uid = $userId; $row->uid = $userId;
$row->role_id = $roleId; $row->role_id = $roleId;
$row->server_id = $serverId; $row->server_id = $serverId;
$row->role = $role;
$row->loacl_url = $data['url']; $row->loacl_url = $data['url'];
$row->img_url = $data['yunUrl']; $row->img_url = $data['yunUrl'];
$row->status = 0; $row->status = 0;
...@@ -342,7 +343,10 @@ class CardController extends Controller ...@@ -342,7 +343,10 @@ class CardController extends Controller
$roleId = $request->input('roleId'); $roleId = $request->input('roleId');
$serverId = $request->input('serverId'); $serverId = $request->input('serverId');
if(Cache::has('card:num:'.$userId.':'.$roleId)) return exit('页面走丢了,请稍后再试!'); 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)){ if(Cache::has('card:info:'.$userId.':'.$roleId)){
$data = Cache::get('card:info:'.$userId.':'.$roleId); $data = Cache::get('card:info:'.$userId.':'.$roleId);
...@@ -460,7 +464,13 @@ class CardController extends Controller ...@@ -460,7 +464,13 @@ class CardController extends Controller
Cache::put('card:info:'.$userId.':'.$roleId,300,$data); Cache::put('card:info:'.$userId.':'.$roleId,300,$data);
} }
Cache::put('card:num:'.$userId.':'.$roleId,1,5); 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); return view('card.card', $data);
} }
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ use Exception; ...@@ -9,6 +9,7 @@ use Exception;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use App\Models\User; use App\Models\User;
use App\Services\UtilService;
class HomeController extends Controller class HomeController extends Controller
{ {
...@@ -26,6 +27,8 @@ class HomeController extends Controller ...@@ -26,6 +27,8 @@ class HomeController extends Controller
*/ */
public function getHome(Request $request) public function getHome(Request $request)
{ {
$isWx = UtilService::getIsWx($_SERVER['HTTP_USER_AGENT']);
if(!$isWx) return redirect(route('wxIndex'));
$data = []; $data = [];
if($request->session()->get('uid')){ if($request->session()->get('uid')){
$userId = $request->session()->get('uid'); $userId = $request->session()->get('uid');
......
...@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Validator; ...@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Validator;
use Throwable; use Throwable;
use Exception; use Exception;
use Carbon\Carbon; use Carbon\Carbon;
use App\Services\UtilService;
class HomeController extends Controller class HomeController extends Controller
{ {
...@@ -27,4 +28,10 @@ class HomeController extends Controller ...@@ -27,4 +28,10 @@ class HomeController extends Controller
$data = []; $data = [];
return view('index', $data); return view('index', $data);
} }
public function getError()
{
$data = [];
return view('404', $data);
}
} }
\ No newline at end of file
...@@ -194,7 +194,6 @@ class UtilService ...@@ -194,7 +194,6 @@ class UtilService
public static function getIsWx($httpUserAgent) public static function getIsWx($httpUserAgent)
{ {
return true;
if (strpos($httpUserAgent, 'MicroMessenger') !== false) { if (strpos($httpUserAgent, 'MicroMessenger') !== false) {
return true; return true;
} else { } else {
......
<!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
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</head> </head>
<body> <body>
<div class="no-found"> <div class="no-found">
<img src="../../public/static/postcard/images/404.png" alt=""> <img src="https://aldzn-ios-cdn.aldzn.cn/ucCard/postcard/images/404.png" alt="">
<span>页面走丢了。。。</span> <span>页面走丢了。。。</span>
</div> </div>
</body> </body>
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,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>操作 <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> <th>审核</th>
<th>状态</th> <th>状态</th>
<th>图片</th> <th>图片</th>
...@@ -56,6 +57,7 @@ ...@@ -56,6 +57,7 @@
<td> <input type="checkbox" name="ids[]" value="{{ $li->id }}" class="imgIDCheckbox" /></td> <td> <input type="checkbox" name="ids[]" value="{{ $li->id }}" class="imgIDCheckbox" /></td>
<td>{{ @$li->id }}</td> <td>{{ @$li->id }}</td>
<td>{{ $USER_INFO[$li->uid] ?? '' }}</td> <td>{{ $USER_INFO[$li->uid] ?? '' }}</td>
<td>{{ $li->role ?? '' }}</td>
<td> <td>
@if($li->status == 0) @if($li->status == 0)
<button type="button" class="btn btn-success" onclick="return setStatus({{ $li->id }});">审核</button> <button type="button" class="btn btn-success" onclick="return setStatus({{ $li->id }});">审核</button>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
| |
*/ */
Route::any('/wx/home','HomeController@getIndex')->name('wxIndex'); Route::any('/wx/home','HomeController@getIndex')->name('wxIndex');
Route::any('/404','HomeController@getError');
Route::prefix('service')->group(function() { Route::prefix('service')->group(function() {
Route::post('/get_authcode', 'ToolController@authcode'); Route::post('/get_authcode', 'ToolController@authcode');
......
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