| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,11 +59,14 @@ public function index(Request $request, $code) | |||
| 59 | 59 | exit($this->noneNode()); | |
| 60 | 60 | } | |
| 61 | 61 | ||
| 62 | - $nodeList = SsNode::query() | ||
| 63 | - ->selectRaw('ss_node.*') | ||
| 64 | - ->leftjoin("ss_node_label", "ss_node.id", "=", "ss_node_label.node_id") | ||
| 65 | - ->where('ss_node.type', 1) | ||
| 66 | - ->where('ss_node.status', 1) | ||
| 62 | + $query = SsNode::query()->selectRaw('ss_node.*')->leftjoin("ss_node_label", "ss_node.id", "=", "ss_node_label.node_id"); | ||
| 63 | + | ||
| 64 | + // 启用混合订阅时,加入V2Ray节点,未启用时仅下发SSR节点信息 | ||
| 65 | + if (!self::$systemConfig['mix_subscribe']) { | ||
| 66 | + $query->where('ss_node.type', 1); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + $nodeList = $query->where('ss_node.status', 1) | ||
| 67 | 70 | ->where('ss_node.is_subscribe', 1) | |
| 68 | 71 | ->whereIn('ss_node_label.label_id', $userLabelIds) | |
| 69 | 72 | ->groupBy('ss_node.id') | |
@@ -76,8 +79,10 @@ public function index(Request $request, $code) | |||
| 76 | 79 | } | |
| 77 | 80 | ||
| 78 | 81 | // 打乱数组 | |
| 79 | - if (self::$systemConfig['subscribe_max']) { | ||
| 80 | - shuffle($nodeList); | ||
| 82 | + if (self::$systemConfig['rand_subscribe']) { | ||
| 83 | + if (self::$systemConfig['subscribe_max']) { | ||
| 84 | + shuffle($nodeList); | ||
| 85 | + } | ||
| 81 | 86 | } | |
| 82 | 87 | ||
| 83 | 88 | // 控制客户端最多获取节点数 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ public function handle($request, Closure $next) | |||
| 25 | 25 | if (Agent::isRobot()) { | |
| 26 | 26 | Log::info("识别到机器人访问(" . getClientIp() . ")"); | |
| 27 | 27 | ||
| 28 | - return response()->view('error.403', [], 403); | ||
| 28 | + return response()->view('error.404', [], 404); | ||
| 29 | 29 | } | |
| 30 | 30 | } | |
| 31 | 31 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,7 +148,7 @@ | |||
| 148 | 148 | <label for="is_forbid_robot" class="col-md-3 control-label">阻止机器人访问</label> | |
| 149 | 149 | <div class="col-md-9"> | |
| 150 | 150 | <input type="checkbox" class="make-switch" @if($is_forbid_robot) checked @endif id="is_forbid_robot" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭"> | |
| 151 | - <span class="help-block"> 如果是机器人、爬虫、代理访问网站则会抛出403错误 </span> | ||
| 151 | + <span class="help-block"> 如果是机器人、爬虫、代理访问网站则会抛出404错误 </span> | ||
| 152 | 152 | </div> | |
| 153 | 153 | </div> | |
| 154 | 154 | <div class="col-md-6"> | |
@@ -295,6 +295,32 @@ | |||
| 295 | 295 | </div> | |
| 296 | 296 | </div> | |
| 297 | 297 | </div> | |
| 298 | + <div class="form-group"> | ||
| 299 | + <div class="col-md-6"> | ||
| 300 | + <label for="initial_labels_for_user" class="col-md-3 control-label">用户初始标签</label> | ||
| 301 | + <div class="col-md-9"> | ||
| 302 | + <select id="initial_labels_for_user" class="form-control select2-multiple" name="initial_labels_for_user" multiple="multiple"> | ||
| 303 | + @foreach($label_list as $label) | ||
| 304 | + <option value="{{$label->id}}" @if(in_array($label->id, explode(',', $initial_labels_for_user))) selected @endif>{{$label->name}}</option> | ||
| 305 | + @endforeach | ||
| 306 | + </select> | ||
| 307 | + <span class="help-block"> 注册用户时的初始标签 </span> | ||
| 308 | + </div> | ||
| 309 | + </div> | ||
| 310 | + <div class="col-md-6"> | ||
| 311 | + <label for="goods_purchase_limit_strategy" class="col-md-3 control-label">商品限购</label> | ||
| 312 | + <div class="col-md-9"> | ||
| 313 | + <select id="goods_purchase_limit_strategy" class="form-control select2" name="goods_purchase_limit_strategy"> | ||
| 314 | + <option value="none" @if($goods_purchase_limit_strategy == 'none') selected @endif>不限制</option> | ||
| 315 | + <option value="package" @if($goods_purchase_limit_strategy == 'package') selected @endif>仅限套餐</option> | ||
| 316 | + <option value="free" @if($goods_purchase_limit_strategy == 'free') selected @endif>仅限免费商品</option> | ||
| 317 | + <option value="package&free" @if($goods_purchase_limit_strategy == 'package&free') selected @endif>限套餐和免费商品</option> | ||
| 318 | + <option value="all" @if($goods_purchase_limit_strategy == 'all') selected @endif>限全部商品</option> | ||
| 319 | + </select> | ||
| 320 | + <span class="help-block"> 是否限制用户重复购买商品,限制后用户不可重复购买已购买的、尚在有效期的商品 </span> | ||
| 321 | + </div> | ||
| 322 | + </div> | ||
| 323 | + </div> | ||
| 298 | 324 | <div class="form-group"> | |
| 299 | 325 | <div class="col-md-6"> | |
| 300 | 326 | <label for="subscribe_domain" class="col-md-3 control-label">节点订阅地址</label> | |
@@ -317,57 +343,23 @@ | |||
| 317 | 343 | <button class="btn btn-success" type="button" onclick="setSubscribeMax()">修改</button> | |
| 318 | 344 | </span> | |
| 319 | 345 | </div> | |
| 320 | - <span class="help-block"> 客户端订阅时随机取得几个节点 </span> | ||
| 346 | + <span class="help-block"> 客户端订阅时取得几个节点 </span> | ||
| 321 | 347 | </div> | |
| 322 | 348 | </div> | |
| 323 | 349 | </div> | |
| 324 | 350 | <div class="form-group"> | |
| 325 | 351 | <div class="col-md-6"> | |
| 326 | - <label for="initial_labels_for_user" class="col-md-3 control-label">用户初始标签</label> | ||
| 352 | + <label for="mix_subscribe" class="col-md-3 control-label">混合订阅</label> | ||
| 327 | 353 | <div class="col-md-9"> | |
| 328 | - <select id="initial_labels_for_user" class="form-control select2-multiple" name="initial_labels_for_user" multiple="multiple"> | ||
| 329 | - @foreach($label_list as $label) | ||
| 330 | - <option value="{{$label->id}}" | ||
| 331 | - @if (in_array($label->id, explode(',', $initial_labels_for_user))) | ||
| 332 | - selected | ||
| 333 | - @endif | ||
| 334 | - >{{$label->name}}</option> | ||
| 335 | - @endforeach | ||
| 336 | - </select> | ||
| 337 | - <span class="help-block"> 注册用户时的初始标签 </span> | ||
| 354 | + <input type="checkbox" class="make-switch" @if($mix_subscribe) checked @endif id="mix_subscribe" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭"> | ||
| 355 | + <span class="help-block"> 启用后,订阅信息中将包含V2Ray节点信息(Vmess) </span> | ||
| 338 | 356 | </div> | |
| 339 | 357 | </div> | |
| 340 | 358 | <div class="col-md-6"> | |
| 341 | - <label for="goods_purchase_limit_strategy" class="col-md-3 control-label">商品限购</label> | ||
| 359 | + <label for="rand_subscribe" class="col-md-3 control-label">随机订阅</label> | ||
| 342 | 360 | <div class="col-md-9"> | |
| 343 | - <select id="goods_purchase_limit_strategy" class="form-control select2" name="goods_purchase_limit_strategy"> | ||
| 344 | - <option value="none" | ||
| 345 | - @if ($goods_purchase_limit_strategy == 'none') | ||
| 346 | - selected | ||
| 347 | - @endif | ||
| 348 | - >不限制</option> | ||
| 349 | - <option value="package" | ||
| 350 | - @if ($goods_purchase_limit_strategy == 'package') | ||
| 351 | - selected | ||
| 352 | - @endif | ||
| 353 | - >仅限套餐</option> | ||
| 354 | - <option value="free" | ||
| 355 | - @if ($goods_purchase_limit_strategy == 'free') | ||
| 356 | - selected | ||
| 357 | - @endif | ||
| 358 | - >仅限免费商品</option> | ||
| 359 | - <option value="package&free" | ||
| 360 | - @if ($goods_purchase_limit_strategy == 'package&free') | ||
| 361 | - selected | ||
| 362 | - @endif | ||
| 363 | - >限套餐和免费商品</option> | ||
| 364 | - <option value="all" | ||
| 365 | - @if ($goods_purchase_limit_strategy == 'all') | ||
| 366 | - selected | ||
| 367 | - @endif | ||
| 368 | - >限全部商品</option> | ||
| 369 | - </select> | ||
| 370 | - <span class="help-block"> 是否限制用户重复购买商品,限制后用户不可重复购买已购买的、尚在有效期的商品 </span> | ||
| 361 | + <input type="checkbox" class="make-switch" @if($rand_subscribe) checked @endif id="rand_subscribe" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭"> | ||
| 362 | + <span class="help-block"> 启用后,订阅时将随机返回节点信息,否则按节点排序返回 </span> | ||
| 371 | 363 | </div> | |
| 372 | 364 | </div> | |
| 373 | 365 | </div> | |
@@ -1145,6 +1137,36 @@ | |||
| 1145 | 1137 | } | |
| 1146 | 1138 | }); | |
| 1147 | 1139 | ||
| 1140 | + // 启用、禁用混合订阅 | ||
| 1141 | + $('#mix_subscribe').on({ | ||
| 1142 | + 'switchChange.bootstrapSwitch': function(event, state) { | ||
| 1143 | + var mix_subscribe = state ? 1 : 0; | ||
| 1144 | + | ||
| 1145 | + $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'mix_subscribe', value:mix_subscribe}, function (ret) { | ||
| 1146 | + layer.msg(ret.message, {time:1000}, function() { | ||
| 1147 | + if (ret.status == 'fail') { | ||
| 1148 | + window.location.reload(); | ||
| 1149 | + } | ||
| 1150 | + }); | ||
| 1151 | + }); | ||
| 1152 | + } | ||
| 1153 | + }); | ||
| 1154 | + | ||
| 1155 | + // 启用、禁用随机订阅 | ||
| 1156 | + $('#rand_subscribe').on({ | ||
| 1157 | + 'switchChange.bootstrapSwitch': function(event, state) { | ||
| 1158 | + var rand_subscribe = state ? 1 : 0; | ||
| 1159 | + | ||
| 1160 | + $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'rand_subscribe', value:rand_subscribe}, function (ret) { | ||
| 1161 | + layer.msg(ret.message, {time:1000}, function() { | ||
| 1162 | + if (ret.status == 'fail') { | ||
| 1163 | + window.location.reload(); | ||
| 1164 | + } | ||
| 1165 | + }); | ||
| 1166 | + }); | ||
| 1167 | + } | ||
| 1168 | + }); | ||
| 1169 | + | ||
| 1148 | 1170 | // 启用、禁用PushBear | |
| 1149 | 1171 | $('#is_push_bear').on({ | |
| 1150 | 1172 | 'switchChange.bootstrapSwitch': function(event, state) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -359,6 +359,8 @@ INSERT INTO `config` VALUES ('69', 'is_forbid_china', 0); | |||
| 359 | 359 | INSERT INTO `config` VALUES ('70', 'is_forbid_oversea', 0); | |
| 360 | 360 | INSERT INTO `config` VALUES ('71', 'is_verify_register', 0); | |
| 361 | 361 | INSERT INTO `config` VALUES ('72', 'node_daily_report', 0); | |
| 362 | + INSERT INTO `config` values ('73', 'mix_subscribe', 0); | ||
| 363 | + INSERT INTO `config` values ('74', 'rand_subscribe', 0); | ||
| 362 | 364 | ||
| 363 | 365 | ||
| 364 | 366 | -- ---------------------------- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + -- 混合订阅 | ||
| 2 | + INSERT INTO `config` values ('73', 'mix_subscribe', 0); | ||
| 3 | + | ||
| 4 | + -- 随机订阅 | ||
| 5 | + INSERT INTO `config` values ('74', 'rand_subscribe', 0); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments