切换导航条
此项目
正在载入...
登录
潘浩文
/
scoreshop
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
7 years ago
提交
be0ff4704026662315bc3fb9a1d0afbd91c92d22
1 个父辈
246f4e23
1 个管道 的构建
通过
耗费 0 秒
1
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
39 行增加
和
6 行删除
app/user/controller/RegisterController.php
public/themes/simpleboot3/user/register.html
app/user/controller/RegisterController.php
查看文件 @
be0ff47
...
...
@@ -35,12 +35,12 @@ class RegisterController extends WeChatBaseController
public
function
getCode
(){
$param
=
$this
->
request
->
param
();
$code
=
cmf_get_verification_code
(
$param
[
'
phon
e'
],
4
);
$code
=
cmf_get_verification_code
(
$param
[
'
mobil
e'
],
4
);
// var_dump($code);
if
(
$code
)
{
$mobile
=
new
MobileService
();
$mobile
->
sendSMSS
(
$param
[
'phone'
],
$code
);
$re
=
cmf_verification_code_log
(
$param
[
'phone'
],
$code
,
time
()
+
60
);
$mobile
->
sendSMSS
(
$param
[
'mobile'
],
$code
);
$re
=
cmf_verification_code_log
(
$param
[
'mobile'
],
$code
,
time
()
+
60
);
if
(
$re
){
return
'验证码发送成功'
;
}
else
{
...
...
public/themes/simpleboot3/user/register.html
查看文件 @
be0ff47
...
...
@@ -134,7 +134,7 @@
</p>
</div>
<div
class=
"register_tel"
>
<input
type=
"text"
placeholder=
"手机号"
>
<input
type=
"text"
placeholder=
"手机号"
id=
"mobile"
>
</div>
</div>
...
...
@@ -146,7 +146,7 @@
</p>
</div>
<div
class=
"register_codenum"
>
<input
type=
"text"
placeholder=
"验证码"
>
<input
type=
"text"
placeholder=
"验证码"
id=
"code"
>
</div>
<button
class=
"getcode"
></button>
...
...
@@ -161,7 +161,8 @@
var
InterValObj
;
//timer变量,控制时间
var
count
=
10
;
//间隔函数,1秒执行
var
curCount
=
''
;
//当前剩余秒数
var
mobile
=
$
(
"#mobile"
).
val
();
var
code
=
$
(
"#code"
).
val
();
var
t
=
localStorage
.
getItem
(
"time"
);
InterValObj
=
window
.
setInterval
(
SetRemainTime
,
1000
);
if
(
t
!=
null
){
...
...
@@ -182,6 +183,17 @@
// $(".sendcode").unbind()
$
(
".getcode"
).
html
(
curCount
+
"秒"
);
InterValObj
=
window
.
setInterval
(
SetRemainTime
,
1000
);
//启动计时器,1秒执行一次
$
.
ajax
({
url
:
"{:url('user/register/getCode')}"
,
type
:
"post"
,
data
:
{
mobile
:
mobile
,
code
:
code
,
},
success
:
function
(
data
)
{
alert
(
data
)
}
})
});
...
...
@@ -200,6 +212,27 @@
$
(
".getcode"
).
html
(
curCount
+
"秒"
);
}
}
$
(
".sure"
).
click
(
function
()
{
$
.
ajax
({
url
:
"{:url('user/register/doRegister')}"
,
type
:
"post"
,
data
:
{
mobile
:
mobile
,
code
:
code
,
},
success
:
function
(
data
)
{
if
(
data
==
1
){
alert
(
'注册成功'
)
window
.
location
.
href
=
"{:url('portal/index/index')}"
;
}
else
{
alert
(
data
)
return
false
}
}
})
})
</script>
</body>
</html>
...
...
请
注册
或
登录
后发表评论