Skip to content

Commit

Permalink
Merge pull request #6 from NimaQu/dev
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
GeekQu committed Jan 11, 2019
2 parents 98c9f36 + bb39517 commit 85364bd
Show file tree
Hide file tree
Showing 7 changed files with 545 additions and 239 deletions.
83 changes: 83 additions & 0 deletions app/Controllers/VueController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php

namespace App\Controllers;

use App\Models\InviteCode;
use App\Models\User;
use App\Models\Code;
use App\Models\Payback;
use App\Models\Paylist;
use App\Services\Auth;
use App\Services\Config;
use App\Services\Payment;
use App\Utils\AliPay;
use App\Utils\Tools;
use App\Utils\Telegram;
use App\Utils\Tuling;
use App\Utils\TelegramSessionManager;
use App\Utils\QRcode;
use App\Utils\Pay;
use App\Utils\TelegramProcess;
use App\Utils\Spay_tool;
use App\Utils\Geetest;

class VueController extends BaseController {

private $user;

public function __construct()
{
$this->user = Auth::getUser();
}

public function getGlobalConfig($request, $response, $args) {
$GtSdk = null;
$recaptcha_sitekey = null;
$user = $this->user;
if (Config::get('captcha_provider') != ''){
switch(Config::get('captcha_provider'))
{
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
break;
case 'geetest':
$uid = time().rand(1, 10000) ;
$GtSdk = Geetest::get($uid);
break;
}
}

if (Config::get('enable_telegram') == 'true') {
$login_text = TelegramSessionManager::add_login_session();
$login = explode("|", $login_text);
$login_token = $login[0];
$login_number = $login[1];
} else {
$login_token = '';
$login_number = '';
}

$res['globalConfig'] = array(
"geetest_html" => $GtSdk,
"login_token" => $login_token,
"login_number" => $login_number,
"telegram_bot" => Config::get('telegram_bot'),
"enable_logincaptcha" => Config::get('enable_login_captcha'),
"enable_regcaptcha" => Config::get('enable_reg_captcha'),
"base_url" => Config::get('enable_reg_captcha'),
"recaptcha_sitekey" => $recaptcha_sitekey,
"captcha_provider" => Config::get('captcha_provider'),
"jump_delay" => Config::get('jump_delay'),
"register_mode" => Config::get('register_mode'),
"enable_email_verify" => Config::get('enable_email_verify'),
"appName" => Config::get('appName'),
"dateY" => date("Y"),
"isLogin" => $user->isLogin,
);

$res['ret'] = 1;

return $response->getBody()->write(json_encode($res));
}

}
8 changes: 7 additions & 1 deletion app/Utils/TelegramProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

class TelegramProcess
{
private static $all_rss = [ "?mu=0" => "SSR普通订阅" ,
private static $all_rss = [
"clean_link"=>"重置订阅",
"?mu=0" => "SSR普通订阅" ,
"?mu=1" => "SSR单端口订阅",
"?mu=3" => "SS/SSD订阅",
"?mu=2" => "V2ray订阅",
Expand Down Expand Up @@ -50,6 +52,10 @@ private static function callback_bind_method($bot,$message,$command){
$reply_message = self::$all_rss[$command].": ".$subUrl.$ssr_sub_token.$command.PHP_EOL;
$bot->sendMessage($message->getChat()->getId(), $reply_message , $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
break;
case ($command=="clean_link"):
$user->clean_link();
$bot->sendMessage($message->getChat()->getId(), "链接重置成功" , $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);
break;
default:
$bot->sendMessage($message->getChat()->getId(), "???", $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to);

Expand Down
1 change: 1 addition & 0 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
$app->get('/tos', 'App\Controllers\HomeController:tos');
$app->get('/staff', 'App\Controllers\HomeController:staff');
$app->post('/telegram_callback', 'App\Controllers\HomeController:telegram');
$app->get('/globalconfig', 'App\Controllers\VueController:getGlobalConfig');

// User Center
$app->group('/user', function () {
Expand Down
Binary file modified public/favicon.ico
100644 → 100755
Binary file not shown.
106 changes: 99 additions & 7 deletions public/theme/material/css/index.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ a {
}

#index {
flex-wrap: wrap;
}

.flex {
display: flex;
}

.space-around {
justify-content: space-around;
}

.align-center {
align-items: center;
}

.warp {
flex-wrap: wrap;
}

Expand All @@ -24,8 +39,6 @@ a {

.logo-sm,
.auth-sm {
display: flex;
align-items: center;
padding: 1rem 1rem;
}

Expand All @@ -34,6 +47,10 @@ a {
justify-content: flex-end;
}

.auth>div:first-of-type {
padding: 0 2rem;
}

.logo-sm .logo {
height: 48px;
}
Expand All @@ -43,7 +60,6 @@ a {
}

.logo-sm>a {
display: flex;
align-items: center;
}

Expand Down Expand Up @@ -157,26 +173,50 @@ a {
}

.input-control {
display: flex;
justify-content: center;
flex-wrap: wrap;
width: 40%;
margin-left: auto;
margin-right: auto;
}

.input-control-inner {
flex-wrap: wrap;
text-align: left;
}

.input-control>label,
.input-control>input {
.input-control>input,
.input-control>select {
flex-basis: 80%;
text-align: left;
}

.input-control-inner>label,
.input-control-inner>input {
flex-basis: 100%;
}

.twin {
justify-content: space-around;
align-items: flex-end;
padding: 0;
}

.twin>* {
flex-basis: 100%%;
}

.input-control>input {
margin-bottom: 1rem;
}

.button-round {
display: block;
.reg {
flex-wrap: wrap;
}

.reg .input-control {
flex-basis: 100%;
}

input[name] {
Expand All @@ -185,6 +225,37 @@ input[name] {

select {
color: black;
height: 36px;
}

.button-round {
justify-content: center;
align-items: center;
margin-bottom: 1rem;
}

.icon-round {
background: white;
color: black;
border-radius: 50%;
width: 2rem;
height: 2rem;
display: inline-block;
margin-right: .75rem;
}

.fa {
position: relative;
}

.icon-round .fa-pencil {
top: .25rem;
left: .05rem
}

.icon-round .fa-plus {
top: .35rem;
left: .05rem
}

@media screen and (min-width:35.5em) {
Expand Down Expand Up @@ -213,12 +284,33 @@ select {
.time {
text-align: right;
}
.auth-links {
padding: 0;
}
.auth-links a {
flex-basis: 100%;
}
}

@media screen and (min-width:48em) {
.title h1 {
font-size: 5rem;
}
#register {
margin-top: 2rem;
}
.twin {
justify-content: space-around;
align-items: flex-end;
padding: 0 2.5%;
}

.twin>* {
flex-basis: 39%;
}
.reg .input-control {
flex-basis: 48%;
}
}

@media screen and (min-width:64em) {}
Expand Down
Loading

0 comments on commit 85364bd

Please sign in to comment.