Merge branch 'master' into develop
This commit is contained in:
@@ -5,6 +5,7 @@ namespace app\controller;
|
||||
use app\model\Country;
|
||||
use app\model\FeishuUser;
|
||||
use app\model\User;
|
||||
use app\model\UserSn;
|
||||
use app\service\MailService;
|
||||
use app\util\JwtUtil;
|
||||
use app\util\Util;
|
||||
@@ -153,12 +154,20 @@ class UserController
|
||||
'role' => 1,
|
||||
'password' => $hashedPassword,
|
||||
'status' => 0,
|
||||
'avatar' => 'vehicle_album/20250322/175585eeebcf44e8c2a2d50a5e8b5388_67ded58ca1011.jpg',
|
||||
'sn' => substr(uniqid(), -8)
|
||||
'avatar' => 'lingke_crm/logo.png'
|
||||
];
|
||||
|
||||
|
||||
if (Util::isEmpty($id)) {
|
||||
// 获取编号
|
||||
$userSnModel = new UserSn();
|
||||
$sn = $userSnModel->where('user_id', '=', 0)->inRandomOrder()->first();
|
||||
if (!$sn) {
|
||||
throw new BusinessException('未找到适用编号');
|
||||
}
|
||||
$data['sn'] = $sn['user_sn'];
|
||||
$res = User::create($data);
|
||||
UserSn::where(['user_sn'=>$data['sn']])->update(['user_id'=>$res['id']]);
|
||||
} else {
|
||||
$res = User::where('id', $id)
|
||||
->update($data);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
|
||||
|
||||
use support\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class UserSn extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'user_sn';
|
||||
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
@@ -19,15 +19,18 @@ class MailService
|
||||
{
|
||||
// SMTP 配置
|
||||
$this->mailer->isSMTP();
|
||||
$this->mailer->Host = 'smtp.gmail.com';
|
||||
// $this->mailer->Host = 'smtp.qq.com';
|
||||
// $this->mailer->Host = 'smtp.gmail.com';
|
||||
$this->mailer->Host = 'smtp.feishu.cn';
|
||||
$this->mailer->SMTPAuth = true;
|
||||
|
||||
// $this->mailer->Username = 'xinyouhe25@gmail.com'; // 替换为你的 Gmail
|
||||
// $this->mailer->Password = 'zhjkkaplncykzymo'; // 替换为应用专用密码
|
||||
|
||||
$this->mailer->Username = 'linyang0618@gmail.com'; // 替换为你的 Gmail
|
||||
$this->mailer->Password = 'mrjefuahbwbpqakb'; // 替换为应用专用密码
|
||||
// $this->mailer->Username = 'linyang0618@gmail.com'; // 替换为你的 Gmail
|
||||
// $this->mailer->Password = 'mrjefuahbwbpqakb'; // 替换为应用专用密码
|
||||
|
||||
$this->mailer->Username = 'app@hnxinyouhe.com'; // 替换为你的 Gmail
|
||||
$this->mailer->Password = 'akyIUFJ6ihGGjI5h'; // 替换为应用专用密码
|
||||
// $this->mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // 使用 TLS
|
||||
$this->mailer->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // SSL 加密
|
||||
// $this->mailer->Port = 587;
|
||||
|
||||
@@ -17,7 +17,7 @@ class OssService
|
||||
{
|
||||
$this->accessKeyId = 'LTAI5tAGiH7bkVkmrniXnfkA';
|
||||
$this->accessKeySecret = 'nqklJBft6t3S0A4ZvxF4ci9ni91kmm';
|
||||
$this->bucket = 'vehicle-album';
|
||||
$this->bucket = 'lingke_crm';
|
||||
$this->endpoint = 'https://oss-cn-beijing.aliyuncs.com';
|
||||
$this->ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user