修改发送短信验证码长度问题,修改药师账号不存在注册问题

This commit is contained in:
wucongxing 2023-03-24 10:41:25 +08:00
parent d879d99a44
commit 3ca98021a0
5 changed files with 12 additions and 5 deletions

View File

@ -75,6 +75,7 @@ class SendSmsMessageConsumer extends ConsumerMessage
return Result::DROP; // 销毁 return Result::DROP; // 销毁
} }
Log::getInstance()->info("发送短信成功");
return Result::ACK; return Result::ACK;
} }

View File

@ -5,6 +5,7 @@ namespace App\Controller;
use App\Request\UserPatientRequest; use App\Request\UserPatientRequest;
use App\Services\MyDoctorService; use App\Services\MyDoctorService;
use App\Services\UserPatientService; use App\Services\UserPatientService;
use Hyperf\Snowflake\IdGeneratorInterface;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface; use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;

View File

@ -13,6 +13,8 @@ use App\Model\HospitalDepartmentCustom;
use App\Model\OperationManual; use App\Model\OperationManual;
use App\Model\Product; use App\Model\Product;
use Hyperf\Redis\Redis; use Hyperf\Redis\Redis;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* 基础数据服务类 * 基础数据服务类
@ -208,12 +210,14 @@ class BasicDataService extends BaseService
/** /**
* 搜索商品 * 搜索商品
* @return array * @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function getProductSearch(): array public function getProductSearch(): array
{ {
$user_info = $this->request->getAttribute("userInfo") ?? []; $user_info = $this->request->getAttribute("userInfo") ?? [];
$product_keyword = $this->request->input('product_keyword'); $product_keyword = $this->request->input('product_keyword',"");
$fields = [ $fields = [
'product_id', 'product_id',

View File

@ -41,7 +41,7 @@ class CodeService extends BaseService
$template_code = "SMS_243055263"; $template_code = "SMS_243055263";
$template_param = array(); $template_param = array();
$template_param['code'] = mt_rand(1,9) . (int)substr($generator->generate(),-3); $template_param['code'] = mt_rand(1111,9999);
// 发送短信 // 发送短信
Dysms::sendSms($phone,$template_param,$template_code,"获取验证码"); Dysms::sendSms($phone,$template_param,$template_code,"获取验证码");

View File

@ -67,7 +67,8 @@ class LoginService extends BaseService
if (empty($user)) { if (empty($user)) {
// 处理药师特殊情况,后台添加,前台不允许注册 // 处理药师特殊情况,后台添加,前台不允许注册
if ($user_type == 3) { if ($user_type == 3) {
return fail(HttpEnumCode::GET_WX_ERROR); Db::rollBack();
return fail(HttpEnumCode::HTTP_ERROR,"账号不存在,请联系客服");
} }
// 新增用户表 // 新增用户表
@ -264,7 +265,6 @@ class LoginService extends BaseService
Log::getInstance()->info($e->getMessage()); Log::getInstance()->info($e->getMessage());
} }
Db::beginTransaction(); Db::beginTransaction();
try { try {
@ -275,7 +275,8 @@ class LoginService extends BaseService
if (empty($user)) { if (empty($user)) {
// 处理药师特殊情况,后台添加,前台不允许注册 // 处理药师特殊情况,后台添加,前台不允许注册
if ($user_type == 3) { if ($user_type == 3) {
return fail(HttpEnumCode::GET_WX_ERROR); Db::rollBack();
return fail(HttpEnumCode::HTTP_ERROR,"账号不存在,请联系客服");
} }
// 新增用户表 // 新增用户表