mirror of
https://github.com/v2board/v2board.git
synced 2025-01-31 02:29:14 +08:00
update
This commit is contained in:
parent
b1ab5e463b
commit
58ff1cacb3
@ -22,28 +22,48 @@ class ClientController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$uri = '';
|
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Quantumult-X') !== -1) {
|
||||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Quantumult') !==false) {
|
die($this->qutumultX($user, $server));
|
||||||
header('subscription-userinfo: upload='.$user->u.'; download='.$user->d.';total='.$user->transfer_enable);
|
|
||||||
foreach($server as $item) {
|
|
||||||
$uri .= "vmess://".base64_encode($item->name.'= vmess, '.$item->host.', '.$item->port.', chacha20-ietf-poly1305, "'.$user->v2ray_uuid.'", over-tls='.($item->tls?"true":"false").', certificate=1, group='.config('v2panel.app_name', 'V2Panel'))."\r\n";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
foreach($server as $item) {
|
|
||||||
$config = [
|
|
||||||
"ps" => $item->name,
|
|
||||||
"add" => $item->host,
|
|
||||||
"port" => $item->port,
|
|
||||||
"id" => $user->v2ray_uuid,
|
|
||||||
"aid" => "2",
|
|
||||||
"net" => "tcp",
|
|
||||||
"type" => "chacha20-poly1305",
|
|
||||||
"host" => "",
|
|
||||||
"tls" => $item->tls?"tls":"",
|
|
||||||
];
|
|
||||||
$uri .= "vmess://".base64_encode(json_encode($config))."\r\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
die(base64_encode($uri));
|
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Quantumult') !== -1) {
|
||||||
|
die($this->qutumult($user, $server));
|
||||||
|
}
|
||||||
|
die($this->origin($user, $server));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function qutumultX ($user, $server) {
|
||||||
|
$uri = '';
|
||||||
|
foreach($server as $item) {
|
||||||
|
$uri .= "vmess=".$item->host.":".$item->port.", method=none, password=".$user->v2ray_uuid.", fast-open=false, udp-relay=false, tag=".$item->name."\r\n";
|
||||||
|
}
|
||||||
|
return base64_encode($uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function qutumult ($user, $server) {
|
||||||
|
$uri = '';
|
||||||
|
header('subscription-userinfo: upload='.$user->u.'; download='.$user->d.';total='.$user->transfer_enable);
|
||||||
|
foreach($server as $item) {
|
||||||
|
$uri .= "vmess://".base64_encode($item->name.'= vmess, '.$item->host.', '.$item->port.', chacha20-ietf-poly1305, "'.$user->v2ray_uuid.'", over-tls='.($item->tls?"true":"false").', certificate=1, group='.config('v2panel.app_name', 'V2Panel'))."\r\n";
|
||||||
|
}
|
||||||
|
return base64_encode($uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function origin ($user, $server) {
|
||||||
|
$uri = '';
|
||||||
|
foreach($server as $item) {
|
||||||
|
$config = [
|
||||||
|
"ps" => $item->name,
|
||||||
|
"add" => $item->host,
|
||||||
|
"port" => $item->port,
|
||||||
|
"id" => $user->v2ray_uuid,
|
||||||
|
"aid" => "2",
|
||||||
|
"net" => "tcp",
|
||||||
|
"type" => "chacha20-poly1305",
|
||||||
|
"host" => "",
|
||||||
|
"tls" => $item->tls?"tls":"",
|
||||||
|
];
|
||||||
|
$uri .= "vmess://".base64_encode(json_encode($config))."\r\n";
|
||||||
|
}
|
||||||
|
return base64_encode($uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ class CommController extends Controller
|
|||||||
{
|
{
|
||||||
public function isEmailVerify () {
|
public function isEmailVerify () {
|
||||||
return response([
|
return response([
|
||||||
'data' => (int)config('v2panel.email_verify', env('DEFAULT_EMAIL_VERIFY')) ? true : false
|
'data' => (int)config('v2panel.email_verify', env('DEFAULT_EMAIL_VERIFY')) ? 1 : 0
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,18 +6,17 @@ use App\Http\Requests\Passport\ForgetIndex;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Facades\Redis;
|
use Illuminate\Support\Facades\Redis;
|
||||||
|
|
||||||
class ForgetController extends Controller
|
class ForgetController extends Controller
|
||||||
{
|
{
|
||||||
public function index (ForgetIndex $request) {
|
public function index (ForgetIndex $request) {
|
||||||
$user = User::where('email', $request->input('email'))->first();
|
|
||||||
$redisKey = 'sendEmailVerify:' . $request->input('email');
|
$redisKey = 'sendEmailVerify:' . $request->input('email');
|
||||||
if (Redis::get($redisKey) !== $request->input('email_code')) {
|
if (Redis::get($redisKey) !== $request->input('email_code')) {
|
||||||
abort(500, '邮箱验证码有误');
|
abort(500, '邮箱验证码有误');
|
||||||
}
|
}
|
||||||
|
$user = User::where('email', $request->input('email'))->first();
|
||||||
$user->password = password_hash($request->input('password'), PASSWORD_DEFAULT);
|
$user->password = password_hash($request->input('password'), PASSWORD_DEFAULT);
|
||||||
if (!$user->save()) {
|
if (!$user->save()) {
|
||||||
abort(500, '重置失败');
|
abort(500, '重置失败');
|
||||||
|
Loading…
Reference in New Issue
Block a user