Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
uc_card
Commits
93535843
Commit
93535843
authored
Jun 10, 2021
by
liyadong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
http://gitlab.cccwangluo.com/zhoujun/uc_card
into test
parents
f4fb9d73
b140596c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
2 deletions
+118
-2
src/.gitignore
src/.gitignore
+2
-0
src/app/Http/Controllers/Admin/AdminController.php
src/app/Http/Controllers/Admin/AdminController.php
+53
-1
src/resources/views/admin/img.blade.php
src/resources/views/admin/img.blade.php
+34
-0
src/resources/views/admin/mode.blade.php
src/resources/views/admin/mode.blade.php
+28
-1
src/routes/web.php
src/routes/web.php
+1
-0
No files found.
src/.gitignore
View file @
93535843
...
...
@@ -5,6 +5,8 @@
/public/*.htaccess
/storage/*.key
/storage/logs/*
/public/card
/public/cardImg
/vendor
.env
.env.backup
...
...
src/app/Http/Controllers/Admin/AdminController.php
View file @
93535843
...
...
@@ -34,8 +34,21 @@ class AdminController extends Controller
* @date 2021/06/02
* @author live
*/
public
function
getLogin
()
public
function
getLogin
(
Request
$request
)
{
if
(
!
empty
(
$_SERVER
[
'HTTP_X_FORWARDED_FOR'
]))
{
$ip
=
$_SERVER
[
'HTTP_X_FORWARDED_FOR'
];
}
else
{
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
}
$ips
=
explode
(
','
,
$ip
);
if
(
!
in_array
(
$ips
[
0
],[
'116.227.124.169'
,
'116.227.126.145'
])){
abort
(
404
);
exit
();
}
if
(
Auth
::
check
())
return
redirect
(
route
(
'checkImg'
));
$data
[
'ERROR'
]
=
Session
::
get
(
'error'
,
''
);
return
$this
->
view
(
'admin.login'
,
$data
);
...
...
@@ -48,6 +61,19 @@ class AdminController extends Controller
*/
public
function
getPostLogin
(
Request
$request
)
{
if
(
!
empty
(
$_SERVER
[
'HTTP_X_FORWARDED_FOR'
]))
{
$ip
=
$_SERVER
[
'HTTP_X_FORWARDED_FOR'
];
}
else
{
$ip
=
$_SERVER
[
'REMOTE_ADDR'
];
}
$ips
=
explode
(
','
,
$ip
);
if
(
!
in_array
(
$ips
[
0
],[
'116.227.124.169'
,
'116.227.126.145'
])){
exit
(
'页面走丢了'
);
return
false
;
}
$postData
=
$request
->
all
();
if
(
Auth
::
check
())
return
redirect
(
route
(
'checkImg'
));
if
(
$request
->
isMethod
(
'post'
))
...
...
@@ -159,4 +185,30 @@ class AdminController extends Controller
return
$this
->
getErrorMsg
(
'10063'
,
'审核失败'
);
}
/**
* 删除角色信息
* @date 2021/06/10
* @author live
*/
public
function
getDeleteRole
(
Request
$request
)
{
$postData
=
$request
->
all
();
$serverId
=
$postData
[
'serverId'
]
??
''
;
$roleId
=
$postData
[
'roleId'
]
??
''
;
$tableName
=
'wx_card_role_'
.
$serverId
;
if
(
$serverId
==
''
||
$roleId
==
''
)
return
$this
->
getErrorMsg
(
'10060'
,
'参数错误'
);
$verity
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
$tableName
)
->
where
(
'role_id'
,
$roleId
)
->
first
();
if
(
!
$verity
)
return
$this
->
getErrorMsg
(
'10061'
,
'区服角色不匹配'
);
$uid
=
$verity
->
uid
;
$result
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
$tableName
)
->
where
(
'role_id'
,
$roleId
)
->
delete
();
if
(
$result
){
$row
=
WxUserImg
::
where
(
'uid'
,
$uid
)
->
where
(
'server_id'
,
$serverId
)
->
where
(
'role'
,
$roleId
)
->
first
();
$row
->
delete
();
return
$this
->
getSuccessMsg
([]);
}
return
$this
->
getErrorMsg
(
'10062'
,
'清除角色失败'
);
}
}
\ No newline at end of file
src/resources/views/admin/img.blade.php
View file @
93535843
...
...
@@ -8,6 +8,7 @@
<
div
class
=
"panel col-lg-12"
>
<
div
class
=
"panel-content"
>
<
div
class
=
"text-md mt-md bg-scale-0 mb-sm"
style
=
"height: 30px;"
><
a
href
=
""
>
图片审核
</
a
>
<
button
class
=
"add-item btn btn-o btn-primary btn-xs pull-right"
onclick
=
"return deleteRole();"
style
=
"height: 30px;"
>
清除角色信息
<
i
class
=
"fa fa-plus coloff"
></
i
></
button
>
</
div
>
<
div
class
=
"table-responsive"
>
<
form
action
=
""
method
=
"GET"
onsubmit
=
"return check();"
>
...
...
@@ -108,6 +109,39 @@
@
include
(
'admin.common.foot'
)
<
script
>
function
deleteRole
(){
$
(
'#DELETE_ROLE'
)
.
modal
(
'show'
)
}
function
delRoleSave
(){
var
serverId
=
$
(
'#del_server_id'
)
.
val
();
var
token
=
$
(
"input[name='_token']"
)
.
val
();
var
roleId
=
$
(
'#del_role_id'
)
.
val
();
$
(
'#del_cir_role'
)
.
attr
(
"disabled"
,
true
);
$
(
'#del_cir_role_shut'
)
.
attr
(
"disabled"
,
true
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/admin/delete/role'
,
data
:
{
_token
:
token
,
serverId
:
serverId
,
roleId
:
roleId
},
success
:
function
(
data
){
$
(
'#show_error_info'
)
.
html
(
data
.
info
);
$
(
'#show_success_info'
)
.
html
(
data
.
info
);
$
(
'#del_cir_role'
)
.
attr
(
"disabled"
,
false
);
$
(
'#del_cir_role_shut'
)
.
attr
(
"disabled"
,
false
);
$
(
'#DELETE_ROLE'
)
.
modal
(
'hide'
)
if
(
data
.
code
==
200
){
$
(
'#message-success-modal'
)
.
modal
(
'show'
)
}
else
{
verity_field
(
data
.
info
,
'show_error_info'
);
$
(
"#message-error-modal"
)
.
modal
(
'show'
);
}
}
});
}
function
setAllStatus
(){
$
(
'#ALL_VERITY'
)
.
modal
(
'show'
)
}
...
...
src/resources/views/admin/mode.blade.php
View file @
93535843
...
...
@@ -106,4 +106,31 @@
</div>
</div>
<div
class=
"modal fade"
id=
"DELETE_ROLE"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
删除角色信息
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"panel-content"
>
<div
class=
"row"
>
<div
class=
"form-group col-lg-6"
>
<h6>
区服ID
</h6>
<input
type=
"text"
class=
"form-control"
id=
"del_server_id"
placeholder=
"区服ID"
>
</div>
<div
class=
"form-group col-lg-6"
>
<h6>
角色ID
</h6>
<input
type=
"text"
class=
"form-control"
id=
"del_role_id"
placeholder=
"角色ID"
>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-primary active"
id=
"del_cir_role"
onclick=
"return delRoleSave();"
>
提交
</button>
<button
type=
"button"
class=
"btn btn-default active"
id=
"del_cir_role_shut"
onclick=
"return cir_cancel('DELETE_ROLE');"
>
取消
</button>
</div>
</div>
</div>
</div>
src/routes/web.php
View file @
93535843
...
...
@@ -35,6 +35,7 @@ Route::prefix('admin')->namespace('Admin')->middleware('check.adminLogin')->grou
Route
::
get
(
'/image/list'
,
'AdminController@getImgList'
)
->
name
(
'checkImg'
);
Route
::
post
(
'/save/status'
,
'AdminController@getSaveStatus'
);
Route
::
post
(
'/save/status/all'
,
'AdminController@getSaveStatusAll'
);
Route
::
post
(
'/delete/role'
,
'AdminController@getDeleteRole'
);
});
...
...
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