|
@@ -177,6 +177,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function loginFailure($account, $number = 5, $n = 3)
|
|
public function loginFailure($account, $number = 5, $n = 3)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试1\r\n",8);
|
|
|
$key = 'api_login_failuree_' . $account;
|
|
$key = 'api_login_failuree_' . $account;
|
|
|
$numb = Cache::get($key) ?? 0;
|
|
$numb = Cache::get($key) ?? 0;
|
|
|
$numb++;
|
|
$numb++;
|
|
@@ -205,6 +206,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function userInfo()
|
|
public function userInfo()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试2\r\n",8);
|
|
|
$user = $this->request->userInfo()->hidden(['label_id', 'group_id', 'pwd', 'addres', 'card_id', 'last_time', 'last_ip', 'create_time', 'mark', 'status', 'spread_time', 'real_name', 'birthday', 'brokerage_price']);
|
|
$user = $this->request->userInfo()->hidden(['label_id', 'group_id', 'pwd', 'addres', 'card_id', 'last_time', 'last_ip', 'create_time', 'mark', 'status', 'spread_time', 'real_name', 'birthday', 'brokerage_price']);
|
|
|
$user->append(['service', 'topService', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread', 'total_recharge', 'lock_integral', 'total_integral', 'staffs']);
|
|
$user->append(['service', 'topService', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread', 'total_recharge', 'lock_integral', 'total_integral', 'staffs']);
|
|
|
$data = $user->toArray();
|
|
$data = $user->toArray();
|
|
@@ -278,6 +280,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function logout(UserRepository $repository)
|
|
public function logout(UserRepository $repository)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试3\r\n",8);
|
|
|
$repository->clearToken($this->request->token());
|
|
$repository->clearToken($this->request->token());
|
|
|
return app('json')->success('退出登录');
|
|
return app('json')->success('退出登录');
|
|
|
}
|
|
}
|
|
@@ -292,6 +295,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function auth()
|
|
public function auth()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试4\r\n",8);
|
|
|
if (systemConfig('is_phone_login') === '1') {
|
|
if (systemConfig('is_phone_login') === '1') {
|
|
|
return app('json')->fail('请绑定手机号');
|
|
return app('json')->fail('请绑定手机号');
|
|
|
}
|
|
}
|
|
@@ -337,6 +341,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function mpAuth()
|
|
public function mpAuth()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试5\r\n",8);
|
|
|
list($code, $post_cache_key) = $this->request->params([
|
|
list($code, $post_cache_key) = $this->request->params([
|
|
|
'code',
|
|
'code',
|
|
|
'cache_key',
|
|
'cache_key',
|
|
@@ -400,6 +405,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function getCaptcha()
|
|
public function getCaptcha()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试6\r\n",8);
|
|
|
$codeBuilder = new CaptchaBuilder(null, new PhraseBuilder(4));
|
|
$codeBuilder = new CaptchaBuilder(null, new PhraseBuilder(4));
|
|
|
$key = uniqid(microtime(true), true);
|
|
$key = uniqid(microtime(true), true);
|
|
|
Cache::set('api_captche' . $key, $codeBuilder->getPhrase(), 300);
|
|
Cache::set('api_captche' . $key, $codeBuilder->getPhrase(), 300);
|
|
@@ -419,6 +425,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function verify(UserAuthValidate $validate)
|
|
public function verify(UserAuthValidate $validate)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试7\r\n",8);
|
|
|
$data = $this->request->params(['phone', ['type', 'login'], ['captchaType', 'clickWord'], ['captchaVerification', ''], 'token']);
|
|
$data = $this->request->params(['phone', ['type', 'login'], ['captchaType', 'clickWord'], ['captchaVerification', ''], 'token']);
|
|
|
//二次验证
|
|
//二次验证
|
|
|
try {
|
|
try {
|
|
@@ -455,6 +462,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function smsLogin(UserAuthValidate $validate, UserRepository $repository)
|
|
public function smsLogin(UserAuthValidate $validate, UserRepository $repository)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试8\r\n",8);
|
|
|
$data = $this->request->params(['phone', 'sms_code', 'spread', 'auth_token', ['user_type', 'h5']]);
|
|
$data = $this->request->params(['phone', 'sms_code', 'spread', 'auth_token', ['user_type', 'h5']]);
|
|
|
$validate->sceneSmslogin()->check($data);
|
|
$validate->sceneSmslogin()->check($data);
|
|
|
$sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login');
|
|
$sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login');
|
|
@@ -479,6 +487,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function changePassword(ChangePasswordValidate $validate, UserRepository $repository)
|
|
public function changePassword(ChangePasswordValidate $validate, UserRepository $repository)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试9\r\n",8);
|
|
|
$data = $this->request->params(['phone', 'sms_code', 'pwd']);
|
|
$data = $this->request->params(['phone', 'sms_code', 'pwd']);
|
|
|
$validate->check($data);
|
|
$validate->check($data);
|
|
|
$user = $repository->accountByUser($data['phone']);
|
|
$user = $repository->accountByUser($data['phone']);
|
|
@@ -493,6 +502,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function spread(UserRepository $userRepository)
|
|
public function spread(UserRepository $userRepository)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试10\r\n",8);
|
|
|
$data = $this->request->params([
|
|
$data = $this->request->params([
|
|
|
['spread_spid', 0],
|
|
['spread_spid', 0],
|
|
|
['spread_code', null],
|
|
['spread_code', null],
|
|
@@ -514,6 +524,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function register(UserAuthValidate $validate, UserRepository $repository)
|
|
public function register(UserAuthValidate $validate, UserRepository $repository)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试12\r\n",8);
|
|
|
$data = $this->request->params(['phone', 'sms_code', 'spread', 'pwd', 'auth_token', ['user_type', 'h5']]);
|
|
$data = $this->request->params(['phone', 'sms_code', 'spread', 'pwd', 'auth_token', ['user_type', 'h5']]);
|
|
|
$validate->check($data);
|
|
$validate->check($data);
|
|
|
$sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login');
|
|
$sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login');
|
|
@@ -641,7 +652,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function authLogin()
|
|
public function authLogin()
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试13\r\n",8);
|
|
|
$auth = $this->request->param('auth');
|
|
$auth = $this->request->param('auth');
|
|
|
$users = $this->authInfo($auth, !systemConfig('is_phone_login'));
|
|
$users = $this->authInfo($auth, !systemConfig('is_phone_login'));
|
|
|
if (!$users)
|
|
if (!$users)
|
|
@@ -684,6 +695,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function mpLoginType()
|
|
public function mpLoginType()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试14\r\n",8);
|
|
|
$code = $this->request->param('code');
|
|
$code = $this->request->param('code');
|
|
|
if (!$code) return app('json')->fail('请获取code参数');
|
|
if (!$code) return app('json')->fail('请获取code参数');
|
|
|
$spread = $this->request->param('spread',0);
|
|
$spread = $this->request->param('spread',0);
|
|
@@ -699,6 +711,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function appAuth()
|
|
public function appAuth()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试15\r\n",8);
|
|
|
$data = $this->request->params(['userInfo']);
|
|
$data = $this->request->params(['userInfo']);
|
|
|
|
|
|
|
|
if (systemConfig('is_phone_login') === '1') {
|
|
if (systemConfig('is_phone_login') === '1') {
|
|
@@ -719,6 +732,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function getMerCertificate($merId)
|
|
public function getMerCertificate($merId)
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试16\r\n",8);
|
|
|
$merId = (int)$merId;
|
|
$merId = (int)$merId;
|
|
|
$data = $this->request->params(['key', 'code']);
|
|
$data = $this->request->params(['key', 'code']);
|
|
|
if (!$this->checkCaptcha($data['key'], $data['code']))
|
|
if (!$this->checkCaptcha($data['key'], $data['code']))
|
|
@@ -731,6 +745,7 @@ class Auth extends BaseController
|
|
|
|
|
|
|
|
public function appleAuth()
|
|
public function appleAuth()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试17\r\n",8);
|
|
|
$data = $this->request->params(['openId', 'nickname']);
|
|
$data = $this->request->params(['openId', 'nickname']);
|
|
|
|
|
|
|
|
if (systemConfig('is_phone_login') === '1') {
|
|
if (systemConfig('is_phone_login') === '1') {
|
|
@@ -755,6 +770,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function cancel()
|
|
public function cancel()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试18\r\n",8);
|
|
|
$userRepository = app()->make(UserRepository::class);
|
|
$userRepository = app()->make(UserRepository::class);
|
|
|
$user = $this->request->userInfo();
|
|
$user = $this->request->userInfo();
|
|
|
$order = app()->make(StoreOrderRepository::class)->search(['uid' => $user['uid'], 'paid' => 1])->where('StoreOrder.status', 0)->count();
|
|
$order = app()->make(StoreOrderRepository::class)->search(['uid' => $user['uid'], 'paid' => 1])->where('StoreOrder.status', 0)->count();
|
|
@@ -786,6 +802,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function mpPhone()
|
|
public function mpPhone()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试19\r\n",8);
|
|
|
$code = $this->request->param('code');
|
|
$code = $this->request->param('code');
|
|
|
$auth_token = $this->request->param('auth_token');
|
|
$auth_token = $this->request->param('auth_token');
|
|
|
$iv = $this->request->param('iv');
|
|
$iv = $this->request->param('iv');
|
|
@@ -838,6 +855,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function ajcaptcha()
|
|
public function ajcaptcha()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试20\r\n",8);
|
|
|
$captchaType = $this->request->param('captchaType', 'clickWord');
|
|
$captchaType = $this->request->param('captchaType', 'clickWord');
|
|
|
if (!$captchaType) return app('json')->fail('请输入类型');
|
|
if (!$captchaType) return app('json')->fail('请输入类型');
|
|
|
return app('json')->success(aj_captcha_create($captchaType));
|
|
return app('json')->success(aj_captcha_create($captchaType));
|
|
@@ -849,6 +867,7 @@ class Auth extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function ajcheck()
|
|
public function ajcheck()
|
|
|
{
|
|
{
|
|
|
|
|
+ @file_put_contents('quanju3.txt',"-登录测试21\r\n",8);
|
|
|
$token = $this->request->param('token', '');
|
|
$token = $this->request->param('token', '');
|
|
|
$pointJson = $this->request->param('pointJson', '');
|
|
$pointJson = $this->request->param('pointJson', '');
|
|
|
$captchaType = $this->request->param('captchaType', 'clickWord');
|
|
$captchaType = $this->request->param('captchaType', 'clickWord');
|