mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 20:48:09 +08:00
fix: 更新终端账号生成机制 #12
This commit is contained in:
parent
305153bb26
commit
774371495d
@ -110,6 +110,7 @@ class AccountAccess implements AccountInterface
|
|||||||
* @param boolean $isjwt 是否返回令牌
|
* @param boolean $isjwt 是否返回令牌
|
||||||
* @return AccountInterface
|
* @return AccountInterface
|
||||||
* @throws \think\admin\Exception
|
* @throws \think\admin\Exception
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
*/
|
*/
|
||||||
public function init($token = '', bool $isjwt = true): AccountInterface
|
public function init($token = '', bool $isjwt = true): AccountInterface
|
||||||
{
|
{
|
||||||
@ -142,6 +143,7 @@ class AccountAccess implements AccountInterface
|
|||||||
* @param boolean $rejwt 返回令牌
|
* @param boolean $rejwt 返回令牌
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \think\admin\Exception
|
* @throws \think\admin\Exception
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
*/
|
*/
|
||||||
public function set(array $data = [], bool $rejwt = false): array
|
public function set(array $data = [], bool $rejwt = false): array
|
||||||
{
|
{
|
||||||
@ -333,6 +335,7 @@ class AccountAccess implements AccountInterface
|
|||||||
* 解除终端关联
|
* 解除终端关联
|
||||||
* @param integer $usid 终端编号
|
* @param integer $usid 终端编号
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
*/
|
*/
|
||||||
public function delBind(int $usid): array
|
public function delBind(int $usid): array
|
||||||
{
|
{
|
||||||
@ -475,7 +478,7 @@ class AccountAccess implements AccountInterface
|
|||||||
$data['headimg'] = Account::headimg();
|
$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;
|
$name = Account::get($this->type)['name'] ?? $this->type;
|
||||||
$data['nickname'] = "{$name}{$this->bind->getAttr('id')}";
|
$data['nickname'] = "{$name}{$this->bind->getAttr('id')}";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user