mirror of
https://github.com/v2board/v2board.git
synced 2025-01-25 23:49:09 +08:00
commit
c1583a1014
@ -116,16 +116,17 @@ class AuthController extends Controller
|
|||||||
abort(500, '该账户已被停止使用');
|
abort(500, '该账户已被停止使用');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'token' => $user->token
|
||||||
|
];
|
||||||
$request->session()->put('email', $user->email);
|
$request->session()->put('email', $user->email);
|
||||||
$request->session()->put('id', $user->id);
|
$request->session()->put('id', $user->id);
|
||||||
if ($user->is_admin) {
|
if ($user->is_admin) {
|
||||||
$request->session()->put('is_admin', true);
|
$request->session()->put('is_admin', true);
|
||||||
|
$data['is_admin'] = true;
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => [
|
'data' => $data
|
||||||
'is_admin' => $user->is_admin ? 2 : 1,
|
|
||||||
'token' => $user->token
|
|
||||||
]
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,13 +176,15 @@ class AuthController extends Controller
|
|||||||
|
|
||||||
public function check(Request $request)
|
public function check(Request $request)
|
||||||
{
|
{
|
||||||
$response = [
|
$data = [
|
||||||
'data' => $request->session()->get('id') ? true : false
|
'is_login' => $request->session()->get('id') ? true : false
|
||||||
];
|
];
|
||||||
if ($request->session()->get('is_admin')) {
|
if ($request->session()->get('is_admin')) {
|
||||||
$response['is_admin'] = true;
|
$data['is_admin'] = true;
|
||||||
}
|
}
|
||||||
return response($response);
|
return response([
|
||||||
|
'data' => $data
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forget(AuthForget $request)
|
public function forget(AuthForget $request)
|
||||||
|
@ -146,20 +146,21 @@ class DeepbworkController extends Controller
|
|||||||
if ($server->rules) {
|
if ($server->rules) {
|
||||||
$rules = json_decode($server->rules);
|
$rules = json_decode($server->rules);
|
||||||
// domain
|
// domain
|
||||||
$domainObj = new \StdClass();
|
if (isset($rules->domain)) {
|
||||||
$domainObj->type = 'field';
|
$domainObj = new \StdClass();
|
||||||
$domainObj->domain = $rules->domain;
|
$domainObj->type = 'field';
|
||||||
$domainObj->outboundTag = 'block';
|
$domainObj->domain = $rules->domain;
|
||||||
|
$domainObj->outboundTag = 'block';
|
||||||
|
array_push($json->routing->settings->rules, $domainObj);
|
||||||
|
}
|
||||||
// protocol
|
// protocol
|
||||||
$protocolObj = new \StdClass();
|
if (isset($rules->protocol)) {
|
||||||
$protocolObj->type = 'field';
|
$protocolObj = new \StdClass();
|
||||||
$protocolObj->protocol = $rules->protocol;
|
$protocolObj->type = 'field';
|
||||||
$protocolObj->outboundTag = 'block';
|
$protocolObj->protocol = $rules->protocol;
|
||||||
array_push(
|
$protocolObj->outboundTag = 'block';
|
||||||
$json->routing->settings->rules,
|
array_push($json->routing->settings->rules, $protocolObj);
|
||||||
$domainObj,
|
}
|
||||||
$protocolObj
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int)$server->tls) {
|
if ((int)$server->tls) {
|
||||||
|
@ -234,5 +234,5 @@ return [
|
|||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'version' => '1.1'
|
'version' => '1.1.1'
|
||||||
];
|
];
|
||||||
|
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
2
public/assets/user/umi.js
vendored
2
public/assets/user/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user