Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function getToken(string $handle): String |
||
30 | { |
||
31 | if (!in_array($handle, $this->handles)) { |
||
32 | throw new JwtException('不支持只方式获取.', 500); |
||
33 | } |
||
34 | |||
35 | $this->token = (new Header($this->app))->handle(); |
||
36 | |||
37 | if (!$this->token) { |
||
38 | throw new JwtException('获取Token失败.', 500); |
||
39 | } |
||
40 | |||
41 | return $this->token; |
||
42 | } |
||
44 |