Files
myyuliao-php/addons/smsbao/Smsbao.php
2025-09-22 18:52:07 +08:00

88 lines
1.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace addons\smsbao;
use app\common\library\Menu;
use think\Addons;
/**
* Smsbao插件
*/
class Smsbao extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
return true;
}
/**
* 插件启用方法
* @return bool
*/
public function enable()
{
return true;
}
/**
* 插件禁用方法
* @return bool
*/
public function disable()
{
return true;
}
/**
* 短信发送
* @param Sms $params
* @return mixed
*/
public function smsSend(&$params)
{
$smsbao = new library\Smsbao();
$result = $smsbao->mobile($params['mobile'])->msg("你的短信验证码是:{$params['code']}")->send();
return $result;
}
/**
* 短信发送通知msg参数直接构建实际短信内容即可
* @param array $params
* @return boolean
*/
public function smsNotice(&$params)
{
$smsbao = new library\Smsbao();
$result = $smsbao->mobile($params['mobile'])->msg($params['msg'])->send();
return $result;
}
/**
* 检测验证是否正确
* @param Sms $params
* @return boolean
*/
public function smsCheck(&$params)
{
return TRUE;
}
}