切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
7 years ago
提交
02ff41c0f21e71fdfd0edd5f4d0fb2dc73d2540f
1 个父辈
f26dec83
修复后台常规管理修改配置时远程验证的错误
修复SMS发送验证码的错误
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
13 行增加
和
13 行删除
application/admin/controller/general/Config.php
application/api/controller/Sms.php
application/common/library/Sms.php
application/admin/controller/general/Config.php
查看文件 @
02ff41c
...
...
@@ -191,16 +191,16 @@ class Config extends Backend
$config
=
$this
->
model
->
get
(
$params
);
if
(
!
$config
)
{
return
json
([
'ok'
=>
''
]
);
return
$this
->
success
(
);
}
else
{
return
json
([
'error'
=>
__
(
'Name already exist'
)]
);
return
$this
->
error
(
__
(
'Name already exist'
)
);
}
}
else
{
return
json
([
'error'
=>
__
(
'Invalid parameters'
)]
);
return
$this
->
error
(
__
(
'Invalid parameters'
)
);
}
}
...
...
application/api/controller/Sms.php
查看文件 @
02ff41c
...
...
@@ -23,8 +23,8 @@ class Sms extends Api
/**
* 发送验证码
*
* @param string $mobile 手机号
* @param string $event 事件名称
* @param string $mobile 手机号
* @param string $event 事件名称
*/
public
function
send
()
{
...
...
@@ -70,9 +70,9 @@ class Sms extends Api
/**
* 检测验证码
*
* @param string $mobile 手机号
* @param string $event 事件名称
* @param string $captcha 验证码
* @param string $mobile 手机号
* @param string $event 事件名称
* @param string $captcha 验证码
*/
public
function
check
()
{
...
...
application/common/library/Sms.php
查看文件 @
02ff41c
...
...
@@ -35,8 +35,8 @@ class Sms
where
([
'mobile'
=>
$mobile
,
'event'
=>
$event
])
->
order
(
'id'
,
'DESC'
)
->
find
();
$result
=
Hook
::
listen
(
'sms_get'
,
$sms
);
return
$result
?
$result
:
NULL
;
Hook
::
listen
(
'sms_get'
,
$sms
,
null
,
true
);
return
$sms
?
$sms
:
NULL
;
}
/**
...
...
@@ -52,7 +52,7 @@ class Sms
$code
=
is_null
(
$code
)
?
mt_rand
(
1000
,
9999
)
:
$code
;
$time
=
time
();
$sms
=
\app\common\model\Sms
::
create
([
'event'
=>
$event
,
'mobile'
=>
$mobile
,
'code'
=>
$code
,
'createtime'
=>
$time
]);
$result
=
Hook
::
listen
(
'sms_send'
,
$sms
);
$result
=
Hook
::
listen
(
'sms_send'
,
$sms
,
null
,
true
);
if
(
!
$result
)
{
$sms
->
delete
();
...
...
@@ -69,7 +69,7 @@ class Sms
*/
public
static
function
notice
(
$params
=
[])
{
$result
=
Hook
::
listen
(
'sms_notice'
,
$params
);
$result
=
Hook
::
listen
(
'sms_notice'
,
$params
,
null
,
true
);
return
$result
?
TRUE
:
FALSE
;
}
...
...
@@ -100,7 +100,7 @@ class Sms
}
else
{
$result
=
Hook
::
listen
(
'sms_check'
,
$sms
);
$result
=
Hook
::
listen
(
'sms_check'
,
$sms
,
null
,
true
);
return
$result
;
}
}
...
...
请
注册
或
登录
后发表评论