Files
huangjingfen/pro_v3.5.1/app/controller/admin/v1/notification/sms/SmsConfig.php
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

53 lines
1.4 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace app\controller\admin\v1\notification\sms;
use think\annotation\Inject;
use app\services\message\sms\SmsAdminServices;
use app\services\serve\ServeServices;
use crmeb\services\CacheService;
use app\controller\admin\AuthController;
use crmeb\services\SystemConfigService;
/**
* 短信配置
* Class SmsConfig
* @package app\admin\controller\sms
*/
class SmsConfig extends AuthController
{
/**
* @var SmsAdminServices
*/
#[Inject]
protected SmsAdminServices $services;
/**
* 保存短信配置
* @return mixed
*/
public function save_basics()
{
[$account, $token] = $this->request->postMore([
['sms_account', ''],
['sms_token', '']
], true);
$this->validate(['sms_account' => $account, 'sms_token' => $token], \app\validate\admin\notification\SmsConfigValidate::class);
if(sys_config('sms_account') && sys_config('sms_token')){
return $this->success('保存成功');
}
if ($this->services->updateSmsConfig($account, $token)) {
return $this->success('保存成功');
} else {
return $this->fail('保存失败');
}
}
}