From 764e24d3b86ee675014289c8c31de13e87be81ac Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 16 Aug 2021 16:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=AF=86=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=99=A8=EF=BC=8C=E5=9B=A0=E4=B8=BA=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=AD=98=E5=9C=A8=E7=9B=B8=E5=85=B3=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Agent.php | 12 ------------ app/Models/BaseModel.php | 6 ------ app/Models/Guide.php | 12 ------------ app/Models/Supplier.php | 12 ------------ 4 files changed, 42 deletions(-) diff --git a/app/Models/Agent.php b/app/Models/Agent.php index 02207b1..66ce137 100644 --- a/app/Models/Agent.php +++ b/app/Models/Agent.php @@ -31,18 +31,6 @@ class Agent extends BaseModel $this->attributes['license_pic'] = str_replace(env('APP_URL'), '', $value); } - public function setPasswordAttribute($value) - { - if ($value) { - if ( - empty($this->attributes['password']) || //新增时 - $this->attributes['password'] != $value && !empty($this->attributes['password']) //编辑时 - ) { - $this->attributes['password'] = $this->passMd5($value); - } - } - } - public function agentInfo() { return $this->hasOne(AgentInfo::class); diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index 43f3b02..4de43fb 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -24,10 +24,4 @@ class BaseModel extends Model $builder->orderBy((new static())->getTable().'.id', 'desc'); }); } - - //供应商、代理商、地接、后台管理员等密码加密 - protected function passMd5($value): string - { - return md5('9e97ae0d950a4b10182c99d484b204c8' . $value); - } } diff --git a/app/Models/Guide.php b/app/Models/Guide.php index a42458a..5c03b1a 100644 --- a/app/Models/Guide.php +++ b/app/Models/Guide.php @@ -8,16 +8,4 @@ use Illuminate\Database\Eloquent\SoftDeletes; class Guide extends BaseModel { use HasFactory, SoftDeletes; - - public function setPasswordAttribute($value) - { - if ($value) { - if ( - empty($this->attributes['password']) || //新增时 - $this->attributes['password'] != $value && !empty($this->attributes['password']) //编辑时 - ) { - $this->attributes['password'] = $this->passMd5($value); - } - } - } } diff --git a/app/Models/Supplier.php b/app/Models/Supplier.php index 73faf15..9a5ae21 100644 --- a/app/Models/Supplier.php +++ b/app/Models/Supplier.php @@ -18,16 +18,4 @@ class Supplier extends BaseModel { return $value ? $this->host . $value : ''; } - - public function setPasswordAttribute($value) - { - if ($value) { - if ( - empty($this->attributes['password']) || //新增时 - $this->attributes['password'] != $value && !empty($this->attributes['password']) //编辑时 - ) { - $this->attributes['password'] = $this->passMd5($value); - } - } - } }