Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
9 个修改的文件
包含
95 行增加
和
3 行删除
| @@ -33,7 +33,11 @@ class CustomModuleController extends BaseController | @@ -33,7 +33,11 @@ class CustomModuleController extends BaseController | ||
| 33 | * @time :2023/12/4 15:43 | 33 | * @time :2023/12/4 15:43 |
| 34 | */ | 34 | */ |
| 35 | public function lists(){ | 35 | public function lists(){ |
| 36 | - ProjectServer::useProject($this->param['project_id']); | 36 | + |
| 37 | + $result = ProjectServer::useProject($this->param['project_id']); | ||
| 38 | + if($result === false){ | ||
| 39 | + $this->response('success'); | ||
| 40 | + } | ||
| 37 | $customModule = new CustomModule(); | 41 | $customModule = new CustomModule(); |
| 38 | $this->map['status'] = 0; | 42 | $this->map['status'] = 0; |
| 39 | $lists = $customModule->lists($this->map,$this->page,$this->row,$this->order = ['topping_time','sort','id']); | 43 | $lists = $customModule->lists($this->map,$this->page,$this->row,$this->order = ['topping_time','sort','id']); |
| @@ -193,7 +193,7 @@ class OptimizeController extends BaseController | @@ -193,7 +193,7 @@ class OptimizeController extends BaseController | ||
| 193 | if(isset($this->map['optimize_manager_mid']) && !empty($this->map['optimize_manager_mid'])){ | 193 | if(isset($this->map['optimize_manager_mid']) && !empty($this->map['optimize_manager_mid'])){ |
| 194 | $query = $query->where('gl_project_deploy_optimize.manager_mid','like','%'.$this->map['optimize_manager_mid'].'%'); | 194 | $query = $query->where('gl_project_deploy_optimize.manager_mid','like','%'.$this->map['optimize_manager_mid'].'%'); |
| 195 | } | 195 | } |
| 196 | - if(isset($this->map['is_upgrade']) && !empty($this->map['is_upgrade'])){ | 196 | + if(isset($this->map['is_upgrade'])){ |
| 197 | $query = $query->where('gl_project.is_upgrade',$this->map['is_upgrade']); | 197 | $query = $query->where('gl_project.is_upgrade',$this->map['is_upgrade']); |
| 198 | } | 198 | } |
| 199 | if(isset($this->map['optimize_tech_mid']) && !empty($this->map['optimize_tech_mid'])){ | 199 | if(isset($this->map['optimize_tech_mid']) && !empty($this->map['optimize_tech_mid'])){ |
| @@ -79,4 +79,24 @@ class RatingController extends BaseController | @@ -79,4 +79,24 @@ class RatingController extends BaseController | ||
| 79 | $ratingLogic->ratingSave(); | 79 | $ratingLogic->ratingSave(); |
| 80 | $this->response('success'); | 80 | $this->response('success'); |
| 81 | } | 81 | } |
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * @remark :问卷调查验证验证码 | ||
| 85 | + * @name :VerificationCode | ||
| 86 | + * @author :lyh | ||
| 87 | + * @method :post | ||
| 88 | + * @time :2024/1/22 11:23 | ||
| 89 | + */ | ||
| 90 | + public function verificationCode(){ | ||
| 91 | + $smsModel = new SmsLog(); | ||
| 92 | + $smsInfo = $smsModel->formatQuery(['mobile'=>$this->param['mobile'],'type'=>$smsModel::TYPE_CORING])->orderBy('id','desc')->first(); | ||
| 93 | + if(!empty($smsInfo)){ | ||
| 94 | + if(($this->param['code'] != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){ | ||
| 95 | + $this->response('验证码已过期或验证码错误',Code::SYSTEM_ERROR); | ||
| 96 | + } | ||
| 97 | + }else{ | ||
| 98 | + $this->response('验证码错误',Code::SYSTEM_ERROR); | ||
| 99 | + } | ||
| 100 | + $this->response('success'); | ||
| 101 | + } | ||
| 82 | } | 102 | } |
| @@ -84,7 +84,7 @@ class LoginLogic extends BaseLogic | @@ -84,7 +84,7 @@ class LoginLogic extends BaseLogic | ||
| 84 | * @time :2023/9/7 16:30 | 84 | * @time :2023/9/7 16:30 |
| 85 | */ | 85 | */ |
| 86 | public function logout(){ | 86 | public function logout(){ |
| 87 | - Cache::pull($this->request->header('token')); | 87 | + Cache::pull(Common::MANAGE_TOKEN.$this->request->header('token')); |
| 88 | return $this->success(); | 88 | return $this->success(); |
| 89 | } | 89 | } |
| 90 | 90 |
| @@ -37,6 +37,7 @@ class RatingLogic extends BaseLogic | @@ -37,6 +37,7 @@ class RatingLogic extends BaseLogic | ||
| 37 | 'uptime'=>$this->project['uptime'], | 37 | 'uptime'=>$this->project['uptime'], |
| 38 | 'domain'=>$this->user['domain'], | 38 | 'domain'=>$this->user['domain'], |
| 39 | 'question'=>$this->model->list(['type'=>$this->param['type']]), | 39 | 'question'=>$this->model->list(['type'=>$this->param['type']]), |
| 40 | + 'project_id'=>$this->user['project_id'] | ||
| 40 | ]; | 41 | ]; |
| 41 | return $this->success($data); | 42 | return $this->success($data); |
| 42 | } | 43 | } |
| @@ -37,6 +37,13 @@ class WebSettingReceivingLogic extends BaseLogic | @@ -37,6 +37,13 @@ class WebSettingReceivingLogic extends BaseLogic | ||
| 37 | try { | 37 | try { |
| 38 | $this->model->del(['project_id'=>$this->user['project_id']]); | 38 | $this->model->del(['project_id'=>$this->user['project_id']]); |
| 39 | foreach ($this->param['data'] as $k => $v){ | 39 | foreach ($this->param['data'] as $k => $v){ |
| 40 | + if($v['type'] == 2){ | ||
| 41 | + // 使用正则表达式匹配中国大陆手机号 | ||
| 42 | + $pattern = '/^1[3456789]\d{9}$/'; | ||
| 43 | + if (!preg_match($pattern, $v['values'])) { | ||
| 44 | + continue; | ||
| 45 | + } | ||
| 46 | + } | ||
| 40 | $v['project_id'] = $this->user['project_id']; | 47 | $v['project_id'] = $this->user['project_id']; |
| 41 | $v['created_at'] = date('Y-m-d H:i:s'); | 48 | $v['created_at'] = date('Y-m-d H:i:s'); |
| 42 | $v['updated_at'] = date('Y-m-d H:i:s'); | 49 | $v['updated_at'] = date('Y-m-d H:i:s'); |
app/Services/AmazonS3Service.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark :上传文件与图片到亚马逊 | ||
| 4 | + * @name :AmazonS3Service.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/1/23 9:17 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Services; | ||
| 11 | + | ||
| 12 | +use Aws\S3\S3Client; | ||
| 13 | +use Aws\S3\Exception\S3Exception; | ||
| 14 | +class AmazonS3Service | ||
| 15 | +{ | ||
| 16 | + // 替换为你自己的 AWS 访问密钥、区域和存储桶名称 | ||
| 17 | + protected $s3; | ||
| 18 | + protected $accessKeyId = '';//key | ||
| 19 | + protected $secretAccessKey = '';//密匙 | ||
| 20 | + protected $region = '';//地址 | ||
| 21 | + protected $bucket = '';//桶子 | ||
| 22 | + | ||
| 23 | + public function __construct() | ||
| 24 | + { | ||
| 25 | + // 创建 S3 客户端 | ||
| 26 | + $this->s3 = new S3Client([ | ||
| 27 | + 'version' => 'latest', | ||
| 28 | + 'region' => $this->region, | ||
| 29 | + 'credentials' => [ | ||
| 30 | + 'key' => $this->accessKeyId, | ||
| 31 | + 'secret' => $this->secretAccessKey, | ||
| 32 | + ], | ||
| 33 | + ]); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * @remark :上传图片与文件 | ||
| 38 | + * @name :uploadImage | ||
| 39 | + * @author :lyh | ||
| 40 | + * @method :post | ||
| 41 | + * @time :2024/1/23 9:20 | ||
| 42 | + */ | ||
| 43 | + public function uploadFiles($localFilePath, $s3Key) | ||
| 44 | + { | ||
| 45 | + try { | ||
| 46 | + $result = $this->s3->putObject([ | ||
| 47 | + 'Bucket' => $this->bucket, | ||
| 48 | + 'Key' => $s3Key, | ||
| 49 | + 'SourceFile' => $localFilePath, | ||
| 50 | + 'ACL' => 'public-read', // 设置图片为公共可读,可根据需求修改 | ||
| 51 | + ]); | ||
| 52 | + return $result['ObjectURL']; | ||
| 53 | + } catch (S3Exception $e) { | ||
| 54 | + return false; | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | +} |
| @@ -28,6 +28,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -28,6 +28,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 28 | Route::any('/info', [\App\Http\Controllers\Bside\User\UserController::class, 'info'])->name('user_info'); | 28 | Route::any('/info', [\App\Http\Controllers\Bside\User\UserController::class, 'info'])->name('user_info'); |
| 29 | Route::any('/role_list', [\App\Http\Controllers\Bside\User\UserController::class, 'role_list'])->name('user_role_list'); | 29 | Route::any('/role_list', [\App\Http\Controllers\Bside\User\UserController::class, 'role_list'])->name('user_role_list'); |
| 30 | Route::any('/del', [\App\Http\Controllers\Bside\User\UserController::class, 'del'])->name('user_del'); | 30 | Route::any('/del', [\App\Http\Controllers\Bside\User\UserController::class, 'del'])->name('user_del'); |
| 31 | + | ||
| 31 | }); | 32 | }); |
| 32 | //项目独立头部和底部设置 | 33 | //项目独立头部和底部设置 |
| 33 | Route::prefix('pageSetting')->group(function () { | 34 | Route::prefix('pageSetting')->group(function () { |
| @@ -484,6 +485,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -484,6 +485,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 484 | Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead'); | 485 | Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead'); |
| 485 | Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save'); | 486 | Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save'); |
| 486 | Route::any('/getHistory', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getHistory'])->name('rating_getHistory'); | 487 | Route::any('/getHistory', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getHistory'])->name('rating_getHistory'); |
| 488 | + Route::any('/code', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'verificationCode'])->name('rating_code'); | ||
| 487 | }); | 489 | }); |
| 488 | }); | 490 | }); |
| 489 | //无需登录验证的路由组 | 491 | //无需登录验证的路由组 |
-
请 注册 或 登录 后发表评论