Commit 844a2eb0 by 杨昕

激活码管理修改

parent ba212c84
Pipeline #16527 passed with stages
in 53 seconds
...@@ -9,22 +9,28 @@ use App\Model\MediaCategoryModel; ...@@ -9,22 +9,28 @@ use App\Model\MediaCategoryModel;
class ActiveCodeController extends Controller class ActiveCodeController extends Controller
{ {
const SECRET_DOC = "ofc-secretdocs-svr.micro:50051"; const SECRET_DOC = "http://192.168.10.111:50051";
function index(Request $request){ function index(Request $request){
$result = handler_drive(function () use ($request) { $data['doc_id'] = $request->doc_id; //1c734a3cdfb54533908324699958f5b4
$catgList = MediaCategoryModel::catgListPage($request); $data["category_id"] = $request->category_id;
return $catgList; $data["appid"] = $request->appid;
});
$data['name'] = $request->name;
$data['media_categories'] = $result;
$client = new Client(); if ($request->doc_id){
$result = $client->get(self::SECRET_DOC."/api/license?doc_id=".$request->post("doc_id"));
var_dump($result); $client = new Client();
$result = $client->get(self::SECRET_DOC."/api/license?doc_id=".$request->doc_id);
$datas = json_decode($result->getBody(),true);
if (!isset($datas["data"])){
$data["media_categories"] = [];
}else{
$data["media_categories"] = $datas["data"]["license"];
}
}else{
$data["media_categories"] = [];
}
return view('admin.active_code.list',$data); return view('admin.active_code.list',$data);
} }
......
...@@ -27,16 +27,19 @@ ...@@ -27,16 +27,19 @@
<br> <br>
<!--***** CONTENT *****--> <!--***** CONTENT *****-->
<div class="row ml20"> <div class="row ml20" style="margin-bottom: 20px;">
<div class="xblock"> <div class="xblock">
<form> <form>
<input type="text" name="name" class="form-input" placeholder="名称" value="{{$name}}" autocomplete="off"> <input type="text" style="min-width: 280px" name="doc_id" class="form-input" placeholder="文件名称" value="{{$doc_id}}" autocomplete="off">
<input type="hidden" name="category_id" value="{{$category_id}}">
<input type="hidden" name="appid" value="{{$appid}}">
<button type="submit" class="btn btn-primary">查找</button> <button type="submit" class="btn btn-primary">查找</button>
</form> </form>
</div> </div>
<div class="active_code"> @if(count($media_categories) > 0)
<div class="active_code" style="margin: 20px 0;">
<div class="userinfo"> <div class="userinfo">
加密人员:张三 加密人员:张三
</div> </div>
...@@ -45,29 +48,26 @@ ...@@ -45,29 +48,26 @@
<thead> <thead>
<tr class="bg-info text-white"> <tr class="bg-info text-white">
<th>序号</th> <th>序号</th>
<th>类别编号</th> <th>编号</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@if(count($media_categories)>0)
@foreach ($media_categories as $key => $media_category) @foreach ($media_categories as $key => $media_category)
<tr class="<?php if($key%2==0) echo 'table-success';?>"> <tr>
<td>{{$key+1}}</td> <td>{{$key+1}}</td>
<td style="max-width: 150px;">{{$media_category['_id']}}</td> <td >{{$media_category}}</td>
</tr> </tr>
@endforeach @endforeach
@else
<tr>
<td colspan="9" style="text-align:center">暂无数据</td>
</tr>
@endif
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
@else
@endif
</div> </div>
</div> </div>
...@@ -87,112 +87,6 @@ ...@@ -87,112 +87,6 @@
<script src="{{ asset('xadmin/js/jquery.validate.js')}}"></script> <script src="{{ asset('xadmin/js/jquery.validate.js')}}"></script>
<script type="text/javascript">
function x_admin_show(url){
window.location.href = url;
}
function member_stop(obj,id){
var status = $(obj).attr('status');
var opts = new FormData();
var title = "停用";
opts.append('_token', "{{csrf_token()}}")
if (status == '1'){
title = "开启";
}
$.confirm({
// confirmButtonClass: 'btn-info',
// cancelButtonClass: 'btn-info',
cancelButtonClass: 'btn-info',
confirmButtonClass: 'btn-danger',
content:'确认要'+title+'吗?',
confirmButton:'确认',
cancelButton:'取消',
confirm: function () {
if(title == '停用'){
//发异步把用户状态进行更改
opts.append('id',id);
opts.append('status',1);
fetch_response('POST','/web/media_category/disable',opts).then(function(res){
if(res.code == 200){
$(obj).attr('title','启用')
$(obj).find('i').html('&#xe79e;');
$(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
$('body').toast({
position: 'fixed',
content: '已停用',
duration: 1000,
top: '50%'
});
setTimeout(function () {
window.location.href = '/web/media_category';
}, 2000)
}else{
$('body').toast({
position: 'fixed',
content: res.msg,
duration: 1000,
top: '50%'
});
}
});
}else{
opts.append('id',id);
opts.append('status',0);
fetch_response('POST','/web/media_category/disable',opts).then(function(res){
if(res.code == 200){
$(obj).attr('title','停用')
$(obj).find('i').html('&#xe689;');
$(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
// layer.msg('已启用!',{icon: 6,time:1000},function(){
// window.location.reload();
// });
$('body').toast({
position: 'fixed',
content: '已启用',
duration: 1000,
top: '50%'
});
setTimeout(function () {
window.location.href = '/web/media_category';
}, 2000)
}else{
$('body').toast({
position: 'fixed',
content: res.msg,
duration: 1000,
top: '50%'
});
}
});
}
},
cancel: function () {
$('body').toast({
position: 'fixed',
content: '已取消',
duration: 1000,
top: '50%'
});
}
});
}
</script>
</body> </body>
......
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