|
...
|
...
|
@@ -3,6 +3,8 @@ |
|
|
|
namespace App\Http\Logic\Bside\User;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Exceptions\AsideGlobalException;
|
|
|
|
use App\Exceptions\BsideGlobalException;
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Logic\Aside\Project\ProjectLogic;
|
|
|
|
use App\Models\SmsLog;
|
|
...
|
...
|
@@ -62,4 +64,27 @@ class UserLoginLogic |
|
|
|
Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip()]);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes: 请简要描述方法功能
|
|
|
|
* @param array $data
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function success($data = [])
|
|
|
|
{
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @notes: 错误抛出
|
|
|
|
* @param string $code
|
|
|
|
* @param string $message
|
|
|
|
* @throws AsideGlobalException|BsideGlobalException
|
|
|
|
*/
|
|
|
|
public function fail(string $message = "", string $code = Code::SYSTEM_ERROR)
|
|
|
|
{
|
|
|
|
if((request()->path()[0]) == \App\Enums\Common\Common::B){
|
|
|
|
throw new BsideGlobalException($code, $message);
|
|
|
|
}
|
|
|
|
throw new AsideGlobalException($code, $message);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|