YYC松鼠短视频系统V2.7版本bug 注册输入验证码提示邀请码,输入邀请码提示错误
修改以下2个部分:
application/api/controller/User.php
@@ -180,8 +180,8 @@ class User extends Controller
180
180
$phone = input(“phone/i”);//手机号
181
181
$user = Db(“user”)->where([‘phone’ => $phone])->find();
182
182
c
o
d
e
=
i
n
p
u
t
(
"
c
o
d
e
/
i
"
)
;
183
i
f
(
!
code = input("code/i"); 183 if (!
code=input("code/i");183if(!user) {
184
183
184
if (!$user) {
185
185
$have_invite_code = input(‘have_invite_code/i’);
186
186
p
a
r
e
n
t
=
N
U
L
L
;
187187
i
f
(
parent = NULL; 187 187 if (
parent=NULL;187187if(have_invite_code == 0) {
@@ -196,6 +196,15 @@ class User extends Controller
196
196
}
197
197
198
198
}
199
}
200
201
//判断短信验证码是否正确
202
if (!Sms::verifySms($phone, $code)) {
203
u_log(“手机用户” . KaTeX parse error: Expected 'EOF', got '}' at position 94: … }̲ 206 207 …user) {
199
208
200
209
//用户不存在,自动注册
201
210
$user = [
@@ -229,11 +238,6 @@ class User extends Controller
229
238
Db(“user”)->where([‘id’ => KaTeX parse error: Expected 'EOF', got '}' at position 93: … }̲ 231 240 …phone, $code)) {
234
u_log(“手机用户” . $phone . “登录失败”, ‘error’);
235
return error(“验证码错误”);
236
}
237
241
238
242
t
o
k
e
n
=
p
a
s
s
(
token = pass(
token=pass(phone . time() . getRandStr()) . $phone;
239
243
Db(“user”)->where([‘phone’ => $phone])->update([“token” => $token]);
application/api/controller/User.php
@@ -662,14 +662,7 @@ class User extends Controller
662
662
if ($user) {
663
663
return error(“该用户名已存在,请重新输入”);
664
664
}
665
$user = config(‘mail_user’);
666
$pass = config(‘mail_pass’);
667
$name = config(“mail_name”);
668
$smtp = config(‘mail_smtp’);
669
m
a
i
l
=
n
e
w
M
a
i
l
(
mail = new Mail(
mail=newMail(user,
p
a
s
s
,
pass,
pass,name,
s
m
t
p
)
;
670
i
f
(
!
smtp); 670 if(!
smtp);670if(!mail->verifyCode(
m
a
i
l
S
t
r
,
mailStr,
mailStr,vcode)){
671
return error(“验证码错误,请重新输入”);
672
}
665
673
666
//上级绑定
674
667
p
a
r
e
n
t
=
N
U
L
L
;
675668
i
f
(
s
t
r
l
e
n
(
parent = NULL; 675 668 if (strlen(
parent=NULL;675668if(strlen(invitecode) > 0) {
@@ -679,6 +672,16 @@ class User extends Controller
679
672
}
680
673
}
681
674
675
$user = config(‘mail_user’);
676
$pass = config(‘mail_pass’);
677
$name = config(“mail_name”);
678
$smtp = config(‘mail_smtp’);
679
m
a
i
l
=
n
e
w
M
a
i
l
(
mail = new Mail(
mail=newMail(user,
p
a
s
s
,
pass,
pass,name,
s
m
t
p
)
;
680
i
f
(
!
smtp); 680 if(!
smtp);680if(!mail->verifyCode(
m
a
i
l
S
t
r
,
mailStr,
mailStr,vcode)){
681
return error(“验证码错误,请重新输入”);
682
}
683
684
682
685
$user = [
683
686
“username” =>
u
s
e
r
n
a
m
e
,
68468
7
′
p
a
s
s
w
o
r
d
′
=
>
p
a
s
s
(
username, 684 687 'password' => pass(
username,684687′password′=>pass(password),