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
54338fd7
Commit
54338fd7
authored
Jun 07, 2021
by
zhoujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
f2b10f4d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
162 deletions
+82
-162
src/app/Http/Controllers/Admin/AdminController.php
src/app/Http/Controllers/Admin/AdminController.php
+0
-33
src/app/Http/Controllers/Platform/HomeController.php
src/app/Http/Controllers/Platform/HomeController.php
+13
-4
src/app/Http/Controllers/WX/HomeController.php
src/app/Http/Controllers/WX/HomeController.php
+0
-39
src/app/Http/Controllers/WX/SignController.php
src/app/Http/Controllers/WX/SignController.php
+55
-68
src/app/Http/Middleware/CheckLogin.php
src/app/Http/Middleware/CheckLogin.php
+2
-4
src/resources/views/index.blade.php
src/resources/views/index.blade.php
+1
-5
src/routes/web.php
src/routes/web.php
+11
-9
No files found.
src/app/Http/Controllers/Admin/AdminController.php
View file @
54338fd7
...
@@ -70,39 +70,6 @@ class AdminController extends Controller
...
@@ -70,39 +70,6 @@ class AdminController extends Controller
*/
*/
public
function
getImgList
(
Request
$request
)
public
function
getImgList
(
Request
$request
)
{
{
$array
=
[];
$roles
=
WxBindRole
::
get
();
foreach
(
$roles
as
$role
){
$tem
[
0
]
=
$role
->
uid
;
$tem
[
1
]
=
$role
->
server_id
;
$tem
[
2
]
=
$role
->
server_name
;
$tem
[
3
]
=
'\''
.
(
string
)
$role
->
role_id
;
$tem
[
4
]
=
$role
->
role_name
;
$tem
[
5
]
=
$role
->
user_id
;
$tem
[
6
]
=
$role
->
channel
;
$array
[
$role
->
uid
]
=
$tem
;
}
$title
=
[
'用户ID'
,
'服务器ID'
,
'服务器名称'
,
'角色ID'
,
'角色名称'
,
'阿拉德用户ID'
,
'渠道'
];
header
(
"Content-type:application/vnd.ms-excel"
);
header
(
"Content-Disposition:filename=dataUser.xls"
);
echo
"<table><tr>"
;
foreach
(
$title
as
$ti
){
echo
"<th>"
.
$ti
.
"</th>"
;
}
echo
"</tr>"
;
foreach
(
$array
as
$val
){
echo
"<tr>"
;
foreach
(
$val
as
$v
){
echo
"<td>"
.
$v
.
"</td>"
;
}
echo
"</tr>"
;
}
echo
"</table>"
;
exit
();
$postData
=
$request
->
all
();
$postData
=
$request
->
all
();
$pageNum
=
20
;
$pageNum
=
20
;
$startTime
=
$postData
[
'startTime'
]
??
''
;
$startTime
=
$postData
[
'startTime'
]
??
''
;
...
...
src/app/Http/Controllers/Platform/HomeController.php
View file @
54338fd7
...
@@ -16,14 +16,18 @@ class HomeController extends Controller
...
@@ -16,14 +16,18 @@ class HomeController extends Controller
public
function
showLoginForm
(
Request
$request
)
public
function
showLoginForm
(
Request
$request
)
{
{
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
$data
[
'isWx'
]
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
if
(
!
$isWx
)
return
redirect
(
route
(
"wxIndex"
));
$data
[
'isWx'
]
=
$isWx
;
return
view
(
"home.login"
,
$data
);
return
view
(
"home.login"
,
$data
);
}
}
public
function
showRegisterForm
(
Request
$request
)
public
function
showRegisterForm
(
Request
$request
)
{
{
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
$data
[
'isWx'
]
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
if
(
!
$isWx
)
return
redirect
(
route
(
"wxIndex"
));
$data
[
'isWx'
]
=
$isWx
;
return
view
(
"home.register"
,
$data
);
return
view
(
"home.register"
,
$data
);
}
}
...
@@ -31,14 +35,19 @@ class HomeController extends Controller
...
@@ -31,14 +35,19 @@ class HomeController extends Controller
{
{
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
$viewData
[
'kefuURL'
]
=
''
;
$viewData
[
'kefuURL'
]
=
''
;
$viewData
[
'isWx'
]
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
if
(
!
$isWx
)
return
redirect
(
route
(
"wxIndex"
));
$viewData
[
'isWx'
]
=
$isWx
;
return
view
(
"home.findPassword"
,
$viewData
);
return
view
(
"home.findPassword"
,
$viewData
);
}
}
public
function
showAldLoginForm
(
Request
$request
)
public
function
showAldLoginForm
(
Request
$request
)
{
{
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
$data
[
'isWx'
]
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
if
(
!
$isWx
)
return
redirect
(
route
(
"wxIndex"
));
$data
[
'isWx'
]
=
$isWx
;
return
view
(
"home.ald_login"
,
$data
);
return
view
(
"home.ald_login"
,
$data
);
}
}
...
...
src/app/Http/Controllers/WX/HomeController.php
View file @
54338fd7
...
@@ -21,45 +21,6 @@ class HomeController extends Controller
...
@@ -21,45 +21,6 @@ class HomeController extends Controller
$this
->
time
=
Carbon
::
now
()
->
format
(
'Y-m-d H:i:s'
);
$this
->
time
=
Carbon
::
now
()
->
format
(
'Y-m-d H:i:s'
);
}
}
/**
* 微信公众号签到首页
* @date 2021/05/26
* @author live
*/
public
function
getHome
(
Request
$request
){
if
(
$request
->
session
()
->
get
(
"uid"
))
return
redirect
(
route
(
"index"
));
$isLogin
=
0
;
$userName
=
''
;
$serverName
=
''
;
$roleName
=
''
;
$isBandOrange
=
0
;
$bindOrangeUrl
=
route
(
"aldCode"
);
$isBindRole
=
0
;
$startTime
=
strtotime
(
config
(
'sign.date'
));
$endTime
=
$startTime
+
15
*
86400
-
1
;
$num
=
intval
((
strtotime
(
date
(
'Y-m-d'
))
-
strtotime
(
date
(
'Y-m-d'
,
$startTime
)))
/
86400
)
+
1
;
$data
[
'num'
]
=
$num
;
$data
[
'startTime'
]
=
date
(
'Y'
,
$startTime
)
.
'年'
.
date
(
'm'
,
$startTime
)
.
'月'
.
date
(
'd'
,
$startTime
)
.
'日'
;
$data
[
'endTime'
]
=
date
(
'Y'
,
$endTime
)
.
'年'
.
date
(
'm'
,
$endTime
)
.
'月'
.
date
(
'd'
,
$endTime
)
.
'日'
;
$data
[
'signGift'
]
=
config
(
'sign.sign'
);
$data
[
'continueSign'
]
=
config
(
'sign.continueSign'
);
$data
[
'signDay'
]
=
0
;
$data
[
'isLogin'
]
=
$isLogin
;
$data
[
'userName'
]
=
$userName
;
$data
[
'serverName'
]
=
$serverName
;
$data
[
'roleName'
]
=
$roleName
;
$data
[
'isBandOrange'
]
=
$isBandOrange
;
$data
[
'bindOrangeUrl'
]
=
$bindOrangeUrl
;
$data
[
'isBindRole'
]
=
$isBindRole
;
$data
[
'loginUrl'
]
=
route
(
"login"
);
$data
[
'loginOutUrl'
]
=
route
(
"logout"
);
$data
[
'isWx'
]
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
return
view
(
"wx.signIndex"
,
$data
);
}
/**
/**
* 验证微信token
* 验证微信token
* @return array
* @return array
...
...
src/app/Http/Controllers/WX/SignController.php
View file @
54338fd7
...
@@ -176,10 +176,10 @@ class SignController extends Controller
...
@@ -176,10 +176,10 @@ class SignController extends Controller
public
function
getSign
(
Request
$request
)
public
function
getSign
(
Request
$request
)
{
{
$uid
=
$request
->
session
()
->
get
(
"uid"
);
$uid
=
$request
->
session
()
->
get
(
"uid"
);
if
(
empty
(
$uid
))
return
$this
->
jsonReturn
(
1019
,
"登陆失效或未登陆,请重新登陆"
);
if
(
empty
(
$uid
))
return
$this
->
jsonReturn
(
1019
,
"登陆失效或未登陆,请重新登陆"
);
$userExtra
=
UserExtra
::
find
(
$uid
);
$userExtra
=
UserExtra
::
find
(
$uid
);
if
(
empty
(
$userExtra
->
aldzn_info
))
return
$this
->
jsonReturn
(
4003
,
"请您先绑定Orange识别码后再绑定角色签到领取礼包哦~"
);
if
(
empty
(
$userExtra
->
aldzn_info
))
return
$this
->
jsonReturn
(
4003
,
"请您先绑定Orange识别码后再绑定角色签到领取礼包哦~"
);
$verityBind
=
WxBindRole
::
where
(
'uid'
,
$uid
)
->
first
();
$verityBind
=
WxBindRole
::
where
(
'uid'
,
$uid
)
->
first
();
if
(
!
$verityBind
)
return
$this
->
jsonReturn
(
10004
,
"请您绑定角色后再来签到领取礼包"
);
if
(
!
$verityBind
)
return
$this
->
jsonReturn
(
10004
,
"请您绑定角色后再来签到领取礼包"
);
...
@@ -190,23 +190,17 @@ class SignController extends Controller
...
@@ -190,23 +190,17 @@ class SignController extends Controller
if
(
$now
<
$startTime
||
$now
>
$endTime
)
return
$this
->
jsonReturn
(
10009
,
"签到活动只在"
.
date
(
'Y-m-d H:i:s'
,
$startTime
)
.
'--'
.
date
(
'Y-m-d H:i:s'
,
$endTime
)
.
'时间段开放'
);
if
(
$now
<
$startTime
||
$now
>
$endTime
)
return
$this
->
jsonReturn
(
10009
,
"签到活动只在"
.
date
(
'Y-m-d H:i:s'
,
$startTime
)
.
'--'
.
date
(
'Y-m-d H:i:s'
,
$endTime
)
.
'时间段开放'
);
if
(
Cache
::
has
(
$uid
.
':sign:click'
)){
if
(
Cache
::
has
(
$uid
.
':sign:click'
)){
// exit(
);
return
$this
->
jsonReturn
(
10022
,
"请勿重复签到"
);
}
else
{
}
else
{
Cache
::
put
(
$uid
.
':sign:click'
,
1
,
30
);
Cache
::
put
(
$uid
.
':sign:click'
,
1
,
60
);
}
$ym
=
date
(
'Ym'
);
$ym
=
date
(
'Ym'
);
$tableName
=
'wx_sign_log_'
.
$ym
;
$tableName
=
'wx_sign_log_'
.
$ym
;
$this
->
getCheckSignLogTable
(
$tableName
);
$this
->
getCheckSignLogTable
(
$tableName
);
$ymd
=
date
(
'ymd'
);
$ymd
=
date
(
'ymd'
);
$verity
=
$this
->
getVeritySign
(
$uid
,
$ymd
,
$tableName
);
$verity
=
$this
->
getVeritySign
(
$uid
,
$ymd
,
$tableName
);
if
(
!
$verity
)
return
$this
->
jsonReturn
(
10005
,
"您今天已签到,请勿重复签到"
);
if
(
!
$verity
)
return
$this
->
jsonReturn
(
10005
,
"您今天已签到,请勿重复签到"
);
$result
=
$this
->
getSendGift
(
$verityBind
);
$startTime
=
config
(
'sign.date'
);
//if($result['code'] != 200) return $this->jsonReturn(10006, "签到失败");
$num
=
intval
((
strtotime
(
date
(
'Y-m-d'
))
-
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
$startTime
))))
/
86400
)
+
1
;
$startTime
=
strtotime
(
config
(
'sign.date'
));
$num
=
intval
((
strtotime
(
date
(
'Y-m-d'
))
-
strtotime
(
date
(
'Y-m-d'
,
$startTime
)))
/
86400
)
+
1
;
DB
::
connection
(
'wx_mysql'
)
->
beginTransaction
();
DB
::
connection
(
'wx_mysql'
)
->
beginTransaction
();
try
{
try
{
$this
->
getInsertLog
(
$uid
,
$tableName
,
$ymd
);
$this
->
getInsertLog
(
$uid
,
$tableName
,
$ymd
);
...
@@ -214,12 +208,12 @@ class SignController extends Controller
...
@@ -214,12 +208,12 @@ class SignController extends Controller
$this
->
getAddAldSignGift
(
$uid
,
$num
,
1
);
$this
->
getAddAldSignGift
(
$uid
,
$num
,
1
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
DB
::
connection
(
'wx_mysql'
)
->
rollBack
();
DB
::
connection
(
'wx_mysql'
)
->
rollBack
();
Cache
::
forget
(
$uid
.
':sign:click'
);
return
$this
->
jsonReturn
(
10006
,
"签到失败"
);
return
$this
->
jsonReturn
(
10006
,
'签到失败'
);
}
}
//$this->getSendGift($verityBind,$num);
DB
::
connection
(
'wx_mysql'
)
->
commit
();
DB
::
connection
(
'wx_mysql'
)
->
commit
();
Cache
::
forget
(
$uid
.
':sign:click'
);
return
$this
->
jsonReturn
(
0
,
"签到成功,签到礼包发送中,稍后请去绑定角色的邮箱查收"
);
return
$this
->
jsonReturn
(
0
,
"签到成功,签到礼包已成功发送,请去绑定角色的邮箱查收"
);
}
}
}
/**
/**
...
@@ -230,6 +224,8 @@ class SignController extends Controller
...
@@ -230,6 +224,8 @@ class SignController extends Controller
*/
*/
public
function
getAddAldSignGift
(
$uid
,
$num
,
$type
)
public
function
getAddAldSignGift
(
$uid
,
$num
,
$type
)
{
{
$verity
=
WxAldGift
::
where
(
'uid'
,
$uid
)
->
where
(
'gift_id'
,
$num
)
->
where
(
'type'
,
$type
)
->
first
();
if
(
!
$verity
){
$giftArr
=
[];
$giftArr
=
[];
if
(
$type
==
1
)
$giftArr
=
config
(
'sign.sign'
);
if
(
$type
==
1
)
$giftArr
=
config
(
'sign.sign'
);
if
(
$type
==
2
)
$giftArr
=
config
(
'sign.continueSign'
);
if
(
$type
==
2
)
$giftArr
=
config
(
'sign.continueSign'
);
...
@@ -239,9 +235,12 @@ class SignController extends Controller
...
@@ -239,9 +235,12 @@ class SignController extends Controller
$row
->
gift_id
=
$num
;
$row
->
gift_id
=
$num
;
$row
->
gift_num
=
$gift
[
'itemNum'
]
??
1
;
$row
->
gift_num
=
$gift
[
'itemNum'
]
??
1
;
$row
->
type
=
$type
;
$row
->
type
=
$type
;
$row
->
status
=
0
;
$row
->
remark
=
json_encode
(
$gift
);
$row
->
remark
=
json_encode
(
$gift
);
$row
->
save
();
$row
->
save
();
}
}
return
true
;
}
/**
/**
* 更新用户签到表
* 更新用户签到表
...
@@ -259,6 +258,9 @@ class SignController extends Controller
...
@@ -259,6 +258,9 @@ class SignController extends Controller
$array
[]
=
date
(
'Ymd'
);
$array
[]
=
date
(
'Ymd'
);
$sign
->
sign_data
=
json_encode
(
array_unique
(
array_values
(
$array
)));
$sign
->
sign_data
=
json_encode
(
array_unique
(
array_values
(
$array
)));
$sign
->
save
();
$sign
->
save
();
}
else
{
$sign
->
sign_data
=
json_encode
(
array_values
(
$array
));
$sign
->
save
();
}
}
return
$sign
;
return
$sign
;
}
else
{
}
else
{
...
@@ -326,12 +328,12 @@ class SignController extends Controller
...
@@ -326,12 +328,12 @@ class SignController extends Controller
* @date 2021/05/26
* @date 2021/05/26
* @author live
* @author live
*/
*/
public
function
getSendGift
(
WxBindRole
$role
)
public
function
getSendGift
(
WxBindRole
$role
,
$num
)
{
{
$array
=
[
'code'
=>
200
,
'num'
=>
1
];
$array
=
[
'code'
=>
200
,
'num'
=>
1
];
$giftArr
=
config
(
'sign.sign'
);
$giftArr
=
config
(
'sign.sign'
);
$startTime
=
config
(
'sign.date'
);
//
$startTime = config('sign.date');
$num
=
intval
((
strtotime
(
date
(
'Y-m-d'
))
-
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
$startTime
))))
/
86400
)
+
1
;
//
$num = intval((strtotime(date('Y-m-d')) - strtotime(date('Y-m-d',strtotime($startTime)))) / 86400) + 1 ;
$gift
=
$giftArr
[
$num
]
??
[];
$gift
=
$giftArr
[
$num
]
??
[];
if
(
$num
<
1
||
$num
>
15
||
empty
(
$gift
)){
if
(
$num
<
1
||
$num
>
15
||
empty
(
$gift
)){
$array
[
'code'
]
=
400
;
$array
[
'code'
]
=
400
;
...
@@ -363,8 +365,7 @@ class SignController extends Controller
...
@@ -363,8 +365,7 @@ class SignController extends Controller
public
function
geSendSignGift
(
Request
$request
)
public
function
geSendSignGift
(
Request
$request
)
{
{
$uid
=
$request
->
session
()
->
get
(
"uid"
);
$uid
=
$request
->
session
()
->
get
(
"uid"
);
if
(
empty
(
$uid
))
return
$this
->
jsonReturn
(
1019
,
"登陆失效或未登陆,请重新登陆"
);
if
(
empty
(
$uid
))
return
$this
->
jsonReturn
(
1019
,
"登陆失效或未登陆,请重新登陆"
);
$role
=
WxBindRole
::
where
(
'uid'
,
$uid
)
->
first
();
$role
=
WxBindRole
::
where
(
'uid'
,
$uid
)
->
first
();
if
(
!
$role
)
return
$this
->
jsonReturn
(
10004
,
"请您绑定角色后再来签到领取礼包"
);
if
(
!
$role
)
return
$this
->
jsonReturn
(
10004
,
"请您绑定角色后再来签到领取礼包"
);
...
@@ -373,36 +374,22 @@ class SignController extends Controller
...
@@ -373,36 +374,22 @@ class SignController extends Controller
$sign
=
WxSign
::
where
(
'uid'
,
$uid
)
->
select
(
'id'
,
'sign_data'
)
->
first
();
$sign
=
WxSign
::
where
(
'uid'
,
$uid
)
->
select
(
'id'
,
'sign_data'
)
->
first
();
if
(
!
$sign
)
return
$this
->
jsonReturn
(
10010
,
"对不起,您不够领取礼包资格,请记得每天来签到"
);
if
(
!
$sign
)
return
$this
->
jsonReturn
(
10010
,
"对不起,您不够领取礼包资格,请记得每天来签到"
);
$signDay
=
json_decode
(
$sign
->
sign_data
,
true
);
$signDay
=
json_decode
(
$sign
->
sign_data
,
true
);
if
(
count
(
$signDay
)
<
$type
)
return
$this
->
jsonReturn
(
10010
,
"对不起,您不够领取礼包资格,请记得每天来签到"
);
if
(
count
(
$signDay
)
<
$type
)
return
$this
->
jsonReturn
(
10010
,
"对不起,您不够领取礼包资格,请记得每天来签到"
);
if
(
Cache
::
has
(
'send:gift:wx:'
.
$uid
)){
return
$this
->
jsonReturn
(
10022
,
"请勿重复点击领取"
);
}
else
{
$verity
=
WxAldGift
::
where
(
'uid'
,
$uid
)
->
where
(
'gift_id'
,
$type
)
->
where
(
'type'
,
2
)
->
first
();
$verity
=
WxAldGift
::
where
(
'uid'
,
$uid
)
->
where
(
'gift_id'
,
$type
)
->
where
(
'type'
,
2
)
->
first
();
if
(
$verity
)
return
$this
->
jsonReturn
(
10011
,
"您已经领取礼包,请勿重复领取"
);
if
(
$verity
)
return
$this
->
jsonReturn
(
10011
,
"您已经领取礼包,请勿重复领取"
);
if
(
Cache
::
has
(
$uid
.
':send:gift'
)){
Cache
::
put
(
'send:gift:wx:'
.
$uid
,
$uid
,
60
);
exit
();
$this
->
getAddAldSignGift
(
$uid
,
$type
,
2
);
}
else
{
return
$this
->
jsonReturn
(
0
,
"签到礼包发送中,稍后请去绑定角色的邮箱查收"
);
Cache
::
put
(
$uid
.
':send:gift'
,
1
,
30
);
}
}
$giftArr
=
config
(
'sign.continueSign'
);
$gift
=
$giftArr
[
$type
]
??
[];
$itemId
=
$gift
[
'itemId'
];
$itemNum
=
$gift
[
'itemNum'
];
$subject
=
config
(
'sign.signEmailTitle'
);
$content
=
config
(
'sign.signEmailContent'
);
$reason
=
config
(
'sign.signEmailReason'
);
$gmService
=
new
AldGmService
();
$result
=
$gmService
->
getSendSignRoleGift
(
$role
->
server_id
,
$role
->
role_id
,
$role
->
channel
,
$itemId
,
$itemNum
,
$subject
,
$content
,
$reason
);
if
(
$result
){
$this
->
getAddAldSignGift
(
$uid
,
$type
,
2
);
Cache
::
forget
(
$uid
.
':send:gift'
);
return
$this
->
jsonReturn
(
0
,
"签到礼包已成功发送,请去绑定角色的邮箱查收"
);
}
else
{
Cache
::
forget
(
$uid
.
':send:gift'
);
return
$this
->
jsonReturn
(
10012
,
"领取礼包失败"
);
}
}
}
}
}
\ No newline at end of file
src/app/Http/Middleware/CheckLogin.php
View file @
54338fd7
...
@@ -17,10 +17,8 @@ class CheckLogin
...
@@ -17,10 +17,8 @@ class CheckLogin
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
)
{
{
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
$isWx
=
UtilService
::
getIsWx
(
$_SERVER
[
'HTTP_USER_AGENT'
]);
if
(
!
$isWx
){
if
(
!
$isWx
)
return
redirect
(
route
(
'wxIndex'
));
echo
'请在微信中打开!'
;
exit
();
}
if
(
!
$request
->
session
()
->
get
(
"uid"
))
{
if
(
!
$request
->
session
()
->
get
(
"uid"
))
{
if
(
$request
->
expectsJson
())
{
if
(
$request
->
expectsJson
())
{
...
...
src/resources/views/index.blade.php
View file @
54338fd7
...
@@ -42,13 +42,9 @@
...
@@ -42,13 +42,9 @@
bottom
:
0
;
bottom
:
0
;
}
}
</style>
</style>
<script
src=
"{{ asset('js/jquery.2.1.3.min.js') }}"
></script>
<script
src=
"{{ asset('js/toast.js') }}"
></script>
<script
src=
"{{ asset('js/main.min.js?v=20210528') }}"
></script>
<script
src=
"{{ asset('js/sign.min.js?v=2021050802') }}"
></script>
</head>
</head>
<body>
<body>
<div
class=
"is-weixin
hide
"
>
<div
class=
"is-weixin"
>
<img
src=
"{{ asset('ald/sign/images/wx.png') }}"
class=
"m-img"
alt=
""
>
<img
src=
"{{ asset('ald/sign/images/wx.png') }}"
class=
"m-img"
alt=
""
>
</div>
</div>
</body>
</body>
...
...
src/routes/web.php
View file @
54338fd7
...
@@ -18,13 +18,12 @@ Route::prefix('service')->group(function() {
...
@@ -18,13 +18,12 @@ Route::prefix('service')->group(function() {
});
});
Route
::
namespace
(
'WX'
)
->
group
(
function
()
{
Route
::
namespace
(
'WX'
)
->
group
(
function
()
{
Route
::
get
(
'/'
,
'HomeController@getHome'
)
->
name
(
'noLoginIndex'
);
//微信公众号签到
Route
::
any
(
'/verity/wx'
,
'HomeController@getVerityWX'
);
Route
::
any
(
'/verity/wx'
,
'HomeController@getVerityWX'
);
});
});
Route
::
namespace
(
'Card'
)
->
group
(
function
()
{
Route
::
namespace
(
'Card'
)
->
group
(
function
()
{
Route
::
get
(
'/
card/index'
,
'HomeController@getHome'
)
->
name
(
'cardI
ndex'
);
//微信公众号明信片
Route
::
get
(
'/
'
,
'HomeController@getHome'
)
->
name
(
'i
ndex'
);
//微信公众号明信片
});
});
Route
::
prefix
(
'admin'
)
->
namespace
(
'Admin'
)
->
group
(
function
()
{
Route
::
prefix
(
'admin'
)
->
namespace
(
'Admin'
)
->
group
(
function
()
{
...
@@ -32,6 +31,12 @@ Route::prefix('admin')->namespace('Admin')->group(function() {
...
@@ -32,6 +31,12 @@ Route::prefix('admin')->namespace('Admin')->group(function() {
Route
::
post
(
'/post/login'
,
'AdminController@getPostLogin'
);
Route
::
post
(
'/post/login'
,
'AdminController@getPostLogin'
);
});
});
Route
::
prefix
(
'admin'
)
->
namespace
(
'Admin'
)
->
middleware
(
'check.adminLogin'
)
->
group
(
function
()
{
Route
::
get
(
'/image/list'
,
'AdminController@getImgList'
)
->
name
(
'checkImg'
);
Route
::
post
(
'/save/status'
,
'AdminController@getSaveStatus'
);
});
Route
::
namespace
(
"Platform"
)
->
group
(
function
()
{
Route
::
namespace
(
"Platform"
)
->
group
(
function
()
{
Route
::
get
(
"/login"
,
"HomeController@showLoginForm"
)
->
name
(
"login"
);
Route
::
get
(
"/login"
,
"HomeController@showLoginForm"
)
->
name
(
"login"
);
Route
::
post
(
"/login"
,
"UserController@login"
);
Route
::
post
(
"/login"
,
"UserController@login"
);
...
@@ -50,9 +55,9 @@ Route::namespace("Platform")->group(function() {
...
@@ -50,9 +55,9 @@ Route::namespace("Platform")->group(function() {
});
});
//
Route::namespace('Platform')->middleware('check.login')->group(function () {
Route
::
namespace
(
'Platform'
)
->
middleware
(
'check.login'
)
->
group
(
function
()
{
Route
::
namespace
(
'Platform'
)
->
group
(
function
()
{
//
Route::namespace('Platform')->group(function () {
Route
::
get
(
'/logout'
,
'UserController@logout'
)
->
name
(
'logout'
);
Route
::
get
(
"/logout"
,
"UserController@logout"
)
->
name
(
'logout'
);
Route
::
post
(
'/user/bind_aldzn'
,
'UserController@bindALD'
);
Route
::
post
(
'/user/bind_aldzn'
,
'UserController@bindALD'
);
Route
::
any
(
'/get_role_list'
,
'AldUserController@getRoleList'
);
Route
::
any
(
'/get_role_list'
,
'AldUserController@getRoleList'
);
...
@@ -78,9 +83,6 @@ Route::namespace('Card')->group(function() {
...
@@ -78,9 +83,6 @@ Route::namespace('Card')->group(function() {
});
});
Route
::
prefix
(
'admin'
)
->
namespace
(
'Admin'
)
->
middleware
(
'check.adminLogin'
)
->
group
(
function
()
{
Route
::
get
(
'/image/list'
,
'AdminController@getImgList'
)
->
name
(
'checkImg'
);
Route
::
post
(
'/save/status'
,
'AdminController@getSaveStatus'
);
});
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