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
7b9f04b3
Commit
7b9f04b3
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
234e789c
c105c75c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
7 deletions
+57
-7
src/app/Http/Controllers/Admin/AdminController.php
src/app/Http/Controllers/Admin/AdminController.php
+1
-1
src/app/Http/Controllers/Card/CardController.php
src/app/Http/Controllers/Card/CardController.php
+14
-4
src/app/Http/Controllers/Card/HomeController.php
src/app/Http/Controllers/Card/HomeController.php
+3
-0
src/app/Http/Controllers/HomeController.php
src/app/Http/Controllers/HomeController.php
+7
-0
src/app/Services/UtilService.php
src/app/Services/UtilService.php
+0
-1
src/public/cardImg/202106/10/2021061009424833748-1.png
src/public/cardImg/202106/10/2021061009424833748-1.png
+0
-0
src/resources/views/404.blade.php
src/resources/views/404.blade.php
+28
-0
src/resources/views/404.html
src/resources/views/404.html
+1
-1
src/resources/views/admin/img.blade.php
src/resources/views/admin/img.blade.php
+2
-0
src/routes/web.php
src/routes/web.php
+1
-0
No files found.
src/app/Http/Controllers/Admin/AdminController.php
View file @
7b9f04b3
...
...
@@ -95,7 +95,7 @@ class AdminController extends Controller
return
$query
->
where
(
'updated_at'
,
'<'
,
$endTime
);
})
->
when
(
$status
==
0
,
function
(
$query
)
use
(
$status
)
{
return
$query
->
orderBy
(
'status'
,
'ASC'
);
})
->
orderBy
(
'updated_at'
,
'DESC'
)
->
select
(
'id'
,
'uid'
,
'loacl_url'
,
'img_url'
,
'status'
,
'is_upload'
,
'updated_at'
)
->
paginate
(
$pageNum
);
})
->
orderBy
(
'updated_at'
,
'DESC'
)
->
select
(
'id'
,
'uid'
,
'role_id'
,
'role'
,
'loacl_url'
,
'img_url'
,
'status'
,
'is_upload'
,
'updated_at'
)
->
paginate
(
$pageNum
);
if
(
$startTime
!=
''
)
$paginateAppends
[
'startTime'
]
=
$startTime
;
if
(
$endTime
!=
''
)
$paginateAppends
[
'endTime'
]
=
$endTime
;
if
(
$userName
!=
''
)
$paginateAppends
[
'user'
]
=
$userName
;
...
...
src/app/Http/Controllers/Card/CardController.php
View file @
7b9f04b3
...
...
@@ -293,7 +293,7 @@ class CardController extends Controller
$tableName
=
'wx_card_role_'
.
$serverId
;
$role
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
$tableName
)
->
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
select
(
'id'
)
->
first
();
$img
=
$this
->
getUpdateImg
(
$result
[
'data'
],
$userId
,
$role
->
id
,
$serverId
);
$img
=
$this
->
getUpdateImg
(
$result
[
'data'
],
$userId
,
$role
->
id
,
$serverId
,
$roleId
);
if
(
$img
)
return
$this
->
jsonReturn
(
0
,
'上传成功'
);
Cache
::
forget
(
$userId
.
':card:upload:image'
);
return
$this
->
jsonReturn
(
10060
,
'上传失败'
);
...
...
@@ -306,7 +306,7 @@ class CardController extends Controller
* @date 2021/06/01
* @author live
*/
public
function
getUpdateImg
(
$data
,
$userId
,
$roleId
,
$serverId
)
public
function
getUpdateImg
(
$data
,
$userId
,
$roleId
,
$serverId
,
$role
=
''
)
{
$img
=
WxUserImg
::
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
where
(
'server_id'
,
$serverId
)
->
first
();
if
(
$img
){
...
...
@@ -321,6 +321,7 @@ class CardController extends Controller
$row
->
uid
=
$userId
;
$row
->
role_id
=
$roleId
;
$row
->
server_id
=
$serverId
;
$row
->
role
=
$role
;
$row
->
loacl_url
=
$data
[
'url'
];
$row
->
img_url
=
$data
[
'yunUrl'
];
$row
->
status
=
0
;
...
...
@@ -342,7 +343,10 @@ class CardController extends Controller
$roleId
=
$request
->
input
(
'roleId'
);
$serverId
=
$request
->
input
(
'serverId'
);
if
(
Cache
::
has
(
'card:num:'
.
$userId
.
':'
.
$roleId
))
return
exit
(
'页面走丢了,请稍后再试!'
);
if
(
Cache
::
has
(
'card:num:'
.
$userId
.
':'
.
$roleId
)){
$num
=
Cache
::
get
(
'card:num:'
.
$userId
.
':'
.
$roleId
);
if
(
$num
>
3
)
return
exit
(
'页面走丢了,请稍后再试!'
);
}
if
(
Cache
::
has
(
'card:info:'
.
$userId
.
':'
.
$roleId
)){
$data
=
Cache
::
get
(
'card:info:'
.
$userId
.
':'
.
$roleId
);
...
...
@@ -460,7 +464,13 @@ class CardController extends Controller
Cache
::
put
(
'card:info:'
.
$userId
.
':'
.
$roleId
,
300
,
$data
);
}
Cache
::
put
(
'card:num:'
.
$userId
.
':'
.
$roleId
,
1
,
5
);
if
(
Cache
::
has
(
'card:num:'
.
$userId
.
':'
.
$roleId
)){
$num
=
Cache
::
get
(
'card:num:'
.
$userId
.
':'
.
$roleId
)
+
1
;
Cache
::
forget
(
'card:num:'
.
$userId
.
':'
.
$roleId
);
Cache
::
put
(
'card:num:'
.
$userId
.
':'
.
$roleId
,
$num
,
3
);
}
else
{
Cache
::
put
(
'card:num:'
.
$userId
.
':'
.
$roleId
,
1
,
3
);
}
return
view
(
'card.card'
,
$data
);
}
}
\ No newline at end of file
src/app/Http/Controllers/Card/HomeController.php
View file @
7b9f04b3
...
...
@@ -9,6 +9,7 @@ use Exception;
use
Carbon\Carbon
;
use
Illuminate\Validation\Rule
;
use
App\Models\User
;
use
App\Services\UtilService
;
class
HomeController
extends
Controller
{
...
...
@@ -26,6 +27,8 @@ class HomeController extends Controller
*/
public
function
getHome
(
Request
$request
)
{
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
if
(
!
$isWx
)
return
redirect
(
route
(
'wxIndex'
));
$data
=
[];
if
(
$request
->
session
()
->
get
(
'uid'
)){
$userId
=
$request
->
session
()
->
get
(
'uid'
);
...
...
src/app/Http/Controllers/HomeController.php
View file @
7b9f04b3
...
...
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Validator;
use
Throwable
;
use
Exception
;
use
Carbon\Carbon
;
use
App\Services\UtilService
;
class
HomeController
extends
Controller
{
...
...
@@ -27,4 +28,10 @@ class HomeController extends Controller
$data
=
[];
return
view
(
'index'
,
$data
);
}
public
function
getError
()
{
$data
=
[];
return
view
(
'404'
,
$data
);
}
}
\ No newline at end of file
src/app/Services/UtilService.php
View file @
7b9f04b3
...
...
@@ -194,7 +194,6 @@ class UtilService
public
static
function
getIsWx
(
$httpUserAgent
)
{
return
true
;
if
(
strpos
(
$httpUserAgent
,
'MicroMessenger'
)
!==
false
)
{
return
true
;
}
else
{
...
...
src/public/cardImg/202106/10/2021061009424833748-1.png
0 → 100644
View file @
7b9f04b3
750 KB
src/resources/views/404.blade.php
0 → 100644
View file @
7b9f04b3
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
404
</title>
<style>
.no-found
{
text-align
:
center
;
font-size
:
12px
;
color
:
#333
;
}
.no-found
img
{
width
:
120px
;
display
:
block
;
margin
:
100px
auto
12px
;
}
</style>
</head>
<body>
<div
class=
"no-found"
>
<img
src=
"https://aldzn-ios-cdn.aldzn.cn/ucCard/postcard/images/404.png"
alt=
""
>
<span>
页面走丢了。。。
</span>
</div>
</body>
</html>
\ No newline at end of file
src/resources/views/404.html
View file @
7b9f04b3
...
...
@@ -21,7 +21,7 @@
</head>
<body>
<div
class=
"no-found"
>
<img
src=
"
../../public/static
/postcard/images/404.png"
alt=
""
>
<img
src=
"
https://aldzn-ios-cdn.aldzn.cn/ucCard
/postcard/images/404.png"
alt=
""
>
<span>
页面走丢了。。。
</span>
</div>
</body>
...
...
src/resources/views/admin/img.blade.php
View file @
7b9f04b3
...
...
@@ -43,6 +43,7 @@
<
th
>
操作
<
input
type
=
"checkbox"
value
=
"all"
onclick
=
"return imgCheck(this);"
/><
label
class
=
"ml-sm"
>
全选
</
label
><
button
type
=
"button"
class
=
"btn btn-success"
onclick
=
"return setAllStatus();"
>
审核
</
button
></
th
>
<
th
>
编号
</
th
>
<
th
>
用户名
</
th
>
<
th
>
角色
</
th
>
<
th
>
审核
</
th
>
<
th
>
状态
</
th
>
<
th
>
图片
</
th
>
...
...
@@ -56,6 +57,7 @@
<
td
>
<
input
type
=
"checkbox"
name
=
"ids[]"
value
=
"{{
$li->id
}}"
class
=
"imgIDCheckbox"
/></
td
>
<
td
>
{{
@
$li
->
id
}}
</
td
>
<
td
>
{{
$USER_INFO
[
$li
->
uid
]
??
''
}}
</
td
>
<
td
>
{{
$li
->
role
??
''
}}
</
td
>
<
td
>
@
if
(
$li
->
status
==
0
)
<
button
type
=
"button"
class
=
"btn btn-success"
onclick
=
"return setStatus({{
$li->id
}});"
>
审核
</
button
>
...
...
src/routes/web.php
View file @
7b9f04b3
...
...
@@ -11,6 +11,7 @@
|
*/
Route
::
any
(
'/wx/home'
,
'HomeController@getIndex'
)
->
name
(
'wxIndex'
);
Route
::
any
(
'/404'
,
'HomeController@getError'
);
Route
::
prefix
(
'service'
)
->
group
(
function
()
{
Route
::
post
(
'/get_authcode'
,
'ToolController@authcode'
);
...
...
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