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
b5ed5a1a
Commit
b5ed5a1a
authored
Oct 21, 2021
by
杨昕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Test See merge request
!38
parents
44bd8ce9
ab8bb910
Pipeline
#16555
passed with stages
in 58 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
212 additions
and
17 deletions
+212
-17
MediaController.php
app/Http/Controllers/Api/MediaController.php
+1
-1
ActiveCodeController.php
app/Http/Controllers/Web/ActiveCodeController.php
+39
-0
LoginController.php
app/Http/Controllers/Web/LoginController.php
+6
-0
Apprialisal.php
app/Http/Middleware/Apprialisal.php
+21
-13
ActiveCodeRoute.php
app/Http/Routes/Web/ActiveCodeRoute.php
+21
-0
module.json
public/module.json
+12
-0
sub_admin.json
public/sub_admin.json
+15
-3
list.blade.php
resources/views/admin/active_code/list.blade.php
+97
-0
No files found.
app/Http/Controllers/Api/MediaController.php
View file @
b5ed5a1a
...
@@ -230,7 +230,7 @@ class MediaController extends Controller
...
@@ -230,7 +230,7 @@ class MediaController extends Controller
if
(
$request
->
status
){
if
(
$request
->
status
){
if
(
!
$request
->
media_url
||
!
$request
->
secret_key
){
if
(
!
$request
->
media_url
){
throw
new
FormException
(
"参数缺失"
);
throw
new
FormException
(
"参数缺失"
);
}
}
}
}
...
...
app/Http/Controllers/Web/ActiveCodeController.php
0 → 100644
View file @
b5ed5a1a
<?php
namespace
App\Http\Controllers\Web
;
use
App\Http\Controllers\Controller
;
use
GuzzleHttp\Client
;
use
Illuminate\Http\Request
;
use
App\Model\MediaCategoryModel
;
class
ActiveCodeController
extends
Controller
{
const
SECRET_DOC
=
"http://ofc-secretdocs-svr.micro:50051"
;
function
index
(
Request
$request
){
$data
[
'doc_id'
]
=
$request
->
doc_id
;
//1c734a3cdfb54533908324699958f5b4
$data
[
"category_id"
]
=
$request
->
category_id
;
$data
[
"appid"
]
=
$request
->
appid
;
if
(
$request
->
doc_id
){
$client
=
new
Client
();
$result
=
$client
->
get
(
self
::
SECRET_DOC
.
"/api/license?doc_id="
.
$request
->
doc_id
);
$res
=
json_decode
(
$result
->
getBody
(),
true
);
if
(
!
isset
(
$res
[
"data"
])){
$data
[
"activity_codes"
]
=
[];
}
else
{
$data
[
"activity_codes"
]
=
$res
[
"data"
][
"license"
];
$data
[
"mobile"
]
=
$res
[
"data"
][
"mobile"
];
}
}
else
{
$data
[
"activity_codes"
]
=
[];
}
return
view
(
'admin.active_code.list'
,
$data
);
}
}
app/Http/Controllers/Web/LoginController.php
View file @
b5ed5a1a
...
@@ -76,6 +76,12 @@ class LoginController extends Controller
...
@@ -76,6 +76,12 @@ class LoginController extends Controller
throw
new
\Exception
(
'用户名或者密码有误'
);
throw
new
\Exception
(
'用户名或者密码有误'
);
}
}
$request
->
replace
(
array_merge
(
$request
->
all
(),[
"staffNo"
=>
$request
->
username
]));
#获取mis用户信息
//UserModel::getMisInfo($request);
//为了媒资新旧账号统一,需要以员工mis编号作为用户唯一标识符
//为了媒资新旧账号统一,需要以员工mis编号作为用户唯一标识符
if
(
!
$user
->
mis_uid
){
if
(
!
$user
->
mis_uid
){
$request
->
replace
(
array_merge
(
$request
->
all
(),[
"staffNo"
=>
$request
->
username
]));
$request
->
replace
(
array_merge
(
$request
->
all
(),[
"staffNo"
=>
$request
->
username
]));
...
...
app/Http/Middleware/Apprialisal.php
View file @
b5ed5a1a
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
namespace
App\Http\Middleware
;
namespace
App\Http\Middleware
;
use
App\Model\LogModel
;
use
App\Model\UserModel
;
use
Closure
;
use
Closure
;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
App\Exceptions\ControllerException
;
use
App\Exceptions\ControllerException
;
...
@@ -30,31 +32,37 @@ class Apprialisal
...
@@ -30,31 +32,37 @@ class Apprialisal
}
}
$token
=
substr
(
$headers
[
'authorization'
][
0
],
7
);
$token
=
substr
(
$headers
[
'authorization'
][
0
],
7
);
$user
=
DB
::
connection
(
'mongodb'
)
->
collection
(
"users"
)
->
where
(
"token"
,
$token
)
->
first
();
if
(
empty
(
$user
)){
return
error
(
"请求异常:Authorization不存在"
,
1014
);
}
try
{
try
{
$params
=
decrypt
(
$token
);
decrypt
(
$token
);
}
catch
(
DecryptException
$e
)
{
}
catch
(
DecryptException
$e
)
{
return
error
(
'token非法'
);
return
error
(
'token非法'
);
}
}
$user
=
DB
::
connection
(
'mongodb'
)
->
collection
(
"users"
)
->
where
(
"token"
,
$token
)
->
first
();
if
(
empty
(
$user
)){
return
error
(
"请求异常:Authorization不存在"
,
1014
);
}
$idArr
=
(
$user
[
'_id'
])
->
jsonSerialize
();
$_id
=
$idArr
[
'$oid'
];
try
{
$idArr
=
(
$user
[
'_id'
])
->
jsonSerialize
();
if
(
!
isset
(
$user
[
'mis_uid'
])
||
$user
[
'mis_uid'
]
==
""
){
LogModel
::
addlog
([
'获取用户数据异常'
=>
$request
->
all
()]);
return
error
(
"获取用户数据异常,请重新登录再试!"
,
1013
);
}
}
catch
(
\Exception
$e
){
LogModel
::
addlog
([
'获取用户数据异常'
=>
$request
->
all
()]);
return
error
(
"获取用户数据异常,请重新登录再试!"
,
1013
);
}
$request
->
replace
(
array_merge
(
$request
->
all
(),
[
$request
->
replace
(
array_merge
(
$request
->
all
(),
[
'access_token'
=>
substr
(
$headers
[
'authorization'
][
0
],
7
)
,
'access_token'
=>
$token
,
'token_username'
=>
$user
[
'name'
],
'token_username'
=>
$user
[
'name'
],
'token_user_id'
=>
$
_id
,
'token_user_id'
=>
$
idArr
[
'$oid'
]
,
'mis_uid'
=>
$user
[
'mis_uid'
]
'mis_uid'
=>
$user
[
"mis_uid"
]
]));
]));
return
$next
(
$request
);
return
$next
(
$request
);
}
}
}
}
app/Http/Routes/Web/ActiveCodeRoute.php
0 → 100644
View file @
b5ed5a1a
<?php
/**
* Created by PhpStorm.
* User: nxtvadmin
* Date: 2018/7/17
* Time: 11:28
* 会用路由
*/
namespace
App\Http\Routes\Web
;
use
Illuminate\Contracts\Routing\Registrar
;
class
ActiveCodeRoute
extends
AuthenRoute
{
public
function
map
(
Registrar
$router
,
$callback
){
parent
::
map
(
$router
,
function
()
use
(
$router
){
$router
->
get
(
'active_code'
,
'ActiveCodeController@index'
);
});
}
}
\ No newline at end of file
public/module.json
View file @
b5ed5a1a
...
@@ -267,6 +267,18 @@
...
@@ -267,6 +267,18 @@
"key_name"
:
"media_create"
"key_name"
:
"media_create"
}]
}]
},{
},{
"id"
:
4
,
"pid"
:
0
,
"name"
:
"激活码管理"
,
"icon"
:
""
,
"link"
:
"/active_code"
,
"slug"
:
"active_code.index"
,
"description"
:
""
,
"show"
:
1
,
"sort"
:
1
,
"key_name"
:
"active_code"
,
"son"
:
[]
},{
"id"
:
2
,
"id"
:
2
,
"pid"
:
0
,
"pid"
:
0
,
"name"
:
"权限管理"
,
"name"
:
"权限管理"
,
...
...
public/sub_admin.json
View file @
b5ed5a1a
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
"sort"
:
25
,
"sort"
:
25
,
"key_name"
:
"member_modify_pwd"
"key_name"
:
"member_modify_pwd"
},
{
},
{
"id"
:
9
,
"id"
:
202
,
"pid"
:
2
02
,
"pid"
:
2
,
"name"
:
" 用户列表"
,
"name"
:
" 用户列表"
,
"icon"
:
""
,
"icon"
:
""
,
"link"
:
"/member"
,
"link"
:
"/member"
,
...
@@ -295,7 +295,19 @@
...
@@ -295,7 +295,19 @@
"son"
:
[],
"son"
:
[],
"have"
:
1
"have"
:
1
},{
},{
"id"
:
11
,
"id"
:
4
,
"pid"
:
0
,
"name"
:
"激活码管理"
,
"icon"
:
""
,
"link"
:
"/active_code"
,
"slug"
:
"active_code.index"
,
"description"
:
""
,
"show"
:
1
,
"sort"
:
1
,
"key_name"
:
"active_code"
,
"son"
:
[]
},{
"id"
:
12
,
"pid"
:
0
,
"pid"
:
0
,
"name"
:
"媒体资源上传"
,
"name"
:
"媒体资源上传"
,
"icon"
:
""
,
"icon"
:
""
,
...
...
resources/views/admin/active_code/list.blade.php
0 → 100644
View file @
b5ed5a1a
<!DOCTYPE html>
<html>
@include('admin.common.commonMedia')
<script
src=
"{{ asset('xadmin/extra/datepicker/js/moment.js')}}"
></script>
<body>
<!--====================================================
MAIN NAVBAR
======================================================-->
@include('admin.common.header')
<!--====================================================
PAGE CONTENT
======================================================-->
<div
class=
"page-content d-flex align-items-stretch"
>
<!--***** SIDE NAVBAR *****-->
@include('admin.common.left')
<div
class=
"content-inner chart-cont"
>
<div
class=
"card form"
>
<div
class=
"card-header"
>
<h3>
激活码列表
</h3>
</div>
<br>
<!--***** CONTENT *****-->
<div
class=
"row ml20"
style=
"margin-bottom: 20px;"
>
<div
class=
"xblock"
>
<form>
<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"
style=
"margin: 20px 0;"
>
@if(count($activity_codes) > 0)
<div
class=
"userinfo"
>
加密人员:{{$mobile}}
</div>
<div
class=
"active_code_list"
>
<table
class=
"table table-hover"
>
<thead>
<tr
class=
"bg-info text-white"
>
<th>
序号
</th>
<th>
编号
</th>
</tr>
</thead>
<tbody>
@foreach ($activity_codes as $key => $activity_code)
<tr>
<td>
{{$key+1}}
</td>
<td
>
{{$activity_code}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
@if($doc_id)
<div>
未查到相关数据
</div>
@endif
@endif
</div>
</div>
</div>
</div>
</div>
<!--Global Javascript -->
@include('admin.common.foot')
<!--Core Javascript -->
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/jqueryConfirm/css/jquery-confirm.css')}}"
>
<script
src=
"{{ asset('xadmin/extra/jqueryConfirm/js/jquery-confirm.min.js')}}"
></script>
<script
src=
"{{ asset('xadmin/extra/toast/js/toast.js')}}"
></script>
{{--
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/toast/css/toast.css')}}"
>
--}}
<script
src=
"{{ asset('xadmin/js/jquery.validate.js')}}"
></script>
</body>
</html>
\ No newline at end of file
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