Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
note-library
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3bc106b4
authored
May 25, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
e3d5c6eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
app/Http/Controllers/AjaxController.php
app/Http/Controllers/AjaxController.php
View file @
3bc106b4
...
...
@@ -377,16 +377,27 @@ Class AjaxController extends Controller
}
/*
* 判断是否是管理员
*/
protected
function
isAdmin
(
$request
){
$role_id
=
(
new
\App\Http\Controllers\PermController
)
->
getUserRole
(
$request
);
return
in_array
(
$role_id
,[
1
])
?
true
:
false
;
}
/**
* 编辑模板 获取模板详情
*/
public
function
getTemplateDetail
(
$request
){
$id
=
$request
->
input
(
"t_id"
,
0
);
$isAdmin
=
$this
->
isAdmin
(
$request
);
if
(
!
$isAdmin
){
$count
=
TemplateListModel
::
where
(
"id"
,
intval
(
$id
))
->
where
(
"create_userid"
,
$request
->
user
->
userId
)
->
count
(
"id"
);
if
(
$count
<=
0
){
return
$this
->
ajaxReturn
(
-
1
,
"没找到属于您的模板信息"
);
}
}
$templateInfo
=
TemplateListModel
::
where
(
"id"
,
intval
(
$id
))
->
select
(
"id"
,
"template_name"
,
"status"
)
->
first
();
if
(
$templateInfo
->
status
<=
0
){
return
$this
->
ajaxReturn
(
-
1
,
"该模板已经被主人禁用了"
);
...
...
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