feat: 退出登录接口
This commit is contained in:
parent
578e38b99a
commit
9859f06672
|
|
@ -207,6 +207,15 @@ class WorkerApi extends BaseService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function workerLogout(): bool
|
||||||
|
{
|
||||||
|
if ($this->token) {
|
||||||
|
Token::delete($this->token);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证数据
|
* 验证数据
|
||||||
* @access protected
|
* @access protected
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,10 @@ class Worker extends WorkerApi
|
||||||
$this->workerLogin(1);
|
$this->workerLogin(1);
|
||||||
$this->success('登录成功', $this->user);
|
$this->success('登录成功', $this->user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function logout()
|
||||||
|
{
|
||||||
|
$this->workerLogout();
|
||||||
|
$this->success('操作成功');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user