添加经销商端登录
parent
580e97203d
commit
c3f1882814
|
|
@ -9,4 +9,7 @@ class Device
|
||||||
|
|
||||||
// 商户端
|
// 商户端
|
||||||
public const MERCHANT = 'merchant';
|
public const MERCHANT = 'merchant';
|
||||||
|
|
||||||
|
// 经销商端
|
||||||
|
public const DEALER = 'dealer';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,16 @@ class LoginController extends Controller
|
||||||
// 颁发新的商户端令牌
|
// 颁发新的商户端令牌
|
||||||
$token = $user->createToken($device);
|
$token = $user->createToken($device);
|
||||||
break;
|
break;
|
||||||
|
case Device::DEALER:
|
||||||
|
if (!$user->isDealer()) {
|
||||||
|
throw new BizException('账户没有权限');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理此用户的商户端令牌
|
||||||
|
$user->tokens()->where('name', $device)->delete();
|
||||||
|
// 颁发新的商户端令牌
|
||||||
|
$token = $user->createToken($device);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$device = Device::UNIAPP;
|
$device = Device::UNIAPP;
|
||||||
// 清理此用户的商城端令牌
|
// 清理此用户的商城端令牌
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,16 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac
|
||||||
return $this->userInfo?->growth_value >= config('agent.upgrade_rules.vip.sales_value');
|
return $this->userInfo?->growth_value >= config('agent.upgrade_rules.vip.sales_value');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* todo-确认这个用户是否是经销商
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isDealer(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属于此用户的售后订单
|
* 属于此用户的售后订单
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue