Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
quxiu
Commits
684d6145
Commit
684d6145
authored
Mar 29, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
踢人
parent
570b1c3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
3 deletions
+64
-3
application/Appapi/Controller/AuthController.class.php
+63
-3
themes/simplebootx/Appapi/Auth/authstep.html
+1
-0
No files found.
application/Appapi/Controller/AuthController.class.php
View file @
684d6145
...
...
@@ -102,14 +102,67 @@ class AuthController extends HomebaseController {
$uid
=
I
(
"uid"
);
$token
=
I
(
"token"
);
$fid
=
I
(
"fid"
);
if
(
!
$uid
||
!
$token
||
checkToken
(
$uid
,
$token
)
==
700
){
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'您的登陆状态失效,请重新登陆!'
));
exit
;
}
$data
[
'uid'
]
=
I
(
"uid"
);
$ff
=
[];
$userfam
=
false
;
if
(
!
empty
(
$fid
))
{
$Family
=
M
(
'family'
);
$familyinfo
=
$Family
->
where
(
"id=
{
$fid
}
"
)
->
find
();
if
(
!
$familyinfo
){
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'家族不存在'
));
exit
;
}
$Family
=
M
(
'family'
);
$user_family
=
M
(
"users_family"
);
$fam
=
$Family
->
where
(
"uid=
{
$uid
}
"
)
->
find
();
if
(
$fam
)
{
if
(
$fam
[
'state'
]
==
0
){
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'你已经拥有一个家族在申请中'
));
exit
;
}
else
if
(
$fam
[
'state'
]
==
2
){
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'你已经拥有一个家族'
));
exit
;
}
$Family
->
where
(
"uid=
{
$uid
}
"
)
->
delete
();
$user_family
->
where
(
"familyid=
{
$fam
[
'id'
]
}
"
)
->
delete
();
}
$userfam
=
$user_family
->
where
(
"uid=
{
$uid
}
"
)
->
find
();
if
(
$userfam
)
{
if
(
$userfam
[
'state'
]
==
"2"
)
{
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'你已经加入家族'
));
exit
;
}
$time
=
time
()
-
(
60
*
60
*
24
*
10
);
if
(
$userfam
[
'state'
]
==
"0"
&&
$userfam
[
'addtime'
]
>
$time
)
{
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'您加入家族的申请还在审核中,请耐心等待'
));
exit
;
}
}
$ff
=
array
(
'uid'
=>
$uid
,
'familyid'
=>
$fid
,
'addtime'
=>
time
(),
'uptime'
=>
time
(),
'reason'
=>
''
,
'state'
=>
'0'
,
'signout'
=>
'0'
,
'divide_family'
=>
'-1'
,
);
}
$data
[
'uid'
]
=
I
(
"uid"
);
$data
[
'real_name'
]
=
I
(
"real_name"
);
$data
[
'mobile'
]
=
I
(
"mobile"
);
$data
[
'cer_no'
]
=
I
(
"cer_no"
);
...
...
@@ -126,6 +179,13 @@ class AuthController extends HomebaseController {
}
if
(
$result
!==
false
){
if
(
!
empty
(
$ff
))
{
if
(
$userfam
)
{
$family
=
M
(
"users_family"
)
->
where
(
'id='
.
$userfam
[
'id'
])
->
save
(
$ff
);
}
else
{
$family
=
M
(
"users_family"
)
->
add
(
$ff
);
}
}
echo
json_encode
(
array
(
"ret"
=>
200
,
'data'
=>
array
(),
'msg'
=>
''
));
}
else
{
echo
json_encode
(
array
(
"ret"
=>
0
,
'data'
=>
array
(),
'msg'
=>
'提交失败,请重新提交'
));
...
...
themes/simplebootx/Appapi/Auth/authstep.html
View file @
684d6145
...
...
@@ -65,6 +65,7 @@
}
else
{
alert
(
'不是新注册用户'
);
}
alert
(
'添加家长id input name 为 fid, 可以为空'
);
var
uid
=
'{$uid}'
;
var
token
=
'{$token}'
;
var
vm
=
new
Vue
({
...
...
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