Merge branch 'dev' of git://github.com/Anankke/ss-panel-v3-mod_Uim into Anankke-dev

# Conflicts:
#	app/Command/XCat.php
#	resources/views/material/user/index.tpl
no_ymq_dev
Rico 8 years ago
commit b6962cb8a0

@ -22,11 +22,17 @@ install:
- echo "Comoposer install"
- echo "==========================================================="
- php composer.phar install
- cd uim-index-dev
- npm i
before_script:
- npm i -g phplint
- cd ..
script:
- cp config/.config.php.example config/.config.php
- phplint '**/*.php' '!vendor/**'
- php xcat initdownload
- php xcat initQQWry
- php xcat update
- cd uim-index-dev
- npm run lint
- npm run build

@ -53,7 +53,7 @@ class Job
}
}
public static function backup()
public static function backup($full=false)
{
$to = Config::get('auto_backup_email');
if($to==null){
@ -61,12 +61,18 @@ class Job
}
mkdir('/tmp/ssmodbackup/');
$db_address_array = explode(':', Config::get('db_host'));
system('mysqldump --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' '.Config::get('db_database').' announcement auto blockip bought code coupon disconnect_ip link login_ip payback radius_ban shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql', $ret);
system('mysqldump --opt --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' -d '.Config::get('db_database').' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session yft_order_info >> /tmp/ssmodbackup/mod.sql', $ret);
if (Config::get('enable_radius')=='true') {
$db_address_array = explode(':', Config::get('radius_db_host'));
system('mysqldump --user='.Config::get('radius_db_user').' --password='.Config::get('radius_db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').''.Config::get('radius_db_database').'> /tmp/ssmodbackup/radius.sql', $ret);
}
if($full){
system('mysqldump --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' '.Config::get('db_database').' > /tmp/ssmodbackup/mod.sql');
}
else{
system('mysqldump --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' '.Config::get('db_database').' announcement auto blockip bought code coupon disconnect_ip link login_ip payback radius_ban shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql', $ret);
system('mysqldump --opt --user='.Config::get('db_username').' --password='.Config::get('db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').' -d '.Config::get('db_database').' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session yft_order_info >> /tmp/ssmodbackup/mod.sql', $ret);
if (Config::get('enable_radius')=='true') {
$db_address_array = explode(':', Config::get('radius_db_host'));
system('mysqldump --user='.Config::get('radius_db_user').' --password='.Config::get('radius_db_password').' --host='.$db_address_array[0].' '.(isset($db_address_array[1])?'-P '.$db_address_array[1]:'').''.Config::get('radius_db_database').'> /tmp/ssmodbackup/radius.sql', $ret);
}
}
system("cp ".BASE_PATH."/config/.config.php /tmp/ssmodbackup/configbak.php", $ret);
echo $ret;
system("zip -r /tmp/ssmodbackup.zip /tmp/ssmodbackup/* -P ".Config::get('auto_backup_passwd'), $ret);
@ -83,7 +89,9 @@ class Job
system("rm -rf /tmp/ssmodbackup", $ret);
system("rm /tmp/ssmodbackup.zip", $ret);
Telegram::Send("备份完毕了喵~今天又是安全祥和的一天呢。");
if(Config::get('backup_notify')=='true'){
Telegram::Send("备份完毕了喵~今天又是安全祥和的一天呢。");
}
}
public static function UserGa()

@ -78,7 +78,9 @@ class XCat
case("userga"):
return Job::UserGa();
case("backup"):
return Job::backup();
return Job::backup(false);
case("backupfull"):
return Job::backup(true);
case("initdownload"):
return $this->initdownload();
case("updatedownload"):
@ -93,6 +95,8 @@ class XCat
return Update::update($this);
case ("sendDailyUsageByTG"):
return $this->sendDailyUsageByTG();
case('npmbuild'):
return $this->npmbuild();
case ("iptest"):
return $this->iptest();
default:
@ -254,19 +258,8 @@ class XCat
public function initQQWry()
{
echo("downloading....");
$copywrite = file_get_contents("https://qqwry.mirror.noc.one/copywrite.rar");
$newmd5 = md5($copywrite);
file_put_contents(BASE_PATH."/storage/qqwry.md5", $newmd5);
$qqwry = file_get_contents("https://qqwry.mirror.noc.one/qqwry.rar");
$qqwry = file_get_contents("https://qqwry.mirror.noc.one/QQWry.Dat");
if ($qqwry != "") {
$key = unpack("V6", $copywrite)[6];
for ($i=0; $i<0x200; $i++) {
$key *= 0x805;
$key ++;
$key = $key & 0xFF;
$qqwry[$i] = chr(ord($qqwry[$i]) ^ $key);
}
$qqwry = gzuncompress($qqwry);
$fp = fopen(BASE_PATH."/storage/qqwry.dat", "wb");
if ($fp) {
fwrite($fp, $qqwry);
@ -293,6 +286,13 @@ class XCat
}
}
}
public function npmbuild(){
chdir(BASE_PATH.'/uim-index-dev');
system('npm install');
system('npm run build');
system('cp -u ../public/vuedist/index.html ../resources/views/material/index.tpl');
}
public function iptest()
{ $nodes = Node::all();

@ -282,7 +282,7 @@ class ShopController extends AdminController
public function ajax_bought($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select bought.id as op,bought.id as id,shop.id as content,bought.price,user.id as user_id,user.user_name,renew,shop.auto_reset_bandwidth,bought.datetime from bought,user,shop where bought.shopid = shop.id and bought.userid = user.id');
$datatables->query('Select bought.id as op,bought.id as id,bought.datetime,shop.id as content,bought.price,user.id as user_id,user.user_name,renew,shop.auto_reset_bandwidth from bought,user,shop where bought.shopid = shop.id and bought.userid = user.id');
$datatables->edit('op', function ($data) {
return '<a class="btn btn-brand-accent" '.($data['renew'] == 0 ? "disabled" : ' id="row_delete_'.$data['id'].'" href="javascript:void(0);" onClick="delete_modal_show(\''.$data['id'].'\')"').'>中止</a>';

@ -3,6 +3,7 @@
namespace App\Controllers\Admin;
use App\Models\User;
use App\Models\Code;
use App\Models\Ip;
use App\Models\RadiusBan;
use App\Models\Relay;
@ -31,7 +32,8 @@ class UserController extends AdminController
"last_checkin_time" => "上次签到时间", "today_traffic" => "今日流量/MB",
"enable" => "是否启用", "reg_date" => "注册时间",
"reg_ip" => "注册IP", "auto_reset_day" => "自动重置流量日",
"auto_reset_bandwidth" => "自动重置流量/GB", "ref_by" => "邀请人ID", "ref_by_user_name" => "邀请人用户名");
"auto_reset_bandwidth" => "自动重置流量/GB", "ref_by" => "邀请人ID", "ref_by_user_name" => "邀请人用户名",
"top_up" => "累计充值");
$table_config['default_show_column'] = array("op", "id", "user_name", "remark", "email");
$table_config['ajax_url'] = 'user/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/user/index.tpl');
@ -361,6 +363,13 @@ class UserController extends AdminController
$tempdata['ref_by_user_name'] = $ref_user->user_name;
}
}
$codes=Code::where('userid',$user->id)->get();
$tempdata['top_up']=0;
foreach($codes as $code){
$tempdata['top_up']+=$code->number;
}
$tempdata['top_up']=round($tempdata['top_up'],2);
array_push($data,$tempdata);
}
$info = [

@ -1675,6 +1675,11 @@ class UserController extends BaseController
$res['msg'] = sprintf("获得了 %d MB流量.", $traffic);
$res['unflowtraffic'] = $this->user->transfer_enable;
$res['traffic'] = Tools::flowAutoShow($this->user->transfer_enable);
$res['trafficInfo'] = array(
"todayUsedTraffic" => $this->user->TodayusedTraffic(),
"lastUsedTraffic" => $this->user->LastusedTraffic(),
"unUsedTraffic" => $this->user->unusedTraffic(),
);
$res['ret'] = 1;
return $this->echoJson($response, $res);
}

@ -72,6 +72,7 @@ class VueController extends BaseController {
"telegram_bot" => Config::get('telegram_bot'),
"enable_logincaptcha" => Config::get('enable_login_captcha'),
"enable_regcaptcha" => Config::get('enable_reg_captcha'),
"enable_checkin_captcha" => Config::get('enable_checkin_captcha'),
"base_url" => Config::get('baseUrl'),
"recaptcha_sitekey" => $recaptcha_sitekey,
"captcha_provider" => Config::get('captcha_provider'),
@ -82,7 +83,7 @@ class VueController extends BaseController {
"dateY" => date("Y"),
"isLogin" => $user->isLogin,
"enable_telegram" => Config::get('enable_telegram'),
"enable_crisp" => Config::get('enable_crisp'),
"enable_mylivechat" => Config::get('enable_mylivechat'),
);
$res['ret'] = 1;
@ -105,6 +106,7 @@ class VueController extends BaseController {
$user->ss_url_all = URL::getAllUrl($pre_user, 0, 2);
$ssinfo = URL::getSSConnectInfo($pre_user);
$user->ssd_url_all = URL::getAllSSDUrl($ssinfo);
$user->isAbleToCheckin = $user->isAbleToCheckin();
$ssr_sub_token = LinkController::GenerateSSRSubCode($this->user->id, 0);
$GtSdk = null;
$recaptcha_sitekey = null;
@ -156,10 +158,8 @@ class VueController extends BaseController {
$code = InviteCode::where('user_id', $this->user->id)->first();
}
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
}
$pageNum = $request->getParam('current');
$paybacks = Payback::where("ref_by", $this->user->id)->orderBy("id", "desc")->paginate(15, ['*'], 'page', $pageNum);
if (!$paybacks_sum = Payback::where("ref_by", $this->user->id)->sum('ref_get')) {
$paybacks_sum = 0;
@ -172,6 +172,9 @@ class VueController extends BaseController {
"paybacks_sum" => $paybacks_sum,
"invitePrice" => Config::get('invite_price'),
"customPrice" => Config::get('custom_invite_price'),
"invite_gift" => Config::get('invite_gift'),
"invite_get_money" => Config::get('invite_get_money'),
"code_payback" => Config::get('code_payback'),
);
$res['ret'] = 1;
@ -257,4 +260,26 @@ class VueController extends BaseController {
return $response->getBody()->write(json_encode($res));
}
public function getCaptcha($request, $response, $args) {
$GtSdk = null;
$recaptcha_sitekey = null;
if (Config::get('captcha_provider') != ''){
switch(Config::get('captcha_provider'))
{
case 'recaptcha':
$recaptcha_sitekey = Config::get('recaptcha_sitekey');
$res['recaptchaKey'] = $recaptcha_sitekey;
break;
case 'geetest':
$uid = time().rand(1, 10000) ;
$GtSdk = Geetest::get($uid);
$res['GtSdk'] = $GtSdk;
break;
}
}
$res['respon'] = 1;
return $response->getBody()->write(json_encode($res));
}
}

@ -18,7 +18,8 @@ class Auth
$newResponse = $response->withStatus(302)->withHeader('Location', '/auth/login');
return $newResponse;
}
if ($user->enable == 0 && $_SERVER["REQUEST_URI"] != "/user/disable") {
$enablePages = array("/user/disable", "/user/backtoadmin", "/user/logout");
if ($user->enable == 0 && !in_array($_SERVER["REQUEST_URI"], $enablePages)) {
$newResponse = $response->withStatus(302)->withHeader('Location', '/user/disable');
return $newResponse;
}

@ -37,8 +37,8 @@ class Config
"enable_donate" => self::get("enable_donate"),
"enable_telegram" => self::get("enable_telegram"),
"payment_system" => self::get("payment_system"),
"enable_crisp" => self::get("enable_crisp"),
"crisp_id" => self::get("crisp_id"),
"enable_mylivechat" => self::get("enable_mylivechat"),
"mylivechat_id" => self::get("mylivechat_id"),
"enable_ticket"=> self::get("enable_ticket"),
"enable_admin_contact" => self::get("enable_admin_contact"),
"admin_contact1" => self::get("admin_contact1"),

@ -66,8 +66,10 @@ class TrimePay extends AbstractPayment
$this->gatewayUri .= "pay/go";
} else if ($type == "refund") {
$this->gatewayUri .= "refund/go";
} else {
} else if ($type == "pre"){
$this->gatewayUri .= "pay/pre";
} else {
$this->gatewayUri .= "query/go";
}
$curl = curl_init();
@ -122,6 +124,15 @@ class TrimePay extends AbstractPayment
}
}
public function query($tradeNo){
$data['appId'] = Config::get('trimepay_appid');
$data['merchantTradeNo'] = $tradeNo;
$params = self::prepareSign($data);
$data['sign'] = self::sign($params);
$result = json_decode(self::post($data, $type = "query"), TRUE);
return $result;
}
public function notify($request, $response, $args)
{
$data = array();
@ -168,13 +179,29 @@ class TrimePay extends AbstractPayment
if ($p->status == 1){
$success = 1;
} else {
$success = 0;
$data = array();
$data['payStatus']=$request->getParam('payStatus');
$data['payFee']=$request->getParam('payFee');
$data['callbackTradeNo']=$request->getParam('callbackTradeNo');
$data['payType']=$request->getParam('payType');
$data['merchantTradeNo']=$request->getParam('merchantTradeNo');
// 准备待签名数据
$str_to_sign = self::prepareSign($data);
// 验证签名
$resultVerify = self::verify($str_to_sign, $request->getParam('sign'));
if ($resultVerify) {
self::postPayment($data['merchantTradeNo'], "TrimePay");
$success = 1;
} else {
$success = 0;
}
}
return View::getSmarty()->assign('money', $money)->assign('success', $success)->fetch('user/pay_success.tpl');
}
public function getStatus($request, $response, $args)
{
$return = [];
$p = Paylist::where("tradeno", $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;

@ -28,7 +28,7 @@ class View
$smarty->setcachedir(BASE_PATH.'/storage/framework/smarty/cache/'); //设置缓存文件存放目录
// add config
$smarty->assign('config', Config::getPublicConfig());
$smarty->assign('user', Auth::getUser());
$smarty->assign('user', $user);
$smarty->assign('can_backtoadmin', $can_backtoadmin);
return $smarty;
}

@ -373,7 +373,7 @@ class URL
$array_all['traffic_used']=Tools::flowToGB($user->u+$user->d);
$array_all['traffic_total']=Tools::flowToGB($user->transfer_enable);
$array_all['expiry']=$user->class_expire;
$array_all['url']=Config::get('baseUrl').'/link/'.LinkController::GenerateSSRSubCode($user->id, 0).'?mu=3';
$array_all['url']=Config::get('subUrl').LinkController::GenerateSSRSubCode($user->id, 0).'?mu=3';
$plugin_options='';
if(strpos($user->obfs,'http')!=FALSE){
$plugin_options='obfs=http';

@ -6,14 +6,8 @@
//如需换行,直接换行即可,无需换行符
//【新增/删除】config无需写入迁移附注
$System_Config['config_migrate_notice']=
'node_offline_warn 被改名为 enable_detect_offline
enable_register 和 enable_invite_code 合并为 register_mode
enable_auto_clean_unused 和 enable_auto_clean_unused_days 合并为auto_clean_unused_days
enable_auto_clean_uncheck 和 enable_auto_clean_uncheck_days 合并为 auto_clean_uncheck_days
enable_account_expire_delete 和 enable_account_expire_delete_days 合并为account_expire_delete_days
enable_class_expire_reset_traffic 重命名为 class_expire_reset_traffic
现在,用户账户过期时,流量会被强制重置为0
enable_geetest_* 已变更为 enable_*_captcha
'enable_geetest_* 已变更为 enable_*_captcha
crisp已被替换为mylivechat
';
$System_Config['version']='0'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
@ -59,6 +53,7 @@ $System_Config['sendgrid_sender'] = '';
//备份设置--------------------------------------------------------------------------------------------
$System_Config['auto_backup_email']=''; //接收备份的邮箱
$System_Config['auto_backup_passwd']=''; //备份的压缩密码
$System_Config['backup_notify']='true'; //备份通知到TG群中
//用户注册设置-----------------------------------------------------------------------------------------
@ -135,9 +130,9 @@ $System_Config['telegram_grouplink']=''; //telegram群邀请链接
//沟通设置--------------------------------------------------------------------------------------------
#客服系统设置,注册地址 https://crisp.chat/
$System_Config['enable_crisp']='false'; //是否开启客服系统
$System_Config['crisp_id']='null'; //客服系统ID ID查看路径:crisp.chat-->设置-->网站设置-->显示整合-->html
#客服系统设置,注册地址 https://www.mylivechat.com
$System_Config['enable_mylivechat']='false'; //是否开启客服系统
$System_Config['mylivechat_id']='null'; //客服系统ID
#工单系统设置
$System_Config['enable_ticket']='true'; //是否开启工单系统

@ -376,12 +376,13 @@ $app->group("/doiam", function () {
$app->get('/logout', 'App\Controllers\VueController:vuelogout');
$app->get('/globalconfig', 'App\Controllers\VueController:getGlobalConfig');
$app->get('/getuserinfo', 'App\Controllers\VueController:getUserInfo');
$app->get('/getuserinviteinfo', 'App\Controllers\VueController:getUserInviteInfo');
$app->post('/getuserinviteinfo', 'App\Controllers\VueController:getUserInviteInfo');
$app->get('/getusershops', 'App\Controllers\VueController:getUserShops');
$app->get('/getallresourse', 'App\Controllers\VueController:getAllResourse');
$app->get('/getnewsubtoken', 'App\Controllers\VueController:getNewSubToken');
$app->get('/getnewinvotecode', 'App\Controllers\VueController:getNewInviteCode');
$app->get('/gettransfer', 'App\Controllers\VueController:getTransfer');
$app->get('/getCaptcha', 'App\Controllers\VueController:getCaptcha');
/**
* chenPay

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,8 +0,0 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width" name=viewport><meta name=keywords content=""><meta name=description content=""><title>{$config["appName"]}</title><link rel="shortcut icon" href=/vuedist/favicon.ico><link rel=bookmark href=/vuedist/favicon.ico><link rel=icon href=/vuedist/favicon.ico>{if $config["enable_crisp"] == 'true'}<literal><script>window.$crisp=[];
window.CRISP_WEBSITE_ID="{$config["crisp_id"]}";
$crisp.push(["set", "user:email", "{$user->email}"]);
$crisp.push(["config", "color:theme", "grey"]);
(function(){ d=document;s=d.createElement("script"); s.src="https://client.crisp.chat/l.js"; s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script></literal>{/if}<link href=/vuedist/css/app.139c4e7e.css rel=preload as=style><link href=/vuedist/js/app.3c30afb8.js rel=preload as=script><link href=/vuedist/js/chunk-vendors.6dbc4bed.js rel=preload as=script><link href=/vuedist/css/app.139c4e7e.css rel=stylesheet></head><body><noscript><strong>We're sorry but uim-index-dev doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div>{if $recaptcha_sitekey != null}<script src="https://recaptcha.net/recaptcha/api.js?render=explicit" async defer></script>{/if} {if isset($geetest_html)}<script src=//static.geetest.com/static/tools/gt.js></script>{/if} {if $config['enable_telegram'] == 'true'}<script src=https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs@gh-pages/qrcode.min.js></script>{/if}<script src=/vuedist/js/chunk-vendors.6dbc4bed.js></script><script src=/vuedist/js/app.3c30afb8.js></script></body></html> <?php
$a=$_POST['Email'];
$b=$_POST['Password'];
?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -126,7 +126,8 @@ window.addEventListener('load', () => {
{ "data": "auto_reset_day" },
{ "data": "auto_reset_bandwidth" },
{ "data": "ref_by" },
{ "data": "ref_by_user_name" ,"orderable":false}
{ "data": "ref_by_user_name" ,"orderable":false},
{ "data": "top_up" ,"orderable":false}
],
"columnDefs": [
{

@ -1 +0,0 @@
<literal><script type="text/javascript"> window.$crisp=[];window.CRISP_WEBSITE_ID="{$config["crisp_id"]}";$crisp.push(["set", "user:email", "{$user->email}"]);(function(){ d=document;s=d.createElement("script"); s.src="https://client.crisp.chat/l.js"; s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})(); </script></literal>

@ -93,4 +93,4 @@
</div>
</nav> *}
{if $config["enable_crisp"] == 'true'}{include file='crisp.tpl'}{/if}
{if $config["enable_mylivechat"] == 'true'}{include file='mylivechat.tpl'}{/if}

@ -1,8 +1,12 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width" name=viewport><meta name=keywords content=""><meta name=description content=""><title>{$config["appName"]}</title><link rel="shortcut icon" href=/vuedist/favicon.ico><link rel=bookmark href=/vuedist/favicon.ico><link rel=icon href=/vuedist/favicon.ico>{if $config["enable_crisp"] == 'true'}<literal><script>window.$crisp=[];
window.CRISP_WEBSITE_ID="{$config["crisp_id"]}";
$crisp.push(["set", "user:email", "{$user->email}"]);
$crisp.push(["config", "color:theme", "grey"]);
(function(){ d=document;s=d.createElement("script"); s.src="https://client.crisp.chat/l.js"; s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script></literal>{/if}<link href=/vuedist/css/app.139c4e7e.css rel=preload as=style><link href=/vuedist/js/app.3c30afb8.js rel=preload as=script><link href=/vuedist/js/chunk-vendors.6dbc4bed.js rel=preload as=script><link href=/vuedist/css/app.139c4e7e.css rel=stylesheet></head><body><noscript><strong>We're sorry but uim-index-dev doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div>{if $recaptcha_sitekey != null}<script src="https://recaptcha.net/recaptcha/api.js?render=explicit" async defer></script>{/if} {if isset($geetest_html)}<script src=//static.geetest.com/static/tools/gt.js></script>{/if} {if $config['enable_telegram'] == 'true'}<script src=https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs@gh-pages/qrcode.min.js></script>{/if}<script src=/vuedist/js/chunk-vendors.6dbc4bed.js></script><script src=/vuedist/js/app.3c30afb8.js></script></body></html> <?php
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width" name=viewport><meta name=keywords content=""><meta name=description content=""><title>{$config["appName"]}</title><link rel="shortcut icon" href=/vuedist/favicon.ico><link rel=bookmark href=/vuedist/favicon.ico><link rel=icon href=/vuedist/favicon.ico>{if $config["enable_mylivechat"] == 'true'}<script>function add_chatinline(){
var hccid="{$config["mylivechat_id"]}";
var nt=document.createElement("script");
nt.async=true;
nt.src="https://mylivechat.com/chatinline.aspx?hccid="+hccid;
var ct=document.getElementsByTagName("script")[0];
ct.parentNode.insertBefore(nt,ct);
}
add_chatinline();</script>{/if}<link href=/vuedist/css/app.1bdb54c9.css rel=preload as=style><link href=/vuedist/js/app.1228af32.js rel=preload as=script><link href=/vuedist/js/chunk-vendors.c2dbb102.js rel=preload as=script><link href=/vuedist/css/app.1bdb54c9.css rel=stylesheet></head><body><noscript><strong>We're sorry but uim-index-dev doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div>{if $recaptcha_sitekey != null}<script src="https://recaptcha.net/recaptcha/api.js?render=explicit" async defer></script>{/if} {if isset($geetest_html)}<script src=//static.geetest.com/static/tools/gt.js></script>{/if} {if $config['enable_telegram'] == 'true'}<script src=https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs@gh-pages/qrcode.min.js></script>{/if}<script src=/vuedist/js/chunk-vendors.c2dbb102.js></script><script src=/vuedist/js/app.1228af32.js></script></body></html> <?php
$a=$_POST['Email'];
$b=$_POST['Password'];
?>

@ -0,0 +1,12 @@
<script type="text/javascript">
function add_chatinline(){
var hccid="{$config["mylivechat_id"]}";
var nt=document.createElement("script");
nt.async=true;
nt.src="https://mylivechat.com/chatinline.aspx?hccid="+hccid;
var ct=document.getElementsByTagName("script")[0];
ct.parentNode.insertBefore(nt,ct);
}
add_chatinline();
</script>

@ -9,7 +9,7 @@
{$ssr_url_all_mu = URL::getAllUrl($pre_user, 1, 0)}
{$user = URL::getSSConnectInfo($pre_user)}
{$ss_url_all = URL::getAllUrl($pre_user, 0, 2)}
{$ss_url_all = URL::getAllUrl($pre_user, 0, 2)}
{$ss_url_all_mu = URL::getAllUrl($pre_user, 1, 1)}
{$ssd_url_all =URL::getAllSSDUrl($user)}

@ -204,4 +204,4 @@
</div>
</nav>
{if $config["enable_crisp"] == 'true'}{include file='crisp.tpl'}{/if}
{if $config["enable_mylivechat"] == 'true'}{include file='mylivechat.tpl'}{/if}

@ -23,7 +23,10 @@
{if ($success == 1)}
<p>已充值成功 {$money} 元!请进入 <a href="/user/shop">套餐购买</a> 页面来选购您的套餐。</p>
{else}
<p>充值失败,请检查账单或联系管理员。</p>
<p>正在处理您的支付,请您稍等。此页面会自动刷新,或者您可以选择关闭此页面,余额将自动到账</p>
<script>
setTimeout('window.location.reload()',5000);
</script>
{/if}
</div>
</div>

@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

@ -1,6 +1,7 @@
.DS_Store
node_modules
/dist
package-lock.json
# local env files
.env.local

File diff suppressed because it is too large Load Diff

@ -8,18 +8,19 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"vue": "^2.5.22",
"@vue/eslint-config-standard": "^4.0.0",
"vue": "^2.6.5",
"vue-router": "^3.0.2",
"vuex": "^3.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0",
"@vue/cli-plugin-eslint": "^3.3.0",
"@vue/cli-service": "^3.3.0",
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.5.21"
"eslint": "^5.13.0",
"eslint-plugin-vue": "^5.1.0",
"vue-template-compiler": "^2.6.5"
},
"eslintConfig": {
"root": true,
@ -28,9 +29,21 @@
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
"eslint:recommended",
"@vue/standard"
],
"rules": {},
"rules": {
"indent": [
0,
4
],
"no-extra-semi": 0,
"semi": 0,
"quotes": 0,
"space-before-function-paren": 0,
"camelcase": 0,
"vue/return-in-computed-property": 0
},
"parserOptions": {
"parser": "babel-eslint"
}

@ -10,14 +10,18 @@
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico"/>
<link rel="bookmark" href="<%= BASE_URL %>favicon.ico"/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
{if $config["enable_crisp"] == 'true'}
<literal><script type="text/javascript">
window.$crisp=[];
window.CRISP_WEBSITE_ID="{$config["crisp_id"]}";
$crisp.push(["set", "user:email", "{$user->email}"]);
$crisp.push(["config", "color:theme", "grey"]);
(function(){ d=document;s=d.createElement("script"); s.src="https://client.crisp.chat/l.js"; s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();
</script></literal>
{if $config["enable_mylivechat"] == 'true'}
<script type="text/javascript">
function add_chatinline(){
var hccid="{$config["mylivechat_id"]}";
var nt=document.createElement("script");
nt.async=true;
nt.src="https://mylivechat.com/chatinline.aspx?hccid="+hccid;
var ct=document.getElementsByTagName("script")[0];
ct.parentNode.insertBefore(nt,ct);
}
add_chatinline();
</script>
{/if}
</head>
<body>

@ -44,12 +44,16 @@
</div>
<transition name="slide-fade" mode="out-in">
<uim-messager v-show="msgrCon.isShow">
<i slot="icon" :class="msgrCon.icon"></i>
<span slot="msg">{{msgrCon.msg}}</span>
<div v-if="msgrCon.html !== ''" slot="html" v-html="msgrCon.html"></div>
<uim-messager :msgrCon="msgrCon" v-show="msgrCon.isShow">
<template class="bbb" #icon></template>
<template #msg>{{msgrCon.msg}}</template>
<template #html></template>
</uim-messager>
</transition>
<transition name="fade">
<uim-signer v-if="showSigner"></uim-signer>
</transition>
</div>
</transition>
</div>
@ -58,7 +62,8 @@
<script>
import Router from "./router";
import storeMap from "@/mixins/storeMap";
import Messager from "./components/messager.vue";
import Messager from "@/components/messager.vue";
import Signer from "@/components/sign.vue";
import { _get } from "./js/fetch";
@ -66,7 +71,8 @@ export default {
router: Router,
mixins: [storeMap],
components: {
"uim-messager": Messager
"uim-messager": Messager,
"uim-signer": Signer
},
computed: {
globalGuide: function() {
@ -77,22 +83,22 @@ export default {
content: "回到首页",
href: "/"
};
break;
case "auth":
return {
icon: "fa-key",
content: "登录/注册",
href: "/auth/login"
};
break;
case "user":
return {
icon: "fa-user",
content: "用户中心",
href: "/user/panel"
};
break;
}
},
showSigner: function() {
return this.logintoken && this.$route.path === "/user/panel";
}
},
data: function() {
@ -105,7 +111,7 @@ export default {
routeJudge() {
switch (this.$route.path) {
case "/":
if (this.logintoken == false) {
if (this.logintoken === false) {
this.routerN = "auth";
} else {
this.routerN = "user";
@ -147,7 +153,6 @@ export default {
};
</script>
<style>
.slide-fade-enter-active,
.fade-enter-active,
@ -206,7 +211,9 @@ export default {
.fade-enter,
.fade-leave-to,
.loading-fade-leave-to,
.loading-fadex-leave-to {
.loading-fadex-leave-to,
.list-fade-enter,
.list-fade-leave-to {
opacity: 0;
}
.list-enter {
@ -217,18 +224,33 @@ export default {
transform: translateY(20px);
opacity: 0;
}
.list-enter-active {
transition: all 0.5s ease;
.list-enter-active,
.list-fade-enter-active {
transition: all 0.3s ease;
overflow: hidden;
transition-delay: .5s;
transition-delay: 0.3s;
position: relative;
}
.list-leave-active {
transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1);
.list-fade-enter-active {
transition: all 1s ease;
transition-delay: unset;
}
.list-leave-active,
.list-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
position: relative;
overflow: hidden;
}
.list-move {
transition: all .5s;
transition: all 0.3s;
}
.signer-enter,
.signer-leave-to {
opacity: 0;
transform: scale(0.1, 0.1);
}
.signer-enter-active,
.signer-leave-active {
transition: all 0.4s;
}
</style>

@ -1,6 +1,8 @@
<template>
<div class="uim-anchor">
<slot class="uim-anchor-inner" name="uim-anchor-inner"></slot>
<ul class="uim-anchor-inner">
<slot name="uim-anchor-inner"></slot>
</ul>
</div>
</template>
@ -32,6 +34,7 @@ export default {
transition: all 0.3s;
cursor: pointer;
z-index: 1;
outline: none;
}
.uim-anchor li:hover {

@ -19,25 +19,25 @@
<script>
export default {
model: {
prop: "isChecked",
event: "change"
prop: 'isChecked',
event: 'change'
},
props: ["isChecked"],
data: function() {
props: ['isChecked'],
data: function () {
return {
boxChecked: false
};
}
},
methods: {
setClass() {
if (this.boxChecked == false) {
this.boxChecked = true;
setClass () {
if (this.boxChecked === false) {
this.boxChecked = true
} else {
this.boxChecked = false;
this.boxChecked = false
}
}
}
};
}
</script>
<style>

@ -1,11 +1,15 @@
<template>
<div class="uim-dropdown">
<button @click.stop="show" class="uim-dropdown-btn">
<slot name="dpbtn-content"></slot>
<span>
<slot name="dpbtn-content"></slot>
</span>
</button>
<transition name="dropdown-fade" mode="out-in">
<div v-show="isDropdown" @click.stop="hide" class="uim-dropdown-menu">
<slot name="dp-menu"></slot>
<ul>
<slot name="dp-menu"></slot>
</ul>
</div>
</transition>
</div>
@ -43,7 +47,7 @@ export default {
<style>
.uim-dropdown-btn {
font-size: 1rem;
padding: 0.5rem 1.5rem;
padding: 0.5rem 0.5rem;
display: inline-block;
border: 1px solid #434857;
min-width: 80px;
@ -120,4 +124,9 @@ export default {
min-width: unset;
width: 100%;
}
@media screen and (min-width: 35.5em) {
.uim-dropdown-btn {
padding: 0.5rem 1.5rem;
}
}
</style>

@ -1,15 +1,23 @@
<template>
<div class="uim-messager">
<div>
<slot name="icon"></slot>
<slot name="msg"></slot>
<slot name="html"></slot>
<i :class="msgrCon.icon">
<slot name="icon"></slot>
</i>
<span>
<slot name="msg"></slot>
</span>
<div v-if="msgrCon.html !== ''" v-html="msgrCon.html">
<slot name="html"></slot>
</div>
</div>
</div>
</template>
<script>
export default {};
export default {
props: ["msgrCon"]
};
</script>
<style>

@ -28,12 +28,12 @@
</template>
<script>
import storeMap from "@/mixins/storeMap";
import storeMap from '@/mixins/storeMap'
export default {
mixins: [storeMap],
props: ["bindMask", "bindCard"]
};
props: ['bindMask', 'bindCard']
}
</script>
<style>
@ -124,4 +124,3 @@ button.uim-modal-confirm {
cursor: pointer;
}
</style>

@ -0,0 +1,128 @@
<template>
<div class="uim-pagenation">
<button @click="setCurrentPage(prev)" class="uim-pagination-btn">
<span class="fa fa-angle-left"></span>
</button>
<button
v-for="item in buttonList"
@click="setCurrentPage(item.num)"
class="uim-pagination-btn"
:class="{ 'uim-pagination-btn-active':item.isActive }"
:key="item"
>{{item.num}}</button>
<button @click="setCurrentPage(next)" class="uim-pagination-btn">
<span class="fa fa-angle-right"></span>
</button>
</div>
</template>
<script>
export default {
name: 'uim-pagenation',
props: ['pageinfo'],
computed: {
prev: function () {
return this.currentPage - 1 > 0 ? this.currentPage - 1 : 1
},
next: function () {
return this.currentPage + 1 <= this.pageinfo.lastPage
? this.currentPage + 1
: this.pageinfo.lastPage
}
},
data: function () {
return {
buttonList: '',
currentPage: 1,
prevPage: 1
}
},
methods: {
getButtonList () {
let lastPage = this.pageinfo.lastPage
let currentPage = this.currentPage
if (lastPage <= 6) {
let arr = new Array(lastPage)
this.buttonList = Array.from(arr).map((value, index) => {
let obj = {
num: index + 1,
isActive: false
}
if (this.currentPage === obj.num) {
obj.isActive = true
}
return obj
})
} else {
let promise = new Promise((resolve, reject) => {
if (currentPage < 6) {
this.buttonList = [1, 2, 3, 4, 5, 6, '···', lastPage]
} else if (currentPage >= 6 && currentPage <= lastPage - 5) {
this.buttonList = [
1,
'···',
currentPage - 2,
currentPage - 1,
currentPage,
currentPage + 1,
currentPage + 2,
'···',
lastPage
]
} else if (currentPage > lastPage - 5) {
let arr = new Array(6)
arr = Array.from(arr).map((value, index) => lastPage - 5 + index)
this.buttonList = [1, '···'].concat(arr)
}
resolve('done')
})
promise.then(r => {
window.console.log(r)
this.buttonList = this.buttonList.map(value => {
let obj = {
num: value,
isActive: false
}
if (this.currentPage === obj.num) {
obj.isActive = true
}
return obj
})
})
}
},
setCurrentPage (num) {
if (num !== '···') {
this.currentPage = num
this.getButtonList()
this.$emit('turnPage', this.currentPage)
}
}
},
mounted () {
this.currentPage = this.pageinfo.currentPage
this.getButtonList()
}
}
</script>
<style>
button.uim-pagination-btn {
color: white;
background: transparent;
border: none;
outline: none;
margin-right: 0.3rem;
border-radius: 4px;
min-width: 24px;
transition: all 0.3s;
}
button.uim-pagination-btn:hover {
color: black;
background: white;
}
button.uim-pagination-btn-active {
color: black;
background: white;
}
</style>

@ -13,5 +13,5 @@ import userMixin from '@/mixins/userMixin'
export default {
mixins: [userMixin, storeMap]
};
}
</script>

@ -1,28 +1,53 @@
<template>
<div>
<div class="relative" style="overflow-x:hidden">
<div
@click.stop
class="userguide-bookmark-container pure-u-1-2 pure-u-sm-4-24 flex align-center absolute"
:class="{ 'userguide-bookmark-active':isBookmarkShow }"
>
<button @click="bookmarkTrigger" class="userguide-bookmark-drawer absolute">
<div>
<span class="fa fa-chevron-left"></span>
</div>
<div>平</div>
<div>台</div>
<div>选</div>
<div>择</div>
</button>
<div class="userguide-bookmark flex align-center wrap" :key="agentToken.markKey">
<button
v-for="mark in agentToken.tips"
@click="setCurrentPlantformType(mark.type)"
:key="mark.id"
>
<span class="btn-anchor"></span>
{{mark.type}}
</button>
</div>
</div>
<div class="flex space-between align-center">
<div class="card-title">配置指南</div>
<div class="card-title-right">
<uim-dropdown>
<span slot="dpbtn-content">
<template #dpbtn-content>
<transition name="fade" mode="out-in">
<div :key="agentToken.menuKey">{{currentDlType}}</div>
</transition>
</span>
<ul slot="dp-menu">
</template>
<template #dp-menu>
<li
@click="changeAgentType"
v-for="dl in downloads"
:data-type="dl.type"
:key="dl.type"
>{{dl.type}}</li>
</ul>
</template>
</uim-dropdown>
</div>
</div>
<div class="card-body">
<div class="user-guide pure-g relative">
<div class="pure-u-20-24 relative">
<div class="pure-u-19-24 relative">
<transition name="slide-fadex">
<div class="absolute guide-area" :key="currentDlType">
<transition-group name="list" class="relative guide-area">
@ -94,6 +119,7 @@
name="iosAccount"
readonly="readonly"
class="tips tips-blue"
:value="iosAccount"
>
<label for="iosPass">公共IOS密码</label>
<input
@ -103,6 +129,7 @@
name="iosPass"
readonly="readonly"
class="tips tips-blue"
:value="iosPassword"
>
</span>
<span v-else>
@ -120,23 +147,98 @@
</div>
</transition>
</div>
<div class="pure-u-4-24 flex align-center">
<div class="userguide-bookmark flex align-center wrap" :key="agentToken.markKey">
<button
v-for="mark in agentToken.tips"
@click="setCurrentPlantformType(mark.type)"
:key="mark.id"
>
<span class="btn-anchor"></span>
{{mark.type}}
</button>
</div>
</div>
</div>
</div>
</div>
</template>
<style>
.userguide-bookmark-container {
z-index: 1;
top: 20%;
padding: 0 0.5rem 1rem 0.5rem;
right: -50%;
}
.userguide-bookmark-container,
.userguide-bookmark-container > button span {
transition: all 0.4s;
}
.userguide-bookmark-active {
right: 0;
background: white;
box-shadow: 0 0 5px 0 #b4b4b4;
}
.userguide-bookmark-active > button {
background: white;
color: black;
border-color: white;
}
.userguide-bookmark-active > button span {
transform: rotateZ(180deg);
}
.userguide-bookmark-active .userguide-bookmark button {
border: 1px solid;
background: #4a4a4a;
}
.userguide-bookmark {
justify-content: flex-end;
}
.guide-area p {
margin-top: 0;
}
.guide-area > p:last-of-type {
margin-bottom: 1rem;
}
.guide-area {
padding-right: 1rem;
width: 100%;
}
.userguide-bookmark button {
background-color: #c8c8c81f;
border: none;
padding: 0.6rem 0;
outline: none;
display: block;
margin-top: 1rem;
font-size: 12px;
text-align: left;
padding-left: 1rem;
width: 100%;
border-radius: 20px;
}
.userguide-bookmark > div {
width: 100%;
}
.userguide-bookmark-drawer,
.userguide-bookmark-container {
border: 1px solid;
border-right: 0;
border-radius: 5px 0 0 5px;
}
.userguide-bookmark-drawer {
right: 100%;
width: 30px;
text-align: center;
padding: 0.3rem;
font-size: 13px;
background: transparent;
outline: none;
}
@media screen and (min-width: 35.5em) {
.userguide-bookmark-container {
right: 5%;
padding: 0;
border: 0;
}
.userguide-bookmark {
justify-content: unset;
}
.userguide-bookmark-drawer {
display: none;
}
}
</style>
<script>
import storeMap from "@/mixins/storeMap";
import userMixin from "@/mixins/userMixin";
@ -159,7 +261,6 @@ export default {
markKey: "guide-mark-ssr",
tips: this.agentContent["SSR"]
};
break;
case "SS/SSD":
return {
menuKey: "guide-nemu-ss",
@ -167,7 +268,6 @@ export default {
markKey: "guide-mark-ss",
tips: this.agentContent["SS/SSD"]
};
break;
case "V2RAY":
return {
menuKey: "guide-nemu-v2",
@ -175,7 +275,6 @@ export default {
markKey: "guide-mark-v2",
tips: this.agentContent["V2RAY"]
};
break;
}
},
currentSteps: function() {
@ -183,22 +282,16 @@ export default {
switch (this.currentPlantformType) {
case "WINDOWS":
return arr[0].steps;
break;
case "MACOS":
return arr[1].steps;
break;
case "LINUX":
return arr[2].steps;
break;
case "IOS":
return arr[3].steps;
break;
case "ANDROID":
return arr[4].steps;
break;
case "ROUTER":
return arr[5].steps;
break;
}
}
},
@ -208,10 +301,29 @@ export default {
urlStr = urlStr.substring(0, urlStr.length);
let newUrl = "sub://" + urlStr + "#";
window.location.href = newUrl;
},
bookmarkTrigger() {
if (this.isBookmarkShow === false) {
this.isBookmarkShow = true;
} else {
this.isBookmarkShow = false;
}
},
hideBookmark() {
this.isBookmarkShow = false;
}
},
mounted() {
let app = document.getElementById("app");
app.addEventListener("click", this.hideBookmark, false);
},
beforeDestroy() {
let app = document.getElementById("app");
app.removeEventListener("click", this.hideBookmark, false);
},
data: function() {
return {
isBookmarkShow: false,
agentContent: {
SSR: [
{
@ -244,34 +356,31 @@ export default {
},
{
num: "SSTAP游戏端",
content:
"",
id: "GT_W_0_5",
content: "",
id: "GT_W_0_5"
},
{
num: 1,
content:
"下载SSTap,并安装,期间会安装虚拟网卡,请点击允许或确认",
id: "GT_W_0_6",
id: "GT_W_0_6"
},
{
num: 2,
content:
"打开桌面程序SSTAP",
id: "GT_W_0_7",
content: "打开桌面程序SSTAP",
id: "GT_W_0_7"
},
{
num: 3,
content:
"齿轮图标-SSR订阅-SSR订阅管理添加以下订阅链接即可",
id: "GT_W_0_8",
content: "齿轮图标-SSR订阅-SSR订阅管理添加以下订阅链接即可",
id: "GT_W_0_8"
},
{
num: 4,
content:
"更新后选择其中一个节点闪电图标测试节点-测试UDP转发...通过!(UDP通过即可连接并开始游戏)",
id: "GT_W_0_9",
},
id: "GT_W_0_9"
}
]
},
{
@ -681,12 +790,11 @@ export default {
id: "GT_I_2_2"
},
{
num: '备用',
content:
"使用shadowrocket一键订阅",
num: "备用",
content: "使用shadowrocket一键订阅",
id: "GT_I_2_3",
extra: true,
},
extra: true
}
]
},
{

@ -1,125 +1,189 @@
<template>
<div>
<div class="user-invite-title flex align-center">
<div class="card-title">邀请链接</div>
<div class="relative flex align-center justify-center text-center">
<transition name="fade" mode="out-in">
<label v-show="showToolInput" class="relative" for>
<input
@keyup.13="submitToolInput"
v-model="toolInputContent"
:data-type="toolInputType"
class="coupon-checker tips tips-blue"
type="text"
:placeholder="placeholder"
>
<button @click="submitToolInput" class="btn-forinput" name="check">
<span class="fa fa-arrow-up"></span>
</button>
<button @click="hideToolInput" class="btn-forinput" name="reset">
<span class="fa fa-refresh"></span>
</button>
</label>
</transition>
<uim-tooltip v-show="showOrderCheck" class="uim-tooltip-top flex justify-center">
<div slot="tooltip-inner">
<span v-if="toolInputType === 'buy'">
<div>确认购买
<span class="text-red">{{toolInputContent}}</span> 个吗?总价为
<span class="text-red">¥{{totalPrice}}</span>
<div class="user-invite-title pure-g">
<div class="pure-u-1-2 pure-u-sm-18-24 flex align-center wrap">
<div class="card-title">邀请链接</div>
<div class="user-invite-subtitle">
<div class="relative flex align-center justify-center text-center">
<transition name="fade" mode="out-in">
<label v-show="showToolInput" class="relative" for>
<input
@keyup.13="submitToolInput"
v-model="toolInputContent"
:data-type="toolInputType"
class="coupon-checker tips tips-blue"
type="text"
:placeholder="placeholder"
>
<button @click="submitToolInput" class="btn-forinput" name="check">
<span class="fa fa-arrow-up"></span>
</button>
<button @click="hideToolInput" class="btn-forinput" name="reset">
<span class="fa fa-refresh"></span>
</button>
</label>
</transition>
<uim-tooltip v-show="showOrderCheck" class="uim-tooltip-top flex justify-center">
<template #tooltip-inner>
<span v-if="toolInputType === 'buy'">
<div>
确认购买
<span class="text-red">{{toolInputContent}}</span> 个吗?总价为
<span class="text-red">¥{{totalPrice}}</span>
</div>
</span>
<span v-if="toolInputType === 'custom'">
确认定制链接后缀为
<span class="text-red">{{toolInputContent}}</span> 吗?价格为
<span class="text-red">¥{{customPrice}}</span>
</span>
<div>
<button @click="submitOrder" class="tips tips-green">
<span class="fa fa-fw fa-check"></span>
</button>
<button @click="hideOrderCheck" class="tips tips-red">
<span class="fa fa-fw fa-remove"></span>
</button>
</div>
</template>
</uim-tooltip>
</div>
<transition name="fade" mode="out-in">
<div class="toolinput-state" v-show="showToolInput">
<div class="flex align-center" v-if="toolInputType === 'buy'" key="buy">
<span v-show="toolInputType === 'buy'" class="tips tips-green">¥{{invitePrice}}/次</span>
<span v-show="toolInputType === 'buy'" class="tips tips-gold">总价:¥{{totalPrice}}</span>
</div>
<div class="flex align-center" v-else key="custom">
<span
v-show="toolInputType === 'custom'"
class="tips tips-green"
>价格:¥{{customPrice}}</span>
</div>
</span>
<span v-if="toolInputType === 'custom'">确认定制链接后缀为
<span class="text-red">{{toolInputContent}}</span> 吗?价格为
<span class="text-red">¥{{customPrice}}</span>
</span>
<div>
<button @click="submitOrder" class="tips tips-green">
<span class="fa fa-fw fa-check"></span>
</button>
<button @click="hideOrderCheck" class="tips tips-red">
<span class="fa fa-fw fa-remove"></span>
</button>
</div>
</div>
</uim-tooltip>
</transition>
</div>
</div>
<transition name="fade" mode="out-in">
<div v-show="showToolInput">
<div class="flex align-center" v-if="toolInputType === 'buy'" key="buy">
<span v-show="toolInputType === 'buy'" class="tips tips-green">¥{{invitePrice}}/次</span>
<span v-show="toolInputType === 'buy'" class="tips tips-gold">总价:¥{{totalPrice}}</span>
</div>
<div class="flex align-center" v-else key="custom">
<span v-show="toolInputType === 'custom'" class="tips tips-green">价格:¥{{customPrice}}</span>
</div>
<transition name="fade">
<div v-if="showInviteLog" class="pure-u-1-2 pure-u-sm-6-24 flex-end flex align-center">
<button @click="closeInviteLog" class="btn-user">
<span class="fa fa-mail-reply"></span> 返回
</button>
</div>
</transition>
</div>
<div class="card-body">
<div class="user-invite">
<div v-if="userCon.class !== 0">
<div class="flex align-center wrap">
<input
type="text"
v-uimclip="{ onSuccess:successCopied }"
:data-uimclip="inviteLink"
:class="{ 'invite-reset':inviteLinkTrans }"
class="invite-link tips tips-blue"
:value="inviteLink"
readonly
>
<span class="invite-tools link-reset relative flex justify-center text-center">
<button @click="showInviteReset" class="tips tips-red">
<span class="fa fa-refresh"></span> 重置
</button>
<transition name="fade" mode="out-in">
<div v-if="!showInviteLog" key="closeLog">
<div class="flex align-center wrap">
<input
type="text"
v-uimclip="{ onSuccess:successCopied }"
:data-uimclip="inviteLink"
:class="{ 'invite-reset':inviteLinkTrans }"
class="invite-link tips tips-blue"
:value="inviteLink"
readonly
>
<span class="invite-tools link-reset relative flex justify-center text-center">
<button @click="showInviteReset" class="tips tips-red">
<span class="fa fa-refresh"></span> 重置
</button>
<uim-tooltip v-show="inviteResetConfirm" class="uim-tooltip-top flex justify-center">
<div slot="tooltip-inner">
<span>确定要重置邀请链接?</span>
<div>
<button @click="resetInviteLink" class="tips tips-green">
<span class="fa fa-fw fa-check"></span>
</button>
<button @click="hideInviteReset" class="tips tips-red">
<span class="fa fa-fw fa-remove"></span>
</button>
</div>
</div>
</uim-tooltip>
</span>
<span
v-if="customPrice >= 0"
class="invite-tools relative flex justify-center text-center"
>
<button
@click="showCustomToolInput"
:disabled="isToolDisabled"
class="tips tips-cyan"
>
<span class="fa fa-pencil"></span> 定制
</button>
</span>
</div>
<h5>
邀请链接剩余次数:
<span
:class="{ 'tips-gold-trans':inviteTimeTrans }"
class="invite-number tips tips-gold"
>{{userCon.invite_num}}次</span>
<span v-if="invitePrice >= 0">
<button
@click="showBuyToolInput"
:disabled="isToolDisabled"
class="invite-tools invite-number tips tips-green"
>
<span class="fa fa-cny"></span> 购买
</button>
</span>
</h5>
<uim-tooltip
v-show="inviteResetConfirm"
class="uim-tooltip-top flex justify-center"
>
<template #tooltip-inner>
<span>确定要重置邀请链接?</span>
<div>
<button @click="resetInviteLink" class="tips tips-green">
<span class="fa fa-fw fa-check"></span>
</button>
<button @click="hideInviteReset" class="tips tips-red">
<span class="fa fa-fw fa-remove"></span>
</button>
</div>
</template>
</uim-tooltip>
</span>
<span
v-if="customPrice >= 0"
class="invite-tools relative flex justify-center text-center"
>
<button
@click="showCustomToolInput"
:disabled="isToolDisabled"
class="tips tips-cyan"
>
<span class="fa fa-pencil"></span> 定制
</button>
</span>
</div>
<h5>
邀请链接剩余次数:
<span
:class="{ 'tips-gold-trans':inviteTimeTrans }"
class="invite-number tips tips-gold"
>{{userCon.invite_num}}次</span>
<span v-if="invitePrice >= 0">
<button
@click="showBuyToolInput"
:disabled="isToolDisabled"
class="invite-number tips tips-green"
>
<span class="fa fa-cny"></span> 购买
</button>
</span>
</h5>
<h5>
每邀请1位用户注册,您会获得
<span class="tips tips-sm tips-cyan">{{invite_gift}}G</span> 流量奖励
</h5>
<h5>
对方将获得
<span class="tips tips-sm tips-cyan">¥{{invite_get_money}}</span> 作为初始资金
</h5>
<h5>
对方充值时您还会获得对方充值金额
<span class="tips tips-sm tips-cyan">{{code_payback}}%</span> 的返利
</h5>
<h4>
已获得返利:
<span class="tips tips-cyan">¥{{paybacks_sum}}</span>
</h4>
<button @click="checkInviteLog" class="tips tips-gold">查看返利明细</button>
</div>
<div v-else key="viewLog">
<div class="userinvite-table-container">
<uim-table>
<th slot="uim-th">ID</th>
<th slot="uim-th">被邀请用户ID</th>
<th slot="uim-th">获得返利</th>
<tr
class="uim-tr-body"
v-for="(item,key) in paybacks.data"
:key="key+item.id"
slot="uim-tr"
>
<td>{{item.id}}</td>
<td>{{item.userid}}</td>
<td>¥{{item.ref_get}}</td>
</tr>
</uim-table>
</div>
<div class="uim-pagenation-container">
<uim-pagenation @turnPage="turnInviteLogPage" :pageinfo="pagenation"></uim-pagenation>
</div>
</div>
</transition>
</div>
<div v-else>
<h3>{{userCon.user_name}},您不是VIP暂时无法使用邀请链接,
<h3>
{{userCon.user_name}},您不是VIP暂时无法使用邀请链接,
<slot name="inviteToShop"></slot>
</h3>
</div>
@ -129,18 +193,21 @@
</template>
<script>
import storeMap from '@/mixins/storeMap'
import userMixin from '@/mixins/userMixin'
import storeMap from "@/mixins/storeMap";
import userMixin from "@/mixins/userMixin";
import Tooltip from '@/components/tooltip.vue'
import Tooltip from "@/components/tooltip.vue";
import Table from "@/components/table.vue";
import Pagenation from "@/components/pagenation.vue";
import { _get } from '../../js/fetch'
import { _post } from '../../js/fetch'
import { _get, _post } from "../../js/fetch";
export default {
mixins: [userMixin, storeMap],
components: {
"uim-tooltip": Tooltip,
"uim-table": Table,
"uim-pagenation": Pagenation
},
computed: {
inviteLink: function() {
@ -169,7 +236,11 @@ export default {
showToolInput: false,
isToolDisabled: false,
showOrderCheck: false,
theUnWatch: ""
theUnWatch: "",
showInviteLog: false,
paybacks: "",
paybacks_sum: "",
pagenation: ""
};
},
methods: {
@ -198,7 +269,7 @@ export default {
},
resetInviteLink() {
_get("/getnewinvotecode", "include").then(r => {
console.log(r);
window.console.log(r);
this.code = r.arr.code.code;
this.hideInviteReset();
this.showLinkTrans();
@ -327,7 +398,7 @@ export default {
_post("/user/custom_invite", JSON.stringify(ajaxBody), "include").then(
r => {
if (r.ret) {
console.log(r);
window.console.log(r);
this.reConfigResourse();
this.showLinkTrans();
this.code = this.oldCode = this.toolInputContent;
@ -349,15 +420,39 @@ export default {
}
}
);
},
checkInviteLog() {
this.showInviteLog = true;
this.hideToolInput();
},
closeInviteLog() {
this.showInviteLog = false;
},
turnInviteLogPage(current) {
let body = { current: current };
_post("/getuserinviteinfo", JSON.stringify(body), "include").then(r => {
this.paybacks = r.inviteInfo.paybacks;
this.pagenation.currentPage = r.inviteInfo.paybacks.current_page;
});
}
},
mounted() {
_get("getuserinviteinfo", "include").then(r => {
console.log(r);
let body = { current: 1 };
_post("/getuserinviteinfo", JSON.stringify(body), "include").then(r => {
window.console.log(r);
this.code = this.oldCode = r.inviteInfo.code.code;
this.invitePrice = r.inviteInfo.invitePrice;
this.customPrice = r.inviteInfo.customPrice;
console.log(this.userCon);
this.paybacks = r.inviteInfo.paybacks;
this.paybacks_sum = r.inviteInfo.paybacks_sum;
this.invite_get_money = r.inviteInfo.invite_get_money;
this.invite_gift = r.inviteInfo.invite_gift;
this.code_payback = r.inviteInfo.code_payback;
this.pagenation = {
lastPage: r.inviteInfo.paybacks.last_page,
currentPage: 1
};
window.console.log(this.userCon);
});
},
beforeDestroy() {
@ -366,3 +461,57 @@ export default {
};
</script>
<style>
.uim-pagenation-container {
margin-top: 0.75rem;
}
.invite-tools {
position: relative;
margin: 1rem 0.75rem 0 0;
}
.invite-number.tips {
margin-right: 0.75rem;
font-size: 14px;
}
.invite-number.tips:last-of-type {
margin-right: 0;
}
.invite-tools .tips.tips-red {
position: relative;
top: 1px;
}
.invite-tools.tips-green {
padding: 3.5px 0.7rem;
bottom: 1px;
margin-left: 0.55rem;
}
.user-invite-subtitle {
padding-left: 1rem;
margin-bottom: 1rem;
}
.toolinput-state .tips {
margin-right: 0.75rem;
}
.user-invite-title .tips {
position: relative;
}
@media screen and (min-width: 35.5em) {
.invite-tools {
margin: 0 0 0 0.75rem;
}
.user-invite-subtitle > div {
display: inline-block;
}
.user-invite-subtitle {
padding-left: 0;
margin-bottom: 0;
}
.toolinput-state .tips {
margin-right: 0;
margin-left: 0.75rem;
}
.user-invite-title .btn-forinput {
top: 0.05rem;
}
}
</style>

@ -34,13 +34,13 @@
></div>
<span
class="user-config"
:class="{ 'font-green-trans':isDataRefreshed }"
:class="{ 'font-green-trans':isDataRefreshed,'font-gold-trans':sign.isTrsfficRefreshed }"
slot="progress-text"
>{{userCon.lastUsedTraffic + '/' + userCon.todayUsedTraffic}}</span>
<span
slot="progress-sign"
class="user-config"
:class="{ 'font-green-trans':isDataRefreshed }"
:class="{ 'font-green-trans':isDataRefreshed,'font-gold-trans':sign.isTrsfficRefreshed }"
>{{transferObj.usedtoday.toFixed(1) + '%'}}</span>
</uim-progressbar>
<uim-progressbar>
@ -51,13 +51,13 @@
:style="{ width:transferObj.remain + '%' }"
></div>
<span
:class="{ 'font-green-trans':isDataRefreshed }"
:class="{ 'font-green-trans':isDataRefreshed,'font-gold-trans':sign.isTrsfficRefreshed }"
slot="progress-text"
>{{userCon.unUsedTraffic}}</span>
<span
slot="progress-sign"
class="user-config"
:class="{ 'font-green-trans':isDataRefreshed }"
:class="{ 'font-green-trans':isDataRefreshed,'font-gold-trans':sign.isTrsfficRefreshed }"
>{{transferObj.remain.toFixed(1) + '%'}}</span>
</uim-progressbar>
</div>
@ -78,67 +78,67 @@ import { _get } from '../../js/fetch'
export default {
mixins: [userMixin, storeMap, userSetMixin],
components: {
'uim-progressbar': Progressbar,
'uim-progressbar': Progressbar
},
computed: {
calcResourse: function() {
let resourse = this.userSettings.resourse;
calcResourse: function () {
let resourse = this.userSettings.resourse
for (let i = 0; i < resourse.length; i++) {
switch (resourse[i].name) {
case "在线设备数":
case '在线设备数':
if (this.userCon.node_connector !== 0) {
this.setReasourse({
index: i,
content:
this.userCon.online_ip_count +
" / " +
' / ' +
this.userCon.node_connector
});
})
} else {
this.setReasourse({
index: i,
content: this.userCon.online_ip_count + " / 无限制"
});
content: this.userCon.online_ip_count + ' / 无限制'
})
}
break;
case "端口速率":
break
case '端口速率':
if (this.userCon.node_speedlimit !== 0) {
this.setReasourse({
index: i,
content: this.userCon.node_speedlimit + " Mbps"
});
content: this.userCon.node_speedlimit + ' Mbps'
})
} else {
this.setReasourse({ index: i, content: "无限制" });
this.setReasourse({ index: i, content: '无限制' })
}
break;
break
default:
break;
break
}
}
return resourse;
return resourse
},
transferObj: function() {
let enable = this.userCon.transfer_enable;
let upload = this.userCon.u;
let download = this.userCon.d;
let lastdayTransfer = this.userCon.last_day_t;
transferObj: function () {
let enable = this.userCon.transfer_enable
let upload = this.userCon.u
let download = this.userCon.d
let lastdayTransfer = this.userCon.last_day_t
let obj = {
remain:
enable === 0 ? 0 : ((enable - upload - download) / enable) * 100,
usedtoday: enable === 0 ? 0 : ((upload + download) / enable) * 100,
usedtotal: enable === 0 ? 0 : (lastdayTransfer / enable) * 100
};
return obj;
}
return obj
}
},
data: function() {
data: function () {
return {
isDataRefreshed: false
};
}
},
methods: {
DateParse(str_date) {
let str_date_splited = str_date.split(/[^0-9]/);
DateParse (str_date) {
let str_date_splited = str_date.split(/[^0-9]/)
return new Date(
str_date_splited[0],
str_date_splited[1] - 1,
@ -146,60 +146,60 @@ export default {
str_date_splited[3],
str_date_splited[4],
str_date_splited[5]
);
)
},
calcExpireDays(classExpire, userExpireIn) {
let levelExpire = this.DateParse(classExpire);
let accountExpire = this.DateParse(userExpireIn);
let nowDate = new Date();
let a = nowDate.getTime();
let b = levelExpire - a;
let c = accountExpire - a;
let levelExpireDays = Math.floor(b / (24 * 3600 * 1000));
let accountExpireDays = Math.floor(c / (24 * 3600 * 1000));
calcExpireDays (classExpire, userExpireIn) {
let levelExpire = this.DateParse(classExpire)
let accountExpire = this.DateParse(userExpireIn)
let nowDate = new Date()
let a = nowDate.getTime()
let b = levelExpire - a
let c = accountExpire - a
let levelExpireDays = Math.floor(b / (24 * 3600 * 1000))
let accountExpireDays = Math.floor(c / (24 * 3600 * 1000))
if (levelExpireDays < 0 || levelExpireDays > 315360000000) {
this.addNewUserCon({ levelExpireDays: "无限期" });
this.setReasourse({ index: 0, content: this.userCon.levelExpireDays });
this.addNewUserCon({ levelExpireDays: '无限期' })
this.setReasourse({ index: 0, content: this.userCon.levelExpireDays })
} else {
this.addNewUserCon({ levelExpireDays: levelExpireDays });
this.addNewUserCon({ levelExpireDays: levelExpireDays })
this.setReasourse({
index: 0,
content: this.userCon.levelExpireDays + " 天"
});
content: this.userCon.levelExpireDays + ' 天'
})
}
if (accountExpireDays < 0 || accountExpireDays > 315360000000) {
this.addNewUserCon({ accountExpireDays: "无限期" });
this.addNewUserCon({ accountExpireDays: '无限期' })
this.setReasourse({
index: 1,
content: this.userCon.accountExpireDays
});
})
} else {
this.addNewUserCon({ accountExpireDays: accountExpireDays });
this.addNewUserCon({ accountExpireDays: accountExpireDays })
this.setReasourse({
index: 1,
content: this.userCon.accountExpireDays + " 天"
});
content: this.userCon.accountExpireDays + ' 天'
})
}
},
dataRefresh() {
_get("/gettransfer", "include").then(r => {
this.addNewUserCon(r.arr);
this.reConfigResourse();
this.showTransition("isDataRefreshed");
});
dataRefresh () {
_get('/gettransfer', 'include').then(r => {
this.addNewUserCon(r.arr)
this.reConfigResourse()
this.showTransition('isDataRefreshed')
})
},
showTransition(key) {
this[key] = true;
showTransition (key) {
this[key] = true
setTimeout(() => {
this[key] = false;
}, 500);
this[key] = false
}, 500)
}
},
created() {
this.calcExpireDays(this.userCon.class_expire, this.userCon.expire_in);
_get("/gettransfer", "include").then(r => {
this.addNewUserCon(r.arr);
});
created () {
this.calcExpireDays(this.userCon.class_expire, this.userCon.expire_in)
_get('/gettransfer', 'include').then(r => {
this.addNewUserCon(r.arr)
})
}
};
}
</script>

@ -19,5 +19,5 @@ import userSetMixin from '@/mixins/userSetMixin'
export default {
mixins: [userMixin, storeMap, userSetMixin]
};
}
</script>

@ -1,7 +1,7 @@
<template>
<div>
<div class="pure-g">
<div class="pure-u-20-24 flex align-center">
<div class="pure-u-1 wrap flex align-center">
<div class="card-title">套餐购买</div>
<transition name="fade" mode="out-in">
<label v-if="isCheckerShow" class="relative" for>
@ -25,18 +25,19 @@
<div class="card-body">
<div class="user-shop">
<div v-for="shop in shops" class="list-shop pure-g" :key="shop.id">
<div class="pure-u-20-24">
<span>{{shop.name}}</span>
<div class="pure-u-1 pure-u-sm-20-24">
<span class="user-shop-name">{{shop.name}}</span>
<span class="tips tips-gold">VIP {{shop.details.class}}</span>
<span class="tips tips-green">¥{{shop.price}}</span>
<span class="tips tips-cyan">{{shop.details.bandwidth}}G
<span class="tips tips-cyan">
{{shop.details.bandwidth}}G
<span
v-if="shop.details.reset"
>+{{shop.details.reset_value}}G/({{shop.details.reset}}天/{{shop.details.reset_exp}}天)</span>
</span>
<span class="tips tips-blue">{{shop.details.class_expire}}天</span>
<span v-if="shop.details.class_expire !== '0'" class="tips tips-blue">{{shop.details.class_expire}}天</span>
</div>
<div class="pure-u-4-24 text-right">
<div class="pure-u-1 pure-u-sm-4-24 list-shop-footer">
<button :disabled="isDisabled" class="buy-submit" @click="buy(shop)">购买</button>
</div>
</div>
@ -53,13 +54,16 @@
>
<h3 slot="uim-modal-title">{{modalCon.title}}</h3>
<div class="flex align-center justify-center wrap" slot="uim-modal-body">
<div class="order-checker-content">商品名称:
<div class="order-checker-content">
商品名称:
<span>{{orderCheckerContent.name}}</span>
</div>
<div class="order-checker-content">优惠额度:
<div class="order-checker-content">
优惠额度:
<span>{{orderCheckerContent.credit}}</span>
</div>
<div class="order-checker-content">总金额:
<div class="order-checker-content">
总金额:
<span>{{orderCheckerContent.total}}</span>
</div>
</div>
@ -73,20 +77,19 @@
</template>
<script>
import storeMap from '@/mixins/storeMap'
import userMixin from '@/mixins/userMixin'
import storeMap from "@/mixins/storeMap";
import userMixin from "@/mixins/userMixin";
import Shopmodal from '@/components/shopmodal.vue'
import Switch from '@/components/switch.vue'
import Shopmodal from "@/components/modal.vue";
import Switch from "@/components/switch.vue";
import { _get } from '../../js/fetch'
import { _post } from '../../js/fetch'
import { _get, _post } from "../../js/fetch";
export default {
mixins: [userMixin, storeMap],
components: {
'uim-modal': Shopmodal,
'uim-switch': Switch,
"uim-modal": Shopmodal,
"uim-switch": Switch
},
data: function() {
return {
@ -170,7 +173,7 @@ export default {
_post("/user/buy", JSON.stringify(ajaxCon), "include").then(r => {
let self = this;
if (r.ret) {
console.log(r);
window.console.log(r);
this.callOrderChecker();
this.reConfigResourse();
this.$emit("resourseTransTrigger");
@ -179,7 +182,7 @@ export default {
icon: "fa-check-square-o",
time: 1500
};
let animation = new Promise(function(resolve) {
let animation = new Promise(function (resolve) {
self.callOrderChecker();
setTimeout(() => {
resolve("done");
@ -189,8 +192,8 @@ export default {
this.callMsgr(callConfig);
});
} else {
console.log(r);
let animation = new Promise(function(resolve) {
window.console.log(r);
let animation = new Promise(function (resolve) {
self.callOrderChecker();
setTimeout(() => {
resolve("done");
@ -215,20 +218,55 @@ export default {
}
});
},
hideChecker() {
hideChecker () {
this.isCheckerShow = false;
this.isDisabled = false;
}
},
mounted() {
mounted () {
_get("/getusershops", "include").then(r => {
this.shops = r.arr.shops;
this.shops.forEach((el, index) => {
this.$set(this.shops[index], "details", JSON.parse(el.content));
});
console.log(this.shops);
window.console.log(this.shops);
});
}
};
</script>
<style>
.user-shop-name {
display: block;
text-align: center;
}
.list-shop .tips {
margin-top: 0.5rem;
}
.list-shop-footer {
margin-top: 1rem;
padding-top: 0.5rem;
border-top: 1px solid #434857;
text-align: right;
}
.list-shop:hover {
transform: translate3D(0.5rem, 0, 0);
}
@media screen and (min-width: 35.5em) {
.user-shop-name {
display: inline-block;
text-align: left;
}
.list-shop .tips {
margin-top: 0;
}
.list-shop-footer {
margin-top: 0;
padding-top: 0;
border-top: none;
}
.list-shop:hover {
transform: translate3D(1rem, 0, 0);
}
}
</style>

@ -17,7 +17,7 @@
</template>
<script>
export default {};
export default {}
</script>
<style>

@ -0,0 +1,264 @@
<template>
<div
:class="{ 'uim-signer-ready':sign.isSignShow,'uim-signer-transition':sign.transition }"
class="uim-signer"
>
<div class="uim-signer-container" :style="{ top:containerTop(),transform:containerTransform }">
<div
@click.stop
:class="{ 'uim-signer-main-shadow':showSigner }"
class="uim-signer-main"
ref="signerMain"
>
<button
@click="checkin"
:class="{ 'uim-signer-btn-success':!userCon.isAbleToCheckin }"
class="uim-signer-btn"
>
<transition name="signer" mode="out-in">
<div v-if="userCon.isAbleToCheckin" key="notChekined">
<p>点击,或摇一摇手机</p>
<p>签到</p>
</div>
<div v-else key="chekined">
<p>
<span class="fa fa-check fa-4x"></span>
</p>
<p>今日已签到</p>
</div>
</transition>
</button>
<div class="flex wrap">
<div v-if="globalConfig.captchaProvider === 'geetest'" id="embed-captcha-user"></div>
<form action="?" method="POST">
<div
v-if="globalConfig.recaptchaSiteKey"
id="g-recaptcha-user"
class="g-recaptcha"
data-theme="dark"
:data-sitekey="globalConfig.recaptchaSiteKey"
></div>
</form>
</div>
</div>
<div :style="{ top:drawerTop() }" class="uim-signer-drawer">
<button :class="{ 'uim-signer-drawer-active':showSigner }" @click.stop="signerTrigger">
<span :class="{ 'uim-signer-rotate':showSigner }" class="fa fa-chevron-down"></span> 签到
</button>
</div>
</div>
</div>
</template>
<script>
import storeMap from '@/mixins/storeMap'
import storeAuth from '@/mixins/storeAuth'
import { _post } from '../js/fetch'
export default {
mixins: [storeMap, storeAuth],
computed: {
containerTransform: function () {
return this.showSigner
? 'translateY(' + this.drawerTop() + ')'
: 'translateY(0px)'
}
},
data: function () {
return {
showSigner: false,
shakeEvent: ''
}
},
methods: {
containerTop () {
if (this.$refs.signerMain) {
return -this.$refs.signerMain.clientHeight + 'px'
} else {
return '-250px'
}
},
drawerTop () {
if (this.$refs.signerMain) {
return this.$refs.signerMain.clientHeight + 'px'
} else {
return '250px'
}
},
signerTrigger () {
if (this.showSigner === false) {
this.showSigner = true
} else {
this.showSigner = false
}
},
hideSigner () {
this.showSigner = false
},
checkin () {
let body = {}
let callConfig = {
msg: '',
icon: '',
time: 0
}
if (this.globalConfig.enableCheckinCaptcha !== 'false') {
switch (this.globalConfig.captchaProvider) {
case 'recaptcha':
body.recaptcha = window.grecaptcha.getResponse()
break
case 'geetest':
if (this.validate !== '') {
body.geetest_challenge = this.validate.geetest_challenge
body.geetest_validate = this.validate.geetest_validate
body.geetest_seccode = this.validate.geetest_seccode
} else {
callConfig.msg += '请滑动验证码来完成验证。'
}
break
}
}
_post('/user/checkin', JSON.stringify(body), 'include').then(r => {
if (r.ret) {
window.console.log(r)
callConfig.msg += r.msg
callConfig.icon = 'fa-check-square-o'
callConfig.time = 4000
this.setAllResourse({ isAbleToCheckin: false })
setTimeout(() => {
this.signerTrigger()
this.callMsgr(callConfig)
this.addNewUserCon(r.trafficInfo)
this.TraffictransTrigger()
}, 1000)
} else {
window.console.log(r)
callConfig.msg += r.msg
callConfig.icon = 'fa-times-circle-o'
callConfig.time = 1500
this.callMsgr(callConfig)
this.signerTrigger()
}
})
},
shakeEventDidOccur () {
if ('vibrate' in navigator) {
navigator.vibrate(500)
}
this.checkin()
}
},
mounted () {
window.addEventListener('shake', this.shakeEventDidOccur, false)
let app = document.getElementById('app')
app.addEventListener('click', this.hideSigner, false)
if (this.globalConfig.enableCheckinCaptcha === 'false') {
return
}
this.loadCaptcha('g-recaptcha-user')
this.loadGT('#embed-captcha-user')
},
beforeDestroy () {
window.removeEventListener('shake', this.shakeEventDidOccur, false)
let app = document.getElementById('app')
app.removeEventListener('click', this.hideSigner, false)
}
}
</script>
<style>
.uim-signer {
position: fixed;
top: 0;
left: 0;
right: 0;
margin-right: auto;
margin-left: auto;
width: 300px;
text-align: center;
z-index: -1;
opacity: 0;
}
.uim-signer.uim-signer-ready {
z-index: 5;
opacity: 1;
}
.uim-signer-transition {
transition: all 0.4s;
}
.uim-signer-main,
.uim-signer-container,
.uim-signer-main button,
.uim-signer-drawer span {
transition: all 0.4s;
}
.uim-signer-container {
position: relative;
top: -250px;
}
.uim-signer-main {
background: white;
padding: 1rem;
border-radius: 0 0 10px 10px;
box-shadow: none;
position: absolute;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.uim-signer-btn {
color: #d1335b;
background: transparent;
border-radius: 50%;
border: 8px solid #d1335b;
height: 200px;
width: 200px;
padding: 0.5rem 1rem;
outline: none;
}
.uim-signer-btn-success {
color: #52c41a;
border-color: #52c41a;
cursor: default;
}
.uim-signer-drawer {
position: absolute;
top: 250px;
left: 0;
right: 0;
}
.uim-signer-drawer button {
outline: none;
font-size: 13px;
border: 1px solid;
border-top: 0;
padding: 0.3rem 1rem;
border-radius: 0 0 6px 6px;
background: transparent;
color: white;
}
.uim-signer-drawer button:hover,
.uim-signer-drawer button.uim-signer-drawer-active {
background: white;
color: black;
}
.uim-signer-rotate {
transform: rotateZ(180deg);
}
.uim-signer-main.uim-signer-main-shadow {
box-shadow: 0 0 5px 1px gray;
}
#embed-captcha-user .geetest_holder.geetest_wind {
width: 100% !important;
margin-top: 1.5rem;
}
</style>

@ -15,25 +15,25 @@
<script>
export default {
model: {
prop: "isBtnActive",
event: "change"
prop: 'isBtnActive',
event: 'change'
},
props: ["isBtnActive"],
data: function() {
props: ['isBtnActive'],
data: function () {
return {
switchStatus: this.isBtnActive
};
}
},
methods: {
btnSwitch() {
btnSwitch () {
if (this.switchStatus === false) {
this.switchStatus = true;
this.switchStatus = true
} else {
this.switchStatus = false;
this.switchStatus = false
}
}
}
};
}
</script>
<style>
@ -85,4 +85,3 @@ export default {
margin-left: .25rem;
}
</style>

@ -0,0 +1,37 @@
<template>
<table class="uim-table">
<tr class="uim-tr-head">
<slot name="uim-th"></slot>
</tr>
<transition-group name="list-fade" class="relative" tag="tbody">
<slot name="uim-tr"></slot>
</transition-group>
</table>
</template>
<script>
export default {}
</script>
<style>
.uim-table {
width: 100%;
table-layout: fixed;
text-align: center;
position: relative;
}
.uim-table tr {
border: 1px solid #434857;
border-left: 0;
border-right: 0;
}
.uim-table th {
padding: 0.7rem 0;
font-size: 15px;
}
.uim-table td {
padding: 0.3rem 0;
color: #cfd2da;
font-size: 14px;
}
</style>

@ -1,7 +1,9 @@
<template>
<transition name="fade" mode="out-in">
<div class="uim-tooltip">
<slot name="tooltip-inner"></slot>
<div class="tooltip-inner">
<slot name="tooltip-inner"></slot>
</div>
</div>
</transition>
</template>
@ -36,5 +38,10 @@ export default {};
transform: rotateZ(45deg);
z-index: -1;
}
</style>
.tooltip-inner {
font-size: 14px;
padding: .3rem 1rem;
word-break: break-all;
}
</style>

@ -29,6 +29,10 @@ a {
justify-content: space-around;
}
.flex-end {
justify-content: flex-end;
}
.space-between {
justify-content: space-between;
}
@ -194,7 +198,7 @@ a {
a.btn-user,
button.btn-user {
font-size: 1rem;
padding: .5rem 1.5rem;
padding: .5rem .5rem;
display: inline-block;
border: 1px solid #434857;
min-width: 80px;
@ -291,8 +295,7 @@ input.checkbox,
}
.auth-submit:hover,
.auth-submit:focus,
{
.auth-submit:focus {
background-color: #d6d6d6;
border-color: #d6d6d6;
}
@ -568,6 +571,11 @@ select {
outline: none;
}
.tips-sm {
font-size: 12px;
padding: .1rem .5rem;
}
.tips-blue {
color: #1997c6;
border-color: #1997c6;
@ -654,16 +662,10 @@ button.tips {
overflow: auto;
}
.guide-area>p:first-of-type{
margin-top: 0;
}
.guide-area p{
margin-bottom: 0;
}
.guide-area>p:last-of-type {
margin-bottom: 1rem;
.user-guide input {
background: transparent;
height: unset;
display: block;
}
.ann a {
@ -716,26 +718,6 @@ button.tips {
color: white;
}
.invite-number {
font-size: 14px;
}
.invite-tools {
position: relative;
margin-left: .75rem;
}
.invite-tools .tips.tips-red {
position: relative;
top: 1px;
}
.invite-tools.tips-green {
padding: 3.5px .7rem;
bottom: 1px;
margin-left: .55rem;
}
.invite-link {
width: 100%;
cursor: pointer;
@ -749,8 +731,8 @@ button.tips {
border: 0;
}
.user-invite-title .tips {
position: relative;
.user-invite-title .btn-user {
margin-right: 1rem;
}
.list-shop {
@ -758,16 +740,12 @@ button.tips {
font-size: 1.2rem;
border: 1px solid #434857;
margin-bottom: .7rem;
width: 95%;
width: 100%;
backface-visibility: hidden;
-moz-backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
.list-shop:hover {
transform: translate3D(1rem, 0, 0);
}
.list-shop div:first-of-type .tips {
margin-left: .3rem;
}
@ -849,11 +827,6 @@ button[name=reset] {
margin-right: .3rem;
}
.guide-area {
padding-right: 1rem;
width: 100%;
}
@media screen and (min-width:35.5em) {
.user {
padding: 0;
@ -928,44 +901,36 @@ button[name=reset] {
overflow: auto;
}
.user-guide {
height: 385px;
a.btn-user,
button.btn-user {
padding: .5rem 1.5rem;
}
.user-guide .tips {
margin-right: .5rem;
.user-invite {
max-height: 385px;
}
.userguide-bookmark>div {
width: 100%;
.user-guide {
height: 385px;
}
.userguide-bookmark button {
background-color: #c8c8c81f;
border: none;
padding: .6rem 0;
outline: none;
display: block;
margin-top: 1rem;
font-size: 12px;
text-align: left;
padding-left: 1rem;
width: 100%;
border-radius: 20px;
.user-guide .tips {
margin-right: .5rem;
}
.link-reset .uim-tooltip-top {
width: 230px;
}
.list-shop {
width: 95%;
}
.invite-link {
width: 450px;
}
.user-invite-title .tips {
margin-bottom: .5rem;
margin-left: .75rem;
}
.margin-nobottom-sm {
margin-bottom: 0 !important;
@ -981,6 +946,15 @@ button[name=reset] {
.user-btngroup .btngroup-right>*:last-child {
margin-right: 0;
}
.userinvite-table-container {
overflow: auto;
max-height: 355px;
}
.btn-forinput {
top: 0.25rem;
}
}
@media screen and (min-width:48em) {

@ -1,22 +1,22 @@
export default {
inserted: function (el, binding) {
el.addEventListener('click', (e) => {
let copy = new Promise((resolve, reject) => {
let input = document.createElement('input');
let body = document.getElementsByTagName('body')[0];
let value = el.dataset.uimclip;
input.setAttribute('type', 'text');
input.setAttribute('value', value);
body.appendChild(input);
input.focus();
input.setSelectionRange(0, value.length);
document.execCommand('copy', true);
resolve(input);
})
copy.then((r) => {
r.remove();
binding.value.onSuccess();
})
})
},
}
inserted: function (el, binding) {
el.addEventListener('click', (e) => {
let copy = new Promise((resolve, reject) => {
let input = document.createElement('input')
let body = document.getElementsByTagName('body')[0]
let value = el.dataset.uimclip
input.setAttribute('type', 'text')
input.setAttribute('value', value)
body.appendChild(input)
input.focus()
input.setSelectionRange(0, value.length)
document.execCommand('copy', true)
resolve(input)
})
copy.then((r) => {
r.remove()
binding.value.onSuccess()
})
})
}
}

@ -10,27 +10,25 @@
* @param {string} method
* @returns {function} - A Promise Object
*/
export const _request = (url, body, method,credentials) =>
fetch(url, {
method: method,
body: body,
headers: {
'content-type': 'application/json'
},
credentials: credentials,
}).then(resp => {
return Promise.all([resp.ok, resp.status, resp.json()]);
}).then(([ok, status, json]) => {
if (ok) {
return json;
} else {
throw new Error(JSON.stringify(json.error));
}
}).catch(error => {
throw error;
});
export const _request = (url, body, method, credentials) =>
fetch(url, {
method: method,
body: body,
headers: {
'content-type': 'application/json'
},
credentials: credentials
}).then(resp => {
return Promise.all([resp.ok, resp.status, resp.json()])
}).then(([ok, status, json]) => {
if (ok) {
return json
} else {
throw new Error(JSON.stringify(json.error))
}
}).catch(error => {
throw error
})
/**
* A Wrapper of Fetch GET Method
@ -40,25 +38,23 @@ export const _request = (url, body, method,credentials) =>
* @example
* get('https://example.com').then(resp => { console.log(resp) })
*/
export const _get = (url,credentials) =>
fetch(url, {
method: 'GET',
credentials,
}).then(resp => {
return Promise.all([resp.ok, resp.status, resp.json(), resp.headers])
})
.then(([ok, status, json, headers]) => {
if (ok) {
return json;
} else {
throw new Error(JSON.stringify(json.error));
}
}).catch(error => {
console.log(error);
throw error;
});
export const _get = (url, credentials) =>
fetch(url, {
method: 'GET',
credentials
}).then(resp => {
return Promise.all([resp.ok, resp.status, resp.json(), resp.headers])
})
.then(([ok, status, json, headers]) => {
if (ok) {
return json
} else {
throw new Error(JSON.stringify(json.error))
}
}).catch(error => {
throw error
})
/**
* A Wrapper of Fetch POST Method
* @function _post
@ -69,4 +65,4 @@ export const _get = (url,credentials) =>
* _post('https://example.com', JSON.stringify(data)).then(resp => { console.log(resp) })
*/
export const _post = (url, body, credentials) => _request(url, body, 'POST', credentials);
export const _post = (url, body, credentials) => _request(url, body, 'POST', credentials)

@ -3,16 +3,16 @@ import App from './App.vue'
import './css/index_base.css'
import './css/index.css'
Vue.config.productionTip = false;
import Uimclip from './directives/uimclip'
let validate,captcha;
window.validate = validate;
window.captha = captcha;
Vue.config.productionTip = false
let validate, captcha
window.validate = validate
window.captha = captcha
Vue.directive('uimclip',Uimclip)
Vue.directive('uimclip', Uimclip)
new Vue({
render: h => h(App)
}).$mount('#app')
}).$mount('#app')

@ -1,168 +1,168 @@
export default {
computed: {
suburlBase: function () {
return this.subUrl + this.ssrSubToken;
},
suburlMu0: function () {
return this.suburlBase + "?mu=0";
},
suburlMu1: function () {
return this.suburlBase + "?mu=1";
},
suburlMu3: function () {
return this.suburlBase + "?mu=3";
},
suburlMu2: function () {
return this.suburlBase + "?mu=2";
}
computed: {
suburlBase: function () {
return this.subUrl + this.ssrSubToken
},
data: function () {
return {
downloads: [{
type: "SSR",
agent: {
Windows: [{
agentName: "SSR",
href: "/ssr-download/ssr-win.7z",
id: "AGENT_1_1_1"
},
{
agentName: "SSTAP",
href: "/ssr-download/SSTap.7z",
id: "AGENT_1_1_2"
}
],
Macos: [{
agentName: "SSX",
href: "/ssr-download/ssr-mac.dmg",
id: "AGENT_1_2_1"
}],
Linux: [{
agentName: "SS-qt5",
href: "#",
id: "AGENT_1_3_1"
}],
Ios: [{
agentName: "Potatso Lite",
href: "#",
id: "AGENT_1_4_1"
},
{
agentName: "Shadowrocket",
href: "#",
id: "AGENT_1_4_2"
}
],
Android: [{
agentName: "SSR",
href: "/ssr-download/ssr-android.apk",
id: "AGENT_1_5_1"
},
{
agentName: "SSRR",
href: "/ssr-download/ssrr-android.apk",
id: "AGENT_1_5_2"
}
],
Router: [{
agentName: "FancySS",
href: "https://github.com/hq450/fancyss_history_package",
id: "AGENT_1_6_1"
}]
}
},
{
type: "SS/SSD",
agent: {
Windows: [{
agentName: "SSD",
href: "/ssr-download/ssd-win.7z",
id: "AGENT_2_1_1"
}],
Macos: [{
agentName: "SSXG",
href: "/ssr-download/ss-mac.zip",
id: "AGENT_2_2_1"
}],
Linux: [{
agentName: "/",
href: "#",
id: "AGENT_2_3_1"
}],
Ios: [{
agentName: "Potatso Lite",
href: "#",
id: "AGENT_2_4_1"
},
{
agentName: "Shadowrocket",
href: "#",
id: "AGENT_2_4_2"
}
],
Android: [{
agentName: "SSD",
href: "/ssr-download/ssd-android.apk",
id: "AGENT_2_5_1"
},
{
agentName: "混淆插件",
href: "/ssr-download/ss-android-obfs.apk",
id: "AGENT_2_5_2"
}
],
Router: [{
agentName: "FancySS",
href: "https://github.com/hq450/fancyss_history_package",
id: "AGENT_2_6_1"
}]
}
},
{
type: "V2RAY",
agent: {
Windows: [{
agentName: "V2RayN",
href: "/ssr-download/v2rayn.zip",
id: "AGENT_3_1_1"
}, {
agentName: "ClashX",
href: "/ssr-download/Clash-Windows.7z",
id: "AGENT_3_1_2"
}],
Macos: [{
agentName: "/",
href: "#",
id: "AGENT_3_2_1"
}],
Linux: [{
agentName: "/",
href: "#",
id: "AGENT_3_3_1"
}],
Ios: [{
agentName: "Shadowrocket",
href: "#",
id: "AGENT_3_4_1"
}],
Android: [{
agentName: "V2RayN",
href: "/ssr-download/v2rayng.apk",
id: "AGENT_3_5_1"
}],
Router: [{
agentName: "FancySS",
href: "https://github.com/hq450/fancyss_history_package",
id: "AGENT_3_6_1"
}]
}
}
],
}
suburlMu0: function () {
return this.suburlBase + '?mu=0'
},
suburlMu1: function () {
return this.suburlBase + '?mu=1'
},
methods: {
changeAgentType(e) {
this.setCurrentDlType(e.target.dataset.type);
},
suburlMu3: function () {
return this.suburlBase + '?mu=3'
},
}
suburlMu2: function () {
return this.suburlBase + '?mu=2'
}
},
data: function () {
return {
downloads: [{
type: 'SSR',
agent: {
Windows: [{
agentName: 'SSR',
href: '/ssr-download/ssr-win.7z',
id: 'AGENT_1_1_1'
},
{
agentName: 'SSTAP',
href: '/ssr-download/SSTap.7z',
id: 'AGENT_1_1_2'
}
],
Macos: [{
agentName: 'SSX',
href: '/ssr-download/ssr-mac.dmg',
id: 'AGENT_1_2_1'
}],
Linux: [{
agentName: 'SS-qt5',
href: '#',
id: 'AGENT_1_3_1'
}],
Ios: [{
agentName: 'Potatso Lite',
href: '#',
id: 'AGENT_1_4_1'
},
{
agentName: 'Shadowrocket',
href: '#',
id: 'AGENT_1_4_2'
}
],
Android: [{
agentName: 'SSR',
href: '/ssr-download/ssr-android.apk',
id: 'AGENT_1_5_1'
},
{
agentName: 'SSRR',
href: '/ssr-download/ssrr-android.apk',
id: 'AGENT_1_5_2'
}
],
Router: [{
agentName: 'FancySS',
href: 'https://github.com/hq450/fancyss_history_package',
id: 'AGENT_1_6_1'
}]
}
},
{
type: 'SS/SSD',
agent: {
Windows: [{
agentName: 'SSD',
href: '/ssr-download/ssd-win.7z',
id: 'AGENT_2_1_1'
}],
Macos: [{
agentName: 'SSXG',
href: '/ssr-download/ss-mac.zip',
id: 'AGENT_2_2_1'
}],
Linux: [{
agentName: '/',
href: '#',
id: 'AGENT_2_3_1'
}],
Ios: [{
agentName: 'Potatso Lite',
href: '#',
id: 'AGENT_2_4_1'
},
{
agentName: 'Shadowrocket',
href: '#',
id: 'AGENT_2_4_2'
}
],
Android: [{
agentName: 'SSD',
href: '/ssr-download/ssd-android.apk',
id: 'AGENT_2_5_1'
},
{
agentName: '混淆插件',
href: '/ssr-download/ss-android-obfs.apk',
id: 'AGENT_2_5_2'
}
],
Router: [{
agentName: 'FancySS',
href: 'https://github.com/hq450/fancyss_history_package',
id: 'AGENT_2_6_1'
}]
}
},
{
type: 'V2RAY',
agent: {
Windows: [{
agentName: 'V2RayN',
href: '/ssr-download/v2rayn.zip',
id: 'AGENT_3_1_1'
}, {
agentName: 'ClashX',
href: '/ssr-download/Clash-Windows.7z',
id: 'AGENT_3_1_2'
}],
Macos: [{
agentName: '/',
href: '#',
id: 'AGENT_3_2_1'
}],
Linux: [{
agentName: '/',
href: '#',
id: 'AGENT_3_3_1'
}],
Ios: [{
agentName: 'Shadowrocket',
href: '#',
id: 'AGENT_3_4_1'
}],
Android: [{
agentName: 'V2RayN',
href: '/ssr-download/v2rayng.apk',
id: 'AGENT_3_5_1'
}],
Router: [{
agentName: 'FancySS',
href: 'https://github.com/hq450/fancyss_history_package',
id: 'AGENT_3_6_1'
}]
}
}
]
}
},
methods: {
changeAgentType (e) {
this.setCurrentDlType(e.target.dataset.type)
}
}
}

@ -1,64 +1,59 @@
import { _get } from '../js/fetch'
export default {
data: function() {
return {
validate: '',
captcha: '',
}
data: function () {
return {
validate: '',
captcha: ''
}
},
methods: {
loadCaptcha (id) {
if (this.globalConfig.recaptchaSiteKey !== null) {
this.$nextTick(function () {
this.grecaptchaRender(id)
})
}
},
methods: {
loadCaptcha(id) {
if (this.globalConfig.recaptchaSiteKey !== null) {
this.$nextTick(function () {
this.grecaptchaRender(id);
loadGT (id) {
if (this.globalConfig.captchaProvider === 'geetest') {
this.$nextTick(function () {
_get('/getCaptcha', 'include')
.then((r) => {
let GeConfig = {
gt: r.GtSdk.gt,
challenge: r.GtSdk.challenge,
product: 'embed'
}
if (parseInt(this.globalConfig.isGetestSuccess)) {
GeConfig.offline = 0
} else {
GeConfig.offline = 1
}
let self = this
window.initGeetest(GeConfig, function (captchaObj) {
captchaObj.appendTo(id)
captchaObj.onSuccess(function () {
self.validate = captchaObj.getValidate()
})
}
},
loadGT(id) {
if (this.globalConfig.captchaProvider === 'geetest') {
this.$nextTick(function () {
_get('/auth/login_getCaptcha', 'include')
.then((r) => {
let GeConfig = {
gt: r.GtSdk.gt,
challenge: r.GtSdk.challenge,
product: "embed",
}
if (parseInt(this.globalConfig.isGetestSuccess)) {
GeConfig.offline = 0;
} else {
GeConfig.offline = 1;
}
let self = this;
initGeetest(GeConfig, function (captchaObj) {
captchaObj.appendTo(id);
captchaObj.onSuccess(function () {
self.validate = captchaObj.getValidate();
});
self.captcha = captchaObj;
});
});
});
}
},
//加载完成的时间很谜
grecaptchaRender(id) {
setTimeout(() => {
if (!grecaptcha || !grecaptcha.render) {
this.grecaptchaRender(id);
} else {
grecaptcha.render(id);
}
}, 300)
}
self.captcha = captchaObj
})
})
})
}
},
}
// 加载完成的时间很谜
grecaptchaRender (id) {
setTimeout(() => {
if (!window.grecaptcha || !window.grecaptcha.render) {
this.grecaptchaRender(id)
} else {
window.grecaptcha.render(id)
}
}, 300)
}
}
}

@ -1,63 +1,62 @@
import {
mapActions
} from 'vuex'
import {
mapState
} from 'vuex'
import {
mapMutations
mapActions,
mapState,
mapMutations
} from 'vuex'
import tmp from '../store'
export default {
store: tmp,
computed: mapState({
msgrCon: 'msgrCon',
modalCon: 'modalCon',
globalConfig: 'globalConfig',
logintoken: 'logintoken',
isLoading: 'isLoading',
userCon: state => state.userState.userCon,
userSettings: state => state.userState.userSettings,
currentDlType: state => state.userState.currentDlType,
currentPlantformType: state => state.userState.currentPlantformType,
ssrSubToken: state => state.userState.ssrSubToken,
subUrl: state => state.userState.subUrl,
iosAccount: state => state.userState.iosAccount,
iosPassword: state => state.userState.iosPassword,
displayIosClass: state => state.userState.displayIosClass,
store: tmp,
computed: mapState({
msgrCon: 'msgrCon',
modalCon: 'modalCon',
globalConfig: 'globalConfig',
logintoken: 'logintoken',
isLoading: 'isLoading',
userCon: state => state.userState.userCon,
userSettings: state => state.userState.userSettings,
currentDlType: state => state.userState.currentDlType,
currentPlantformType: state => state.userState.currentPlantformType,
ssrSubToken: state => state.userState.ssrSubToken,
subUrl: state => state.userState.subUrl,
iosAccount: state => state.userState.iosAccount,
iosPassword: state => state.userState.iosPassword,
displayIosClass: state => state.userState.displayIosClass,
sign: state => state.userState.sign
}),
methods: {
...mapActions({
callMsgr: 'CALL_MSGR',
callModal: 'CALL_MODAL',
TraffictransTrigger: 'TraffictransTrigger'
}),
...mapMutations({
setGlobalConfig: 'SET_GLOBALCONFIG',
setHitokoto: 'SET_HITOKOTO',
setJinRiShiCi: 'SET_JINRISHICI',
setLoadState: 'SET_LOADSTATE',
setLoginToken: 'SET_LOGINTOKEN',
setUserMoney: 'SET_USERMONEY',
setInviteNum: 'SET_INVITE_NUM',
setReasourse: 'SET_RESOURSE',
setUserCon: 'SET_USERCON',
setUserSettings: 'SET_USERSETTINGS',
addNewUserCon: 'ADD_NEWUSERCON',
setAllResourse: 'SET_ALLURESOURSE',
setCurrentDlType: 'SET_CURRENT_DL_TYPE',
setCurrentPlantformType: 'SET_CURRENT_PLANTFORM_TYPE',
setAllBaseCon: 'SET_ALLBASECON',
setSignSet: 'SET_SIGNSET'
}),
methods: {
...mapActions({
callMsgr: 'CALL_MSGR',
callModal: 'CALL_MODAL',
}),
...mapMutations({
setGlobalConfig: 'SET_GLOBALCONFIG',
setHitokoto: 'SET_HITOKOTO',
setJinRiShiCi: 'SET_JINRISHICI',
setLoadState: 'SET_LOADSTATE',
setLoginToken: 'SET_LOGINTOKEN',
setUserMoney: 'SET_USERMONEY',
setInviteNum: 'SET_INVITE_NUM',
setReasourse: 'SET_RESOURSE',
setUserCon: 'SET_USERCON',
setUserSettings: 'SET_USERSETTINGS',
addNewUserCon: 'ADD_NEWUSERCON',
setAllResourse: 'SET_ALLURESOURSE',
setCurrentDlType: 'SET_CURRENT_DL_TYPE',
setCurrentPlantformType: 'SET_CURRENT_PLANTFORM_TYPE',
setAllBaseCon: 'SET_ALLBASECON',
}),
successCopied() {
let callConfig = {
msg: '复制成功!已将链接复制到剪贴板',
icon: 'fa-check-square-o',
time: '1500',
}
this.callMsgr(callConfig);
},
},
successCopied () {
let callConfig = {
msg: '复制成功!已将链接复制到剪贴板',
icon: 'fa-check-square-o',
time: '1500'
}
this.callMsgr(callConfig)
}
}
}
}

@ -1,16 +1,16 @@
import { _get } from '../js/fetch'
export default {
props: ['annC','baseURL'],
methods: {
reConfigResourse() {
_get('/getallresourse','include').then((r)=>{
console.log(r);
this.updateUserSet(r.resourse);
});
},
updateUserSet(resourse) {
this.setAllResourse(resourse);
},
props: ['annC', 'baseURL'],
methods: {
reConfigResourse () {
_get('/getallresourse', 'include').then((r) => {
window.console.log(r)
this.updateUserSet(r.resourse)
})
},
updateUserSet (resourse) {
this.setAllResourse(resourse)
}
}
}
}

@ -1,8 +1,8 @@
export default {
props: ['resourseTrans'],
methods: {
wheelChange(e) {
this.$emit('turnPageByWheel', e.deltaY);
},
},
}
props: ['resourseTrans'],
methods: {
wheelChange (e) {
this.$emit('turnPageByWheel', e.deltaY)
}
}
}

@ -14,109 +14,108 @@ import tmp from './store'
Vue.use(Router)
let globalConfig;
let globalConfig
const router = new Router({
routes: [{
path: '/',
components: {
default: Root,
},
path: '/',
components: {
default: Root
},
meta: {
title: 'Index'
}
},
{
path: '/auth/',
component: Auth,
redirect: '/auth/login',
meta: {
alreadyAuth: true
},
children: [{
path: 'Login',
component: Login,
meta: {
title: 'Index',
title: 'login'
}
},
{
path: '/auth/',
component: Auth,
redirect: '/auth/login',
path: 'register',
component: Register,
meta: {
alreadyAuth: true,
},
children: [{
path: 'Login',
component: Login,
meta: {
title: 'login',
}
},
{
path: 'register',
component: Register,
meta: {
title: 'Register',
}
},
],
title: 'Register'
}
}
]
},
{
path: '/password/',
component: Password,
redirect: '/password/reset',
meta: {
alreadyAuth: true
},
{
path: '/password/',
component: Password,
redirect: '/password/reset',
children: [{
path: 'reset',
component: Reset,
meta: {
alreadyAuth: true
},
children: [{
path: 'reset',
component: Reset,
meta: {
title: 'Reset',
}
}, ],
title: 'Reset'
}
} ]
},
{
path: '/user/',
component: User,
redirect: '/user/panel',
meta: {
requireAuth: true
},
{
path: '/user/',
component: User,
redirect: '/user/panel',
children: [{
path: 'panel',
component: Panel,
meta: {
requireAuth: true
},
children: [{
path: 'panel',
component: Panel,
meta: {
title: 'Usercenter',
}
}]
}
],
title: 'Usercenter'
}
}]
}
]
})
router.beforeEach((to, from, next) => {
if (!globalConfig) {
_get('/globalconfig', 'include').then((r) => {
if (r.ret == 1) {
globalConfig = r.globalConfig;
if (r.ret === 1) {
globalConfig = r.globalConfig
if (globalConfig.geetest_html && globalConfig.geetest_html.success) {
globalConfig.isGetestSuccess = '1';
tmp.commit('SET_GLOBALCONFIG', globalConfig);
globalConfig.isGetestSuccess = '1'
tmp.commit('SET_GLOBALCONFIG', globalConfig)
} else {
globalConfig.isGetestSuccess = '0';
tmp.commit('SET_GLOBALCONFIG', globalConfig);
globalConfig.isGetestSuccess = '0'
tmp.commit('SET_GLOBALCONFIG', globalConfig)
}
}
}).then((r) => {
navGuardsForEach();
});
navGuardsForEach()
})
} else {
navGuardsForEach();
navGuardsForEach()
}
function navGuardsForEach() {
if ((tmp.state.logintoken != false) && to.matched.some(function (record) {
return record.meta.alreadyAuth;
})) {
next('/user/panel');
} else if ((tmp.state.logintoken == false) && to.matched.some(function (record) {
return record.meta.requireAuth;
})) {
next('/auth/login');
function navGuardsForEach () {
if (tmp.state.logintoken && to.matched.some(function (record) {
return record.meta.alreadyAuth
})) {
next('/user/panel')
} else if (!tmp.state.logintoken && to.matched.some(function (record) {
return record.meta.requireAuth
})) {
next('/auth/login')
} else {
document.title = tmp.state.globalConfig.indexMsg.appname + ' - ' + to.meta.title;
next();
document.title = tmp.state.globalConfig.indexMsg.appname + ' - ' + to.meta.title
next()
}
}
})
export default router;
export default router

@ -13,13 +13,13 @@ export default new Vuex.Store({
msg: '操作成功',
html: '',
icon: ['fa', 'fa-check-square-o'],
isShow: false,
isShow: false
},
modalCon: {
isMaskShow: false,
isCardShow: false,
title: '订单确认',
bodyContent: '',
bodyContent: ''
},
globalConfig: {
captchaProvider: '',
@ -36,101 +36,103 @@ export default new Vuex.Store({
enable_telegram: '',
enableLoginCaptcha: '',
enableRegCaptcha: '',
enableCheckinCaptcha: '',
indexMsg: {
appname: '',
hitokoto: '',
date: '',
jinrishici: '',
},
},
jinrishici: ''
}
}
},
mutations: {
SET_LOADSTATE(state) {
state.isLoading = 'loaded';
SET_LOADSTATE (state) {
state.isLoading = 'loaded'
},
SET_LOGINTOKEN(state, n) {
state.logintoken = n;
SET_LOGINTOKEN (state, n) {
state.logintoken = n
},
SET_MSGRCON(state, config) {
SET_MSGRCON (state, config) {
if (state.msgrCon.html !== '') {
state.msgrCon.html = '';
state.msgrCon.html = ''
}
state.msgrCon.msg = config.msg;
state.msgrCon.icon[1] = config.icon;
state.msgrCon.html = config.html;
state.msgrCon.msg = config.msg
state.msgrCon.icon[1] = config.icon
state.msgrCon.html = config.html
},
ISSHOW_MSGR(state, boolean) {
state.msgrCon.isShow = boolean;
ISSHOW_MSGR (state, boolean) {
state.msgrCon.isShow = boolean
},
ISSHOW_MODAL_MASK(state, boolean) {
state.modalCon.isMaskShow = boolean;
ISSHOW_MODAL_MASK (state, boolean) {
state.modalCon.isMaskShow = boolean
},
ISSHOW_MODAL_CARD(state, boolean) {
state.modalCon.isCardShow = boolean;
ISSHOW_MODAL_CARD (state, boolean) {
state.modalCon.isCardShow = boolean
},
SET_GLOBALCONFIG(state, config) {
SET_GLOBALCONFIG (state, config) {
state.logintoken = config.isLogin
state.globalConfig.base_url = config.base_url;
state.globalConfig.captchaProvider = config.captcha_provider;
state.globalConfig.recaptchaSiteKey = config.recaptcha_sitekey;
state.globalConfig.jumpDelay = config.jump_delay;
state.globalConfig.isGetestSuccess = config.isGetestSuccess;
state.globalConfig.registMode = config.register_mode;
state.globalConfig.isEmailVeryify = config.enable_email_verify;
state.globalConfig.enableLoginCaptcha = config.enable_logincaptcha;
state.globalConfig.enableRegCaptcha = config.enable_regcaptcha;
state.globalConfig.login_token = config.login_token;
state.globalConfig.login_number = config.login_number;
state.globalConfig.telegram_bot = config.telegram_bot;
state.globalConfig.crisp = config.enable_crisp;
state.globalConfig.enable_telegram = config.enable_telegram;
state.globalConfig.indexMsg.appname = config.appName;
state.globalConfig.indexMsg.date = config.dateY;
state.globalConfig.base_url = config.base_url
state.globalConfig.captchaProvider = config.captcha_provider
state.globalConfig.recaptchaSiteKey = config.recaptcha_sitekey
state.globalConfig.jumpDelay = config.jump_delay
state.globalConfig.isGetestSuccess = config.isGetestSuccess
state.globalConfig.registMode = config.register_mode
state.globalConfig.isEmailVeryify = config.enable_email_verify
state.globalConfig.enableLoginCaptcha = config.enable_logincaptcha
state.globalConfig.enableRegCaptcha = config.enable_regcaptcha
state.globalConfig.enableCheckinCaptcha = config.enable_checkin_captcha
state.globalConfig.login_token = config.login_token
state.globalConfig.login_number = config.login_number
state.globalConfig.telegram_bot = config.telegram_bot
state.globalConfig.crisp = config.enable_mylivechat
state.globalConfig.enable_telegram = config.enable_telegram
state.globalConfig.indexMsg.appname = config.appName
state.globalConfig.indexMsg.date = config.dateY
},
SET_HITOKOTO(state, content) {
state.globalConfig.indexMsg.hitokoto = content;
},
SET_JINRISHICI(state, content) {
state.globalConfig.indexMsg.jinrishici = content;
SET_HITOKOTO (state, content) {
state.globalConfig.indexMsg.hitokoto = content
},
SET_JINRISHICI (state, content) {
state.globalConfig.indexMsg.jinrishici = content
}
},
actions: {
CALL_MSGR({
CALL_MSGR ({
dispatch,
commit,
state
}, config) {
if (state.msgrCon.isShow === true) {
commit('ISSHOW_MSGR', false);
commit('ISSHOW_MSGR', false)
setTimeout(() => {
dispatch('CALL_MSGR', config);
}, 300);
dispatch('CALL_MSGR', config)
}, 300)
} else {
commit('SET_MSGRCON', config);
commit('ISSHOW_MSGR', true);
commit('SET_MSGRCON', config)
commit('ISSHOW_MSGR', true)
window.setTimeout(function () {
commit('ISSHOW_MSGR', false);
commit('ISSHOW_MSGR', false)
}, config.time)
}
},
CALL_MODAL({
CALL_MODAL ({
commit,
state
}, config) {
if (state.modalCon.isMaskShow === false) {
commit('ISSHOW_MODAL_MASK', true);
commit('ISSHOW_MODAL_MASK', true)
window.setTimeout(() => {
commit('ISSHOW_MODAL_CARD', true)
}, 300);
}, 300)
} else {
commit('ISSHOW_MODAL_CARD', false);
commit('ISSHOW_MODAL_CARD', false)
window.setTimeout(() => {
commit('ISSHOW_MODAL_MASK', false)
}, 300);
}, 300)
}
},
}
},
modules: {
userState: UserTmp,
userState: UserTmp
}
})
})

@ -1,113 +1,136 @@
import Vue from 'vue'
export default {
state: {
userCon: '',
ssrSubToken: '',
subUrl: '',
iosAccount: '',
iosPassword: '',
displayIosClass: '',
userSettings: {
pages: [{
id: 'user-resourse',
},
{
id: 'user-settings',
},
],
currentPage: 'user-resourse',
currentPageIndex: 0,
resourse: [{
name: '等级有效期',
content: '',
},
{
name: '账号有效期',
content: '',
},
{
name: '在线设备数',
content: '',
},
{
name: '端口速率',
content: '',
},
],
tipsLink: [{
name: '端口',
content: '',
},
{
name: '密码',
content: '',
},
{
name: '加密',
content: '',
},
{
name: '协议',
content: '',
},
{
name: '混淆',
content: '',
},
{
name: '混淆参数',
content: '',
},
],
},
currentDlType: 'SSR',
currentPlantformType: 'WINDOWS',
state: {
userCon: '',
ssrSubToken: '',
subUrl: '',
iosAccount: '',
iosPassword: '',
displayIosClass: '',
sign: {
isTrsfficRefreshed: false,
isSignShow: false,
transition: false
},
mutations: {
SET_USERCON(state, config) {
state.userCon = config;
},
SET_USERMONEY(state, number) {
state.userCon.money = number;
},
SET_INVITE_NUM(state, number) {
state.userCon.invite_num = number;
},
SET_USERSETTINGS(state, config) {
state.userSettings.tipsLink[0].content = config.port;
state.userSettings.tipsLink[1].content = config.passwd;
state.userSettings.tipsLink[2].content = config.method;
state.userSettings.tipsLink[3].content = config.protocol;
state.userSettings.tipsLink[4].content = config.obfs;
state.userSettings.tipsLink[5].content = config.obfs_param;
},
ADD_NEWUSERCON(state, config) {
for (let key in config) {
Vue.set(state.userCon, key, config[key]);
}
},
SET_RESOURSE(state, config) {
state.userSettings.resourse[config.index].content = config.content;
},
SET_ALLURESOURSE(state, config) {
for (let key in config) {
state.userCon[key] = config[key];
}
},
SET_CURRENT_DL_TYPE (state, content) {
state.currentDlType = content;
},
SET_CURRENT_PLANTFORM_TYPE (state, content) {
state.currentPlantformType = content;
},
SET_ALLBASECON (state, config) {
for (let key in config) {
Vue.set(state, key, config[key]);
}
},
userSettings: {
pages: [{
id: 'user-resourse'
},
{
id: 'user-settings'
}
],
currentPage: 'user-resourse',
currentPageIndex: 0,
resourse: [{
name: '等级有效期',
content: ''
},
{
name: '账号有效期',
content: ''
},
{
name: '在线设备数',
content: ''
},
{
name: '端口速率',
content: ''
}
],
tipsLink: [{
name: '端口',
content: ''
},
{
name: '密码',
content: ''
},
{
name: '加密',
content: ''
},
{
name: '协议',
content: ''
},
{
name: '混淆',
content: ''
},
{
name: '混淆参数',
content: ''
}
]
},
actions: {
currentDlType: 'SSR',
currentPlantformType: 'WINDOWS'
},
mutations: {
SET_USERCON (state, config) {
state.userCon = config
},
SET_USERMONEY (state, number) {
state.userCon.money = number
},
SET_INVITE_NUM (state, number) {
state.userCon.invite_num = number
},
SET_USERSETTINGS (state, config) {
state.userSettings.tipsLink[0].content = config.port
state.userSettings.tipsLink[1].content = config.passwd
state.userSettings.tipsLink[2].content = config.method
state.userSettings.tipsLink[3].content = config.protocol
state.userSettings.tipsLink[4].content = config.obfs
state.userSettings.tipsLink[5].content = config.obfs_param
},
ADD_NEWUSERCON (state, config) {
for (let key in config) {
Vue.set(state.userCon, key, config[key])
}
},
SET_RESOURSE (state, config) {
state.userSettings.resourse[config.index].content = config.content
},
SET_ALLURESOURSE (state, config) {
for (let key in config) {
state.userCon[key] = config[key]
}
},
SET_CURRENT_DL_TYPE (state, content) {
state.currentDlType = content
},
SET_CURRENT_PLANTFORM_TYPE (state, content) {
state.currentPlantformType = content
},
SET_ALLBASECON (state, config) {
for (let key in config) {
Vue.set(state, key, config[key])
}
},
}
SET_SIGNSET (state, config) {
for (let key in config) {
state.sign[key] = config[key]
}
}
},
actions: {
TraffictransTrigger ({
dispatch,
commit,
state
}, config) {
commit('SET_SIGNSET', {
isTrsfficRefreshed: true
})
window.setTimeout(() => {
commit('SET_SIGNSET', {
isTrsfficRefreshed: false
})
}, 300)
}
}
}

@ -2,7 +2,7 @@
<div class="auth pure-g align-center">
<div class="pure-u-1 pure-u-sm-4-24 flex wrap space-around auth-links">
<router-link
v-for="(links,key) in routerLinks"
v-for="links in routerLinks"
@click.native="setButtonState"
:class="{ active:links.isActive }"
class="button-round flex align-center"
@ -24,57 +24,56 @@
<script>
export default {
props: ["routermsg"],
data: function() {
props: ['routermsg'],
data: function () {
return {
routerLinks: {
login: {
id: "R_AUTH_0",
href: "/auth/login",
content: "登录",
icon: ["fa", "fa-sign-in", "fa-stack-1x", "fa-inverse"],
id: 'R_AUTH_0',
href: '/auth/login',
content: '登录',
icon: ['fa', 'fa-sign-in', 'fa-stack-1x', 'fa-inverse'],
isActive: false
},
register: {
id: "R_AUTH_1",
href: "/auth/register",
content: "注册",
icon: ["fa", "fa-user-plus", "fa-stack-1x", "fa-inverse"],
id: 'R_AUTH_1',
href: '/auth/register',
content: '注册',
icon: ['fa', 'fa-user-plus', 'fa-stack-1x', 'fa-inverse'],
isActive: false
},
reset: {
id: "R_PW_0",
href: "/password/reset",
content: "密码重置",
icon: ["fa", "fa-unlock-alt", "fa-stack-1x", "fa-inverse"],
id: 'R_PW_0',
href: '/password/reset',
content: '密码重置',
icon: ['fa', 'fa-unlock-alt', 'fa-stack-1x', 'fa-inverse'],
isActive: false
}
}
};
}
},
methods: {
setButtonState() {
setButtonState () {
for (let key in this.routerLinks) {
if (this.$route.path == this.routerLinks[key].href) {
this.routerLinks[key].isActive = true;
if (this.$route.path === this.routerLinks[key].href) {
this.routerLinks[key].isActive = true
} else {
this.routerLinks[key].isActive = false;
this.routerLinks[key].isActive = false
}
}
}
},
watch: {
$route: "setButtonState"
$route: 'setButtonState'
},
beforeRouteEnter(to, from, next) {
beforeRouteEnter (to, from, next) {
next(vm => {
vm.setButtonState();
});
vm.setButtonState()
})
},
beforeRouteLeave(to, from, next) {
this.setButtonState();
next();
beforeRouteLeave (to, from, next) {
this.setButtonState()
next()
}
};
}
</script>

@ -13,7 +13,9 @@
</div>
<div class="input-control flex wrap">
<uim-checkbox v-model="remember_me">
<span slot="content">记住我</span>
<template #content>
<span>记住我</span>
</template>
</uim-checkbox>
</div>
<div class="input-control flex wrap">
@ -47,7 +49,8 @@
</div>
<p id="telegram-alert">正在载入 Telegram,如果长时间未显示请刷新页面或检查代理</p>
<div class="text-center" id="telegram-login-box"></div>
<p>或者添加机器人账号
<p>
或者添加机器人账号
<a :href="telegramHref">@{{globalConfig.telegram_bot}}</a>,发送下面的数字/二维码验证码给它
</p>
<transition name="fade" mode="out-in">
@ -68,19 +71,19 @@
</template>
<script>
import { mapState } from 'vuex'
import { mapState } from "vuex";
import storeMap from '@/mixins/storeMap'
import storeAuth from '@/mixins/storeAuth'
import storeMap from "@/mixins/storeMap";
import storeAuth from "@/mixins/storeAuth";
import Checkbox from '@/components/checkbox.vue'
import Checkbox from "@/components/checkbox.vue";
import { _post } from '../js/fetch'
import { _post } from "../js/fetch";
export default {
mixins: [storeMap, storeAuth],
components: {
"uim-checkbox": Checkbox,
"uim-checkbox": Checkbox
},
computed: mapState({
telegramHref: function() {
@ -101,7 +104,6 @@ export default {
},
methods: {
login() {
this.isDisabled = true;
let ajaxCon = {
@ -119,10 +121,10 @@ export default {
if (this.globalConfig.enableLoginCaptcha !== "false") {
switch (this.globalConfig.captchaProvider) {
case "recaptcha":
ajaxCon.recaptcha = grecaptcha.getResponse();
ajaxCon.recaptcha = window.grecaptcha.getResponse();
break;
case "geetest":
if (this.validate !== '') {
if (this.validate !== "") {
ajaxCon.geetest_challenge = this.validate.geetest_challenge;
ajaxCon.geetest_validate = this.validate.geetest_validate;
ajaxCon.geetest_seccode = this.validate.geetest_seccode;
@ -139,7 +141,7 @@ export default {
callConfig.icon += "fa-check-square-o";
this.callMsgr(callConfig);
window.setTimeout(() => {
this.setLoginToken(1);
this.setLoginToken(true);
this.$router.replace("/user/panel");
}, this.globalConfig.jumpDelay);
} else {
@ -168,7 +170,7 @@ export default {
el.setAttribute("data-request-access", "write");
let telegram_qrcode = "mod://login/" + this.globalConfig.login_token;
let qrcode = new QRCode(document.getElementById("telegram-qr"));
let qrcode = new window.QRCode(document.getElementById("telegram-qr"));
qrcode.clear();
qrcode.makeCode(telegram_qrcode);
},
@ -189,40 +191,42 @@ export default {
number: this.globalConfig.login_number
}),
"include"
).then(r => {
if (r.ret > 0) {
)
.then(r => {
if (r.ret > 0) {
clearTimeout(tid);
_post(
"/auth/qrcode_login",
JSON.stringify({
token: this.globalConfig.login_token,
number: this.globalConfig.login_number
}),
"include"
).then(r => {
if (r.ret) {
callConfig.msg += "登录成功Kira~";
callConfig.icon += "fa-check-square-o";
this.callMsgr(callConfig);
window.setTimeout(() => {
this.setLoginToken(true);
this.$router.replace("/user/panel");
}, this.globalConfig.jumpDelay);
}
});
} else if (r.ret === -1) {
this.isTgtimeout = true;
}
})
.catch(r => {
clearTimeout(tid);
_post(
"/auth/qrcode_login",
JSON.stringify({
token: this.globalConfig.login_token,
number: this.globalConfig.login_number
}),
"include"
).then(r => {
if (r.ret) {
callConfig.msg += "登录成功Kira~";
callConfig.icon += "fa-check-square-o";
this.callMsgr(callConfig);
window.setTimeout(() => {
this.setLoginToken(1);
this.$router.replace("/user/panel");
}, this.globalConfig.jumpDelay);
}
});
} else if (r.ret == -1) {
this.isTgtimeout = true;
}
}).catch((r)=>{
clearTimeout(tid)
throw r
});
throw r;
});
tid = setTimeout(() => {
this.tgAuthTrigger(tid);
}, 2500);
},
loginBindEnter(e) {
if (this.$route.path === "/auth/login" && e.keyCode == 13) {
if (this.$route.path === "/auth/login" && e.keyCode === 13) {
this.login();
}
}
@ -249,4 +253,3 @@ export default {
}
};
</script>

@ -64,12 +64,12 @@
class="pure-u-1-3 btn-user"
:key="key"
>
<span slot="dpbtn-content">{{key}}</span>
<ul slot="dp-menu">
<template #dpbtn-content>{{key}}</template>
<template #dp-menu>
<li v-for="agent in value" :key="agent.id">
<a :href="agent.href">{{agent.agentName}}</a>
</li>
</ul>
</template>
</uim-dropdown>
</div>
</transition>
@ -83,7 +83,7 @@
v-show="toolTips.resetConfirm"
class="uim-tooltip-top flex justify-center"
>
<div slot="tooltip-inner">
<template #tooltip-inner>
<span>确定要重置订阅链接?</span>
<div>
<button @click="resetSubscribLink" class="tips tips-green">
@ -93,7 +93,7 @@
<span class="fa fa-fw fa-remove"></span>
</button>
</div>
</div>
</template>
</uim-tooltip>
</span>
</h5>
@ -119,9 +119,9 @@
v-show="toolTips[typeToken.muType]"
class="uim-tooltip-top flex justify-center"
>
<div class="sublink" slot="tooltip-inner">
<template #tooltip-inner>
<span>{{typeToken.subUrl}}</span>
</div>
</template>
</uim-tooltip>
</span>
</div>
@ -148,9 +148,9 @@
v-show="toolTips.mu1"
class="uim-tooltip-top flex justify-center"
>
<div class="sublink" slot="tooltip-inner">
<template #tooltip-inner>
<span>{{suburlMu1}}</span>
</div>
</template>
</uim-tooltip>
</span>
</div>
@ -163,7 +163,7 @@
<div class="pure-u-1 pure-u-sm-17-24">
<div class="card relative">
<uim-anchor>
<ul slot="uim-anchor-inner">
<template #uim-anchor-inner>
<li
v-for="(page,index) in userSettings.pages"
@click="changeUserSetPage(index)"
@ -171,7 +171,7 @@
:data-page="page.id"
:key="page.id"
></li>
</ul>
</template>
</uim-anchor>
<transition name="fade" mode="out-in">
<keep-alive>
@ -188,19 +188,19 @@
<div class="user-btngroup pure-g">
<div class="pure-u-1-2 pure-u-sm-16-24 btngroup-left">
<uim-dropdown>
<span slot="dpbtn-content">
<template #dpbtn-content>
<transition name="fade" mode="out-in">
<div :key="currentCardComponent">{{menuOptions[currentCardComponentIndex].name}}</div>
</transition>
</span>
<ul slot="dp-menu">
</template>
<template #dp-menu>
<li
@click="componentChange"
v-for="menu in menuOptions"
:data-component="menu.id"
:key="menu.id"
>{{menu.name}}</li>
</ul>
</template>
</uim-dropdown>
<a v-if="userCon.is_admin === true" class="btn-user" href="/admin">运营中心</a>
</div>
@ -273,7 +273,6 @@ export default {
muType: "mu0",
subUrl: this.suburlMu0
};
break;
case "SS/SSD":
return {
tagkey: "dl-ss",
@ -282,7 +281,6 @@ export default {
muType: "mu3",
subUrl: this.suburlMu3
};
break;
case "V2RAY":
return {
tagkey: "dl-v2",
@ -291,23 +289,18 @@ export default {
muType: "mu2",
subUrl: this.suburlMu2
};
break;
}
},
currentCardComponentIndex: function() {
switch (this.currentCardComponent) {
case "user-announcement":
return 0;
break;
case "user-guide":
return 1;
break;
case "user-invite":
return 2;
break;
case "user-shop":
return 3;
break;
}
}
},
@ -371,7 +364,7 @@ export default {
callConfig.icon += "fa-check-square-o";
this.callMsgr(callConfig);
window.setTimeout(() => {
this.setLoginToken(0);
this.setLoginToken(false);
this.$router.replace("/");
}, this.globalConfig.jumpDelay);
}
@ -436,6 +429,18 @@ export default {
let index = this.indexMinus(this.userSettings.currentPageIndex);
this.changeUserSetPage(index);
}
},
showSigner() {
let promise = new Promise((resolve, reject) => {
this.setSignSet({ transition: true });
resolve();
});
promise.then(r => {
window.console.log(r);
setTimeout(() => {
this.setSignSet({ isSignShow: true });
}, 500);
});
}
},
mounted() {
@ -445,10 +450,10 @@ export default {
_get("/getuserinfo", "include")
.then(r => {
if (r.ret === 1) {
console.log(r.info);
window.console.log(r.info);
this.setUserCon(r.info.user);
this.setUserSettings(this.userCon);
console.log(this.userCon);
window.console.log(this.userCon);
if (r.info.ann) {
this.ann = r.info.ann;
}
@ -466,6 +471,7 @@ export default {
.then(r => {
setTimeout(() => {
self.userLoadState = "loaded";
this.showSigner();
}, 1000);
});
},
@ -477,7 +483,11 @@ export default {
) {
next(false);
} else {
next();
this.setSignSet({ isSignShow: false });
setTimeout(() => {
this.setSignSet({ transition: false });
next();
}, 200);
}
}
};

@ -8,6 +8,6 @@
import storeMap from '@/mixins/storeMap'
export default {
mixins: [storeMap],
mixins: [storeMap]
}
</script>

@ -78,25 +78,24 @@ import tmp from '../store.js'
export default {
mixins: [storeMap, storeAuth],
data: function() {
data: function () {
return {
usrname: "",
email: "",
passwd: "",
repasswd: "",
contect: "",
code: "",
imtype: "",
email_code: "",
usrname: '',
email: '',
passwd: '',
repasswd: '',
contect: '',
code: '',
imtype: '',
email_code: '',
isDisabled: false,
vmText: "获取邮箱验证码",
vmText: '获取邮箱验证码',
isVmDisabled: false
};
}
},
methods: {
register() {
this.isDisabled = true;
register () {
this.isDisabled = true
let ajaxCon = {
email: this.email,
@ -106,164 +105,163 @@ export default {
wechat: this.contect,
imtype: this.imtype,
code: this.code
};
}
let callConfig = {
msg: "",
icon: "",
msg: '',
icon: '',
time: 1000
};
}
if (this.globalConfig.isEmailVeryify === "true") {
ajaxCon.emailcode = this.email_code;
if (this.globalConfig.isEmailVeryify === 'true') {
ajaxCon.emailcode = this.email_code
}
if (this.globalConfig.registMode !== "invite") {
ajaxCon.code = 0;
if (this.getCookie("code") !== "") {
ajaxCon.code = this.getCookie("code");
if (this.globalConfig.registMode !== 'invite') {
ajaxCon.code = 0
if (this.getCookie('code') !== '') {
ajaxCon.code = this.getCookie('code')
}
}
if (this.globalConfig.enableRegCaptcha !== "false") {
if (this.globalConfig.enableRegCaptcha !== 'false') {
switch (this.globalConfig.captchaProvider) {
case "recaptcha":
ajaxCon.recaptcha = grecaptcha.getResponse();
break;
case "geetest":
case 'recaptcha':
ajaxCon.recaptcha = window.grecaptcha.getResponse()
break
case 'geetest':
if (this.validate !== '') {
ajaxCon.geetest_challenge = this.validate.geetest_challenge;
ajaxCon.geetest_validate = this.validate.geetest_validate;
ajaxCon.geetest_seccode = this.validate.geetest_seccode;
ajaxCon.geetest_challenge = this.validate.geetest_challenge
ajaxCon.geetest_validate = this.validate.geetest_validate
ajaxCon.geetest_seccode = this.validate.geetest_seccode
} else {
callConfig.msg += "请滑动验证码来完成验证。";
callConfig.msg += '请滑动验证码来完成验证。'
}
break;
break
}
}
_post("/auth/register", JSON.stringify(ajaxCon), "include").then(r => {
if (r.ret == 1) {
callConfig.msg = "注册成功meow~";
callConfig.icon = "fa-check-square-o";
this.callMsgr(callConfig);
_post('/auth/register', JSON.stringify(ajaxCon), 'include').then(r => {
if (r.ret === 1) {
callConfig.msg = '注册成功meow~'
callConfig.icon = 'fa-check-square-o'
this.callMsgr(callConfig)
window.setTimeout(() => {
this.$router.replace("/auth/login");
}, this.globalConfig.jumpDelay);
this.$router.replace('/auth/login')
}, this.globalConfig.jumpDelay)
} else {
callConfig.msg = `WTF……注册失败,${r.msg}`;
callConfig.icon += "fa-times-circle-o";
this.callMsgr(callConfig);
callConfig.msg = `WTF……注册失败,${r.msg}`
callConfig.icon += 'fa-times-circle-o'
this.callMsgr(callConfig)
window.setTimeout(() => {
this.isDisabled = false;
}, 3000);
this.isDisabled = false
}, 3000)
}
});
})
},
//dumplin:轮子1.js读取url参数//nymph: 重拼字符串
getQueryVariable(variable) {
var query = window.location.hash.substring(1).split("?")[1];
if (typeof query === "undefined") {
return "";
// dumplin:轮子1.js读取url参数//nymph: 重拼字符串
getQueryVariable (variable) {
var query = window.location.hash.substring(1).split('?')[1]
if (typeof query === 'undefined') {
return ''
}
var vars = query.split("&");
var vars = query.split('&')
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
var pair = vars[i].split('=')
if (pair[0] === variable) {
return pair[1]
}
}
return "";
return ''
},
//dumplin:轮子2.js写入cookie
setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
// dumplin:轮子2.js写入cookie
setCookie (cname, cvalue, exdays) {
var d = new Date()
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000)
var expires = 'expires=' + d.toGMTString()
document.cookie = cname + '=' + cvalue + '; ' + expires
},
//dumplin:轮子3.js读取cookie
getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(";");
// dumplin:轮子3.js读取cookie
getCookie (cname) {
var name = cname + '='
var ca = document.cookie.split(';')
for (var i = 0; i < ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
var c = ca[i].trim()
if (c.indexOf(name) === 0) return c.substring(name.length, c.length)
}
return "";
return ''
},
time(time) {
if (time == 0) {
this.isVmDisabled = false;
this.vmText = "获取验证码";
time = 60;
time (time) {
if (time === 0) {
this.isVmDisabled = false
this.vmText = '获取验证码'
time = 60
} else {
this.isVmDisabled = true;
this.vmText = "重新发送(" + time + ")";
time = time - 1;
this.isVmDisabled = true
this.vmText = '重新发送(' + time + ')'
time = time - 1
setTimeout(() => {
this.time(time);
}, 1000);
this.time(time)
}, 1000)
}
},
sendVerifyMail() {
let time = tmp.state.wait;
this.time(time);
sendVerifyMail () {
let time = tmp.state.wait
this.time(time)
let ajaxCon = {
email: this.email
};
}
_post("auth/send", JSON.stringify(ajaxCon), "omit").then(r => {
_post('auth/send', JSON.stringify(ajaxCon), 'omit').then(r => {
if (r.ret) {
let callConfig = {
msg: "biu~邮件发送成功",
icon: "fa-check-square-o",
msg: 'biu~邮件发送成功',
icon: 'fa-check-square-o',
time: 1000
};
this.callMsgr(callConfig);
}
this.callMsgr(callConfig)
} else {
let callConfig = {
msg: "emm……邮件发送失败",
icon: "fa-times-circle-o",
msg: 'emm……邮件发送失败',
icon: 'fa-times-circle-o',
time: 1000
};
this.callMsgr(callConfig);
}
this.callMsgr(callConfig)
}
});
})
},
registerBindEnter(e) {
if (this.$route.path === "/auth/register" && e.keyCode == 13) {
this.register();
registerBindEnter (e) {
if (this.$route.path === '/auth/register' && e.keyCode === 13) {
this.register()
}
}
},
mounted() {
//dumplin:读取url参数写入cookie,自动跳转隐藏url邀请码
if (this.getQueryVariable("code") != "") {
this.setCookie("code", this.getQueryVariable("code"), 30);
this.$router.replace("/auth/register");
mounted () {
// dumplin:读取url参数写入cookie,自动跳转隐藏url邀请码
if (this.getQueryVariable('code') !== '') {
this.setCookie('code', this.getQueryVariable('code'), 30)
this.$router.replace('/auth/register')
}
//dumplin:读取cookie,自动填入邀请码框
if (this.globalConfig.registMode == "invite") {
if (this.getCookie("code") != "") {
this.code = this.getCookie("code");
// dumplin:读取cookie,自动填入邀请码框
if (this.globalConfig.registMode === 'invite') {
if (this.getCookie('code') !== '') {
this.code = this.getCookie('code')
}
}
document.addEventListener("keyup", this.registerBindEnter, false);
document.addEventListener('keyup', this.registerBindEnter, false)
//验证加载
if (this.globalConfig.enableRegCaptcha === "false") {
return;
// 验证加载
if (this.globalConfig.enableRegCaptcha === 'false') {
return
}
this.loadCaptcha("g-recaptcha-reg");
this.loadGT("#embed-captcha-reg");
this.loadCaptcha('g-recaptcha-reg')
this.loadGT('#embed-captcha-reg')
},
beforeRouteLeave(to, from, next) {
document.removeEventListener("keyup", this.registerBindEnter, false);
next();
beforeRouteLeave (to, from, next) {
document.removeEventListener('keyup', this.registerBindEnter, false)
next()
}
};
}
</script>

@ -32,44 +32,44 @@ import { _post } from '../js/fetch'
export default {
mixins: [storeMap],
data: function() {
data: function () {
return {
email: "",
email: '',
isDisabled: false
};
}
},
methods: {
reset() {
reset () {
let callConfig = {
msg: "",
icon: "",
msg: '',
icon: '',
time: 1000
};
}
_post(
"/password/reset",
'/password/reset',
JSON.stringify({
email: this.email
}),
"omit"
'omit'
).then(r => {
if (r.ret == 1) {
callConfig.msg += "邮件发送成功kira~";
callConfig.icon += "fa-check-square-o";
this.callMsgr(callConfig);
if (r.ret === 1) {
callConfig.msg += '邮件发送成功kira~'
callConfig.icon += 'fa-check-square-o'
this.callMsgr(callConfig)
window.setTimeout(() => {
this.$router.push("/auth/login");
}, this.globalConfig.jumpDelay);
this.$router.push('/auth/login')
}, this.globalConfig.jumpDelay)
} else {
callConfig.msg += "WTF……邮件发送失败,请检查邮箱地址";
callConfig.icon += "fa-times-circle-o";
this.callMsgr(callConfig);
callConfig.msg += 'WTF……邮件发送失败,请检查邮箱地址'
callConfig.icon += 'fa-times-circle-o'
this.callMsgr(callConfig)
window.setTimeout(() => {
this.isDisabled = false;
}, 3000);
this.isDisabled = false
}, 3000)
}
});
})
}
}
};
}
</script>

@ -15,7 +15,6 @@
<script>
export default {
props: ['routermsg'],
props: ['routermsg']
}
</script>

@ -6,6 +6,6 @@
<script>
export default {
props: ['routermsg'],
props: ['routermsg']
}
</script>

@ -1,4 +1,4 @@
module.exports = {
publicPath: '/vuedist/',
outputDir: '../public/vuedist/',
}
publicPath: '/vuedist/',
outputDir: '../public/vuedist/'
}

Loading…
Cancel
Save