28 lines
736 B
PHP
28 lines
736 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Auth;
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
|
use Illuminate\Routing\Controller as BaseController;
|
|
|
|
class Controller extends BaseController
|
|
{
|
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests, AjaxResponse;
|
|
|
|
public function checkUserAuth($identity_id = 0)
|
|
{
|
|
$url = 'wxlogin';
|
|
if ($identity_id > 0) {
|
|
$url = 'login';
|
|
}
|
|
|
|
if (!Auth::user() || ($identity_id && Auth::user()->identity_id != $identity_id)) {
|
|
return route($url) . '?callback=' . url()->current();
|
|
}
|
|
return true;
|
|
}
|
|
}
|