Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨昕
media-resource
Commits
844a2eb0
Commit
844a2eb0
authored
Oct 19, 2021
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
激活码管理修改
parent
ba212c84
Pipeline
#16527
passed with stages
in 53 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
129 deletions
+29
-129
ActiveCodeController.php
app/Http/Controllers/Web/ActiveCodeController.php
+16
-10
list.blade.php
resources/views/admin/active_code/list.blade.php
+13
-119
No files found.
app/Http/Controllers/Web/ActiveCodeController.php
View file @
844a2eb0
...
...
@@ -9,22 +9,28 @@ use App\Model\MediaCategoryModel;
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
){
$result
=
handler_drive
(
function
()
use
(
$request
)
{
$catgList
=
MediaCategoryModel
::
catgListPage
(
$request
);
return
$catgList
;
});
$data
[
'name'
]
=
$request
->
name
;
$data
[
'media_categories'
]
=
$result
;
$data
[
'doc_id'
]
=
$request
->
doc_id
;
//1c734a3cdfb54533908324699958f5b4
$data
[
"category_id"
]
=
$request
->
category_id
;
$data
[
"appid"
]
=
$request
->
appid
;
$client
=
new
Client
();
$result
=
$client
->
get
(
self
::
SECRET_DOC
.
"/api/license?doc_id="
.
$request
->
post
(
"doc_id"
));
if
(
$request
->
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
);
}
...
...
resources/views/admin/active_code/list.blade.php
View file @
844a2eb0
...
...
@@ -27,16 +27,19 @@
<br>
<!--***** CONTENT *****-->
<div
class=
"row ml20"
>
<div
class=
"row ml20"
style=
"margin-bottom: 20px;"
>
<div
class=
"xblock"
>
<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>
</form>
</div>
<div
class=
"active_code"
>
@if(count($media_categories) > 0)
<div
class=
"active_code"
style=
"margin: 20px 0;"
>
<div
class=
"userinfo"
>
加密人员:张三
</div>
...
...
@@ -45,29 +48,26 @@
<thead>
<tr
class=
"bg-info text-white"
>
<th>
序号
</th>
<th>
类别
编号
</th>
<th>
编号
</th>
</tr>
</thead>
<tbody>
@if(count($media_categories)>0)
@foreach ($media_categories as $key => $media_category)
<tr
class=
"
<?php
if
(
$key
%
2
==
0
)
echo
'table-success'
;
?>
"
>
<tr>
<td>
{{$key+1}}
</td>
<td
style=
"max-width: 150px;"
>
{{$media_category['_id']
}}
</td>
<td
>
{{$media_category
}}
</td>
</tr>
@endforeach
@else
<tr>
<td
colspan=
"9"
style=
"text-align:center"
>
暂无数据
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@else
@endif
</div>
</div>
...
...
@@ -87,112 +87,6 @@
<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
(
''
);
$
(
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
(
''
);
$
(
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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment