From 774371495dbe6550bac445e76283341e0fbae894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Fri, 11 Apr 2025 23:20:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E7=BB=88=E7=AB=AF?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=94=9F=E6=88=90=E6=9C=BA=E5=88=B6=20#12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/service/contract/AccountAccess.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/think-plugs-account/src/service/contract/AccountAccess.php b/plugin/think-plugs-account/src/service/contract/AccountAccess.php index 59aecf472..4bae1ec81 100644 --- a/plugin/think-plugs-account/src/service/contract/AccountAccess.php +++ b/plugin/think-plugs-account/src/service/contract/AccountAccess.php @@ -110,6 +110,7 @@ class AccountAccess implements AccountInterface * @param boolean $isjwt 是否返回令牌 * @return AccountInterface * @throws \think\admin\Exception + * @throws \think\db\exception\DbException */ public function init($token = '', bool $isjwt = true): AccountInterface { @@ -142,6 +143,7 @@ class AccountAccess implements AccountInterface * @param boolean $rejwt 返回令牌 * @return array * @throws \think\admin\Exception + * @throws \think\db\exception\DbException */ public function set(array $data = [], bool $rejwt = false): array { @@ -333,6 +335,7 @@ class AccountAccess implements AccountInterface * 解除终端关联 * @param integer $usid 终端编号 * @return array + * @throws \think\db\exception\DbException */ public function delBind(int $usid): array { @@ -475,7 +478,7 @@ class AccountAccess implements AccountInterface $data['headimg'] = Account::headimg(); } // 自动生成账号昵称 - if (empty($data['nickname']) && $this->bind->getAttr('nickname')) { + if (empty($data['nickname']) && empty($this->bind->getAttr('nickname'))) { $name = Account::get($this->type)['name'] ?? $this->type; $data['nickname'] = "{$name}{$this->bind->getAttr('id')}"; }