| 123456789101112131415161718192021 |
- <?php
- namespace app\api\services;
- use think\facade\Db;
- use utils\JwtAuth;
- abstract class BaseServices
- {
- protected $model = null;
- public function getModel($name){
- return Db::name($name);
- }
- public function createToken(int $uid, $user = null, string $type = 'API'){
- $jwt = app()->make(JwtAuth::class);
- return $jwt->createToken($uid, $user, $type);
- }
- }
|