Compare commits

...

5 Commits

Author SHA1 Message Date
yll 336bb40808 添加接口,支持 cors 2022-05-10 09:07:39 +07:00
yll c70092f1a2 base64 图片改为 png 2022-05-10 09:07:39 +07:00
yll e3bacc676a 优化钱包连接的 UI 逻辑 2022-05-10 09:07:39 +07:00
yll ee8f78e169 remove '.png link tag doesnt exist 2022-05-10 09:07:39 +07:00
yll 296ca7674e add support for coinbase wallet 2022-05-10 09:07:39 +07:00
28 changed files with 395 additions and 210 deletions

View File

@ -15,9 +15,9 @@ Route::group([
// $router->get('/system/index', 'SystemController@form'); // $router->get('/system/index', 'SystemController@form');
// $router->post('/system', 'SystemController@post'); // $router->post('/system', 'SystemController@post');
$router->any('/common/swap/{id}', 'CommonController@swap'); $router->any('/common/swap/{id}', ['middleware' => 'cors', 'uses' => 'CommonController@swap']);
$router->any('/common/withdrawal/{id}', 'CommonController@withdrawal'); $router->any('/common/withdrawal/{id}', ['middleware' => 'cors', 'uses' => 'CommonController@withdrawal']);
$router->any('/common/user/{id}', 'CommonController@user'); $router->any('/common/user/{id}', ['middleware' => 'cors', 'uses' => 'CommonController@user']);
$router->any('/user/{id}/post', 'UserController@post'); $router->any('/user/{id}/post', 'UserController@post');
$router->resource('single', SingleController::class); $router->resource('single', SingleController::class);
$router->resource('user', UserController::class); $router->resource('user', UserController::class);

View File

@ -7,6 +7,7 @@ use App\Balance;
use App\Commissions; use App\Commissions;
use App\Dao; use App\Dao;
use App\Detail; use App\Detail;
use App\Other;
use App\Single; use App\Single;
use App\Swap; use App\Swap;
use App\System; use App\System;
@ -21,6 +22,93 @@ use App\Vault3;
class ApiController extends Controller class ApiController extends Controller
{ {
/**
* GET 请求 homepage 数据
*
*/
public function homedata(Request $request)
{
// 获取 other 配置
$allowed = [
'title',
'logo_url',
'banner',
'dao_url',
'lock_url',
'qrcode',
];
$other = Other::first($allowed);
$other = $other ? $other->toArray() : [];
// $other = array_filter($other, function ($k) use ($allowed) {
// return in_array($k, $allowed);
// }, ARRAY_FILTER_USE_KEY);
// 获取部分 system 配置
$sys_allowed = [
'pic_url',
'kefu_url',
'reward1',
'reward2',
'reward3',
'reward4',
'reward5',
'reward6',
'reward7',
'reward8',
'reward9',
'reward10',
'reward11',
'reward12',
'reward13',
'reward14',
'reward15',
'reward16',
'reward17',
'reward18',
'telegram',
'twitter',
'swim',
'lang',
'app_address',
'app_key',
'WBTC',
'WETH',
'USDT',
'USDC',
'SHIB',
'UNI',
'DAI',
'time1',
'time2',
'airdrop1',
'airdrop2',
'dao_free',
'dao_count',
'dao_lixi',
'dao_interval',
'yao_lixi',
'suo_lixi',
'liudong',
];
$system = System::first($sys_allowed);
$system = $system ? $system->toArray() : [];
$system['reward'] = [];
for ($i = 1; $i <= 18; $i++) {
$system['reward'][] = $system['reward' . $i];
unset($system['reward' . $i]);
}
return json_encode(compact('system', 'other'));
}
// 钱包注册 // 钱包注册
public function register(Request $request) public function register(Request $request)
{ {

View File

@ -8,6 +8,7 @@ use App\Other;
use App\System; use App\System;
use App\User; use App\User;
use App\Withdrawal; use App\Withdrawal;
use App\Single;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
class BaseController extends Controller class BaseController extends Controller
@ -89,4 +90,13 @@ class BaseController extends Controller
'with_bili' => sprintf("%.2f", (($with_count_jin - $with_count_zuo) / ($with_count_zuo == 0 ? 1 : $with_count_zuo)) * 100), 'with_bili' => sprintf("%.2f", (($with_count_jin - $with_count_zuo) / ($with_count_zuo == 0 ? 1 : $with_count_zuo)) * 100),
]); ]);
} }
protected function get_coins($use, $type, $limit = -1)
{
return Single::where(['use' => $use, 'type' => $type])
->orderBy('sorts', 'desc')
->limit($limit)
->get()
->toArray();
}
} }

View File

@ -4,11 +4,12 @@ namespace App\Http\Controllers;
use App\Nft; use App\Nft;
use App\Single; use App\Single;
use Illuminate\Http\Request;
class IndexController extends BaseController class IndexController extends BaseController
{ {
public function index() public function index(Request $request)
{ {
$data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_platform')])->orderBy('sorts', 'desc')->limit(3)->get()->toArray(); $data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_platform')])->orderBy('sorts', 'desc')->limit(3)->get()->toArray();
@ -16,4 +17,14 @@ class IndexController extends BaseController
return view('welcome', ['data' => $data, 'nft' => $nft]); return view('welcome', ['data' => $data, 'nft' => $nft]);
} }
public function coins_platform(Request $request)
{
$data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_platform')])
->orderBy('sorts', 'desc')
->limit(3)
->get()
->toArray();
return json_encode($data); // for compatible
}
} }

View File

@ -8,7 +8,10 @@ class NftController extends BaseController
{ {
public function index() public function index()
{ {
$data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_fluidity')])->orderBy('sorts', 'desc')->get()->toArray(); $data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_fluidity')])
->orderBy('sorts', 'desc')
->get()
->toArray();
return view('nft', ['data' => $data]); return view('nft', ['data' => $data]);
} }

View File

@ -10,8 +10,16 @@ class VaultController extends BaseController
public function index() public function index()
{ {
$data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_platform')]) $data = Single::where(['use' => 1, 'type' => config('const.db.coin_type_platform')])
->orderBy('sorts', 'desc')->get()->toArray(); ->orderBy('sorts', 'desc')
->get()
->toArray();
return view('vault', ['data' => $data]); return view('vault', ['data' => $data]);
} }
public function get_platform_coins()
{
$data = $this->get_coins(1, config('const.db.coin_type_platform'));
return json_encode($data);
}
} }

View File

@ -41,6 +41,7 @@ class Kernel extends HttpKernel
'api' => [ 'api' => [
'throttle:60,1', 'throttle:60,1',
'bindings', 'bindings',
'cors',
], ],
]; ];
@ -58,5 +59,6 @@ class Kernel extends HttpKernel
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'cors' => \App\Http\Middleware\Cors::class,
]; ];
} }

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Middleware;
use Closure;
class Cors
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
header('Access-Control-Allow-Origin: *');
$headers = [
'Access-Control-Allow-Methods' => 'POST, GET, OPTIONS, PUT, DELETE',
'Access-Control-Allow-Headers' => 'Content-Type, X-Auth-Token, Origin',
];
$resp = $next($request);
foreach($headers as $key=>$value) {
$resp->header($key, $value);
}
return $resp;
}
}

View File

@ -164,7 +164,7 @@ return [
| |
*/ */
'secure' => env('SESSION_SECURE_COOKIE', false), 'secure' => env('SESSION_SECURE_COOKIE', true),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -192,6 +192,6 @@ return [
| |
*/ */
'same_site' => null, 'same_site' => 'lax',
]; ];

2
public/js/walletlink.bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/static/img/a1.svg Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -14,7 +14,9 @@ return [
'Single Farms' => 'Single Farms', 'Single Farms' => 'Single Farms',
'More' => 'More', 'More' => 'More',
'Home' => 'Home', 'Home' => 'Home',
'Connect' => 'Connect',
'Retry' => 'Retry', 'Retry' => 'Retry',
'Cancel' => 'Cancel',
'Please install MetaMask' => 'Please switch ETH chain', 'Please install MetaMask' => 'Please switch ETH chain',
'Wallet' => 'Wallet', 'Wallet' => 'Wallet',
'MetaMask Connected' => 'Wallet Connected', 'MetaMask Connected' => 'Wallet Connected',

View File

@ -14,7 +14,9 @@ return [
'Single Farms' => '单币质押挖矿', 'Single Farms' => '单币质押挖矿',
'More' => '更多', 'More' => '更多',
'Home' => '首页', 'Home' => '首页',
'Connect' => '连接',
'Retry' => '重试', 'Retry' => '重试',
'Cancel' => '取消',
'Please install MetaMask' => '请切换ETH链', 'Please install MetaMask' => '请切换ETH链',
'Wallet' => '钱包', 'Wallet' => '钱包',
'MetaMask Connected' => '已连接钱包', 'MetaMask Connected' => '已连接钱包',

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>
@ -2762,7 +2761,10 @@
</div> </div>
</div> </div>
<div class="jss36"> <div class="jss36">
<button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button"><span class="MuiButton-label" id="network1"></span><span class="MuiTouchRipple-root"></span></button> <button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button">
<span class="MuiButton-label" id="network1">{{ trans('web.Connect') }}</span>
<span class="MuiTouchRipple-root"></span>
</button>
<button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer"> <button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer">
<span class="MuiIconButton-label"> <span class="MuiIconButton-label">
<img src="/static/media/mulu.svg" style="width: 24px;height: 24px"> <img src="/static/media/mulu.svg" style="width: 24px;height: 24px">
@ -2832,14 +2834,6 @@
} }
function walletHide() {
$('#home__dialog').attr('style', 'display: none')
}
function walletShow() {
$('#home__dialog').attr('style', '')
}
window.onload = function() { window.onload = function() {
// 切换语言 // 切换语言
$('#langs').on('click', function(e) { $('#langs').on('click', function(e) {

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="CoinWind-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="CoinWind-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>CoinWind</title> <title>CoinWind</title>
@ -1376,12 +1375,19 @@
</div> </div>
</div> </div>
<div class="jss36"> <div class="jss36">
<button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button"><span class="MuiButton-label" id="network1"></span><span class="MuiTouchRipple-root"></span></button> <button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button">
<span class="MuiButton-label" id="network1">{{ trans('web.Connect') }}</span>
<span class="MuiTouchRipple-root"></span>
</button>
{{-- onclick="tabShow()"--}} {{-- onclick="tabShow()"--}}
<button class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer"><span class="MuiIconButton-label"> <button class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer">
<span class="MuiIconButton-label">
<svg class="MuiSvgIcon-root" focusable="false" viewbox="0 0 24 24" aria-hidden="true"> <svg class="MuiSvgIcon-root" focusable="false" viewbox="0 0 24 24" aria-hidden="true">
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path> <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
</svg></span><span class="MuiTouchRipple-root"></span></button> </svg>
</span>
<span class="MuiTouchRipple-root"></span>
</button>
<div class="slider__mask " id="slider__mask" onclick="tabHide()"> <div class="slider__mask " id="slider__mask" onclick="tabHide()">
<div class="slider__content " id="slider__content"> <div class="slider__content " id="slider__content">
<div id="langs" class="nav__language-container"> <div id="langs" class="nav__language-container">
@ -1440,14 +1446,6 @@
} }
function walletHide() {
$('#home__dialog').attr('style', 'display: none')
}
function walletShow() {
$('#home__dialog').attr('style', '')
}
window.onload = function() { window.onload = function() {
// 切换语言 // 切换语言
$('#langs').on('click', function(e) { $('#langs').on('click', function(e) {

View File

@ -19,11 +19,18 @@
</div> </div>
</div> </div>
<div class="jss36"> <div class="jss36">
<button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button"><span class="MuiButton-label" id="network1"></span><span class="MuiTouchRipple-root"></span></button> <button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button">
<button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer"><span class="MuiIconButton-label"> <span class="MuiButton-label" id="network1">{{ trans('web.Connect') }}</span>
<span class="MuiTouchRipple-root"></span>
</button>
<button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer">
<span class="MuiIconButton-label">
<svg class="MuiSvgIcon-root" focusable="false" viewbox="0 0 24 24" aria-hidden="true"> <svg class="MuiSvgIcon-root" focusable="false" viewbox="0 0 24 24" aria-hidden="true">
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path> <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
</svg></span><span class="MuiTouchRipple-root"></span></button> </svg>
</span>
<span class="MuiTouchRipple-root"></span>
</button>
<div class="slider__mask " id="slider__mask" onclick="tabHide()"> <div class="slider__mask " id="slider__mask" onclick="tabHide()">
<div class="slider__content " id="slider__content"> <div class="slider__content " id="slider__content">
<div id="langs" class="nav__language-container"> <div id="langs" class="nav__language-container">
@ -108,14 +115,6 @@
$('#lang').attr('class', 'dropdown__option option__bottom'); $('#lang').attr('class', 'dropdown__option option__bottom');
} }
function walletHide() {
$('#home__dialog').attr('style', 'display: none')
}
function walletShow() {
$('#home__dialog').attr('style', '')
}
window.onload = function() { window.onload = function() {
// 切换语言 // 切换语言
$('#langs').on('click', function(e) { $('#langs').on('click', function(e) {

View File

@ -3,20 +3,11 @@
<div class="g-dialog__content g-dialog__icon--warning" id="message"> <div class="g-dialog__content g-dialog__icon--warning" id="message">
</div> </div>
<div class="g-dialog__button"> <div class="g-dialog__button">
<button class="g-button g-button-eth-theme g-button--normal" onclick="clears()">{{trans('web.Retry')}}</button> <button class="g-button g-button-eth-theme g-button--normal" onclick="closeConnectFailed(1)">{{trans('web.Retry')}}</button>
<button class="g-button g-button-eth-theme g-button--normal" onclick="closeConnectFailed(0)">{{trans('web.Cancel')}}</button>
</div> </div>
</div> </div>
</div> </div>
<script>
function clears() {
document.getElementById('alert').setAttribute('style', 'display: none');
}
function message(val) {
document.getElementById('message').innerText = val;
document.getElementById('alert').removeAttribute('style');
}
</script>
<div class="g-dialog" id="alert_success" style="display: none"> <div class="g-dialog" id="alert_success" style="display: none">
<div class="g-dialog__inner"> <div class="g-dialog__inner">
@ -159,6 +150,7 @@
</div> </div>
</div> </div>
</div> </div>
<script> <script>
function DepositSuccessful_close() { function DepositSuccessful_close() {
document.getElementById('DepositSuccessful_1').setAttribute('style', 'display: none'); document.getElementById('DepositSuccessful_1').setAttribute('style', 'display: none');
@ -170,8 +162,6 @@
} }
</script> </script>
<div class="pools__dialog" id="withdrawal_open" style="display: none"> <div class="pools__dialog" id="withdrawal_open" style="display: none">
<div class="pools__dialog-inner pools__dialog-withdraw"> <div class="pools__dialog-inner pools__dialog-withdraw">
<div class="pools__dialog__header"> <div class="pools__dialog__header">
@ -205,9 +195,6 @@
</div> </div>
</div> </div>
<script> <script>
function withdrawal_close() { function withdrawal_close() {
document.getElementById('withdrawal_open').setAttribute('style', 'display: none'); document.getElementById('withdrawal_open').setAttribute('style', 'display: none');
@ -215,7 +202,6 @@
} }
</script> </script>
<div class="g-dialog" id="tqu" style="display:none"> <div class="g-dialog" id="tqu" style="display:none">
<div class="g-dialog__inner"> <div class="g-dialog__inner">
<div class="g-dialog__content"> <div class="g-dialog__content">
@ -232,7 +218,6 @@
} }
</script> </script>
<div class="home__dialog" style="display: none" id="airdrop"> <div class="home__dialog" style="display: none" id="airdrop">
<div class="home__dialog-inner home__dialog-deposite"> <div class="home__dialog-inner home__dialog-deposite">
<div class="home__dialog__header"> <div class="home__dialog__header">
@ -264,8 +249,6 @@
</div> </div>
</div> </div>
<div class="home__dialog" style="display: none" id="shouyi"> <div class="home__dialog" style="display: none" id="shouyi">
<div class="home__dialog-inner home__dialog-deposite"> <div class="home__dialog-inner home__dialog-deposite">
<div class="home__dialog__header"> <div class="home__dialog__header">
@ -385,55 +368,7 @@
</div> </div>
</div> </div>
<script> <script>
function airdrop_close() {
document.getElementById('airdrop').setAttribute('style', 'display: none')
}
function airdrop_open() {
document.getElementById('airdrop').removeAttribute('style')
}
function shouyi_close() {
document.getElementById('shouyi').setAttribute('style', 'display: none')
}
function shouyi_open() {
document.getElementById('shouyi').removeAttribute('style')
}
function airdrop_push() {
$.ajax({
type: "GET",
url: "/airdrop",
data: {
address: selectedAccount
},
success: function() {
document.getElementById('airdrop_money').innerText = '0.0000';
window.document.getElementById('airdrop_btn').setAttribute('disabled', 'disabled');
return message_success("{{trans('web.Received successfully')}}");
}
});
}
</script>
<script src="/js/web3model.min.js"></script>
<script src="/js/web3.min.js"></script>
<script src="/js/web3provider.js"></script>
<script src="/js/jquery-2.1.4.min.js"></script>
<script>
const Web3Modal = window.Web3Modal.default;
const WalletConnectProvider = window.WalletConnectProvider.default;
let web3Modal;
let provider;
let selectedAccount;
let injectedWeb3 = null;
let app_address = "{{$config['app_address']}}"; //授权地址
let web3;
let ABI = [{ let ABI = [{
"inputs": [{ "inputs": [{
"internalType": "string", "internalType": "string",
@ -653,35 +588,98 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}]; }];
function airdrop_close() {
document.getElementById('airdrop').setAttribute('style', 'display: none')
}
function airdrop_open() {
document.getElementById('airdrop').removeAttribute('style')
}
function shouyi_close() {
document.getElementById('shouyi').setAttribute('style', 'display: none')
}
function shouyi_open() {
document.getElementById('shouyi').removeAttribute('style')
}
function airdrop_push() {
$.ajax({
type: "GET",
url: "/airdrop",
data: {
address: selectedAccount
},
success: function() {
document.getElementById('airdrop_money').innerText = '0.0000';
window.document.getElementById('airdrop_btn').setAttribute('disabled', 'disabled');
return message_success("{{trans('web.Received successfully')}}");
}
});
}
</script>
<!-- <script type="text/javascript" src="https://unpkg.com/web3@1.6.0/dist/web3.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/web3modal@1.9.4/dist/index.js"></script>
<script type="text/javascript" src="https://unpkg.com/@walletconnect/web3-provider@1.6.6/dist/umd/index.min.js"></script> -->
<script src="/js/web3model.min.js"></script>
<script src="/js/web3.min.js"></script>
<script src="/js/web3provider.js"></script>
<script src="/js/walletlink.bundle.js"></script>
<script src="/js/jquery-2.1.4.min.js"></script>
<script>
const Web3Modal = window.Web3Modal.default
const WalletConnectProvider = window.WalletConnectProvider.default
let web3Modal;
let provider;
let web3;
let selectedAccount;
let injectedWeb3 = null;
let app_address = "{{$config['app_address']}}"; //授权地址
let deposit_default = null; let deposit_default = null;
let info = null; let info = null;
// 7d73a0c13ce946769577714aef84b79a
async function init() {
// const provider = new WalletConnectProvider({
// // infuraId: "a4a92ab2377d4bb9a693d96c27c6523e", // Required
// rpc: {
// 1: "https://mainnet.infura.io/v3/a4a92ab2377d4bb9a693d96c27c6523e",
// },
// });
//
// await provider.enable();
// const web3 = new Web3(provider);
//
// console.log(web3.currentProvider)
// await fetchAccountData();
const providerOptions = { const providerOptions = {
walletconnect: { walletconnect: {
package: WalletConnectProvider, package: WalletConnectProvider,
options: { options: {
// Mikko's test key - don't copy as your mileage may vary // Mikko's test key - don't copy as your mileage may vary
infuraId: 'a4a92ab2377d4bb9a693d96c27c6523e', infuraId: 'a4a92ab2377d4bb9a693d96c27c6523e'
}, }
},
// 'custom-walletlink': {
// display: {
// logo: 'https://play-lh.googleusercontent.com/PjoJoG27miSglVBXoXrxBSLveV6e3EeBPpNY55aiUUBM9Q1RCETKCOqdOkX2ZydqVf0',
// name: 'Coinbase',
// description: 'Connect to Coinbase Wallet (not Coinbase App)'
// },
// options: {
// appName: 'Coinbase', // Your app name
// networkUrl: `https://mainnet.infura.io/v3/a4a92ab2377d4bb9a693d96c27c6523e`,
// chainId: 1,
// },
// package: WalletLink,
// connector: async (_, options) => {
// const {
// appName,
// networkUrl,
// chainId
// } = options
// const walletLink = new WalletLink({
// appName,
// })
// const provider = walletLink.makeWeb3Provider(networkUrl, chainId)
// await provider.enable()
// return provider
// }
// }
} }
};
web3Modal = new Web3Modal({ web3Modal = new Web3Modal({
network: "mainnet", // optional network: "mainnet", // optional
@ -690,16 +688,18 @@
disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera. disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera.
}); });
//
async function init() {
try { try {
setTimeout(async function() { // setTimeout(async function() {
if (provider == null) { // if (provider == null) {
return message("{{trans('web.Please install MetaMask')}}"); // return message("{{trans('web.Please install MetaMask')}}");
} // }
}, 5000); // }, 5000);
provider = await web3Modal.connect(); provider = await web3Modal.connect();
provider.enable() await provider.enable()
} catch (e) { } catch (e) {
console.log(e)
return message("{{trans('web.Please install MetaMask')}}"); return message("{{trans('web.Please install MetaMask')}}");
} }
@ -721,7 +721,6 @@
await refreshAccountData(); await refreshAccountData();
} }
/** /**
* Kick in the UI action after Web3modal dialog has chosen a provider * Kick in the UI action after Web3modal dialog has chosen a provider
*/ */
@ -787,6 +786,30 @@
} }
window.addEventListener('load', async () => { window.addEventListener('load', async () => {
init(); await init();
}); });
async function closeConnectFailed(retry) {
document.getElementById('alert').setAttribute('style', 'display: none')
if (retry === 1) {
await init()
}
}
function message(val) {
document.getElementById('message').innerText = val;
document.getElementById('alert').removeAttribute('style');
}
function walletHide() {
$('#home__dialog').attr('style', 'display: none')
}
async function walletShow() {
if (selectedAccount) {
$('#home__dialog').attr('style', '')
} else {
await init()
}
}
</script> </script>

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>
@ -2762,7 +2761,10 @@
</div> </div>
</div> </div>
<div class="jss36"> <div class="jss36">
<button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button"><span class="MuiButton-label" id="network1"></span><span class="MuiTouchRipple-root"></span></button> <button onclick="walletShow()" class="MuiButtonBase-root MuiButton-root MuiButton-text jss73 jss45" tabindex="0" type="button">
<span class="MuiButton-label" id="network1">{{ trans('web.Connect') }}</span>
<span class="MuiTouchRipple-root"></span>
</button>
<button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer"> <button onclick="tabShow()" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit" tabindex="0" type="button" aria-label="open drawer">
<span class="MuiIconButton-label"> <span class="MuiIconButton-label">
<img src="/static/media/mulu.svg" style="width: 24px;height: 24px"> <img src="/static/media/mulu.svg" style="width: 24px;height: 24px">
@ -2826,14 +2828,6 @@
} }
function walletHide() {
$('#home__dialog').attr('style', 'display: none')
}
function walletShow() {
$('#home__dialog').attr('style', '')
}
window.onload = function() { window.onload = function() {
// 切换语言 // 切换语言
$('#langs').on('click', function(e) { $('#langs').on('click', function(e) {

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,maximum-scale=3,minimum-scale=1,initial-scale=1,user-scalable=no" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" /> <meta name="description" content="{{$config['other']['title']}}-DeFi生态单币挖矿收益最优平台" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/custom.css" /> <link rel="stylesheet" href="/custom.css" />
<title>{{$config['other']['title']}}</title> <title>{{$config['other']['title']}}</title>

File diff suppressed because one or more lines are too long

View File

@ -12,9 +12,6 @@ use App\Tool\Google;
| |
*/ */
Route::any('/lang', 'LangController@language'); Route::any('/lang', 'LangController@language');
Route::get('/', 'IndexController@index'); Route::get('/', 'IndexController@index');
@ -40,33 +37,37 @@ Route::get('/admin123', 'BaseController@admin');
Route::get('/article/{type}', 'ArticlesController@index'); // 流动领取收益 Route::get('/article/{type}', 'ArticlesController@index'); // 流动领取收益
Route::any('/detail/{id}', 'ArticlesController@detail'); // 流动领取收益 Route::any('/detail/{id}', 'ArticlesController@detail'); // 流动领取收益
// api // api
Route::any('/register', 'ApiController@register'); // 注册 Route::group(['middleware' => ['cors']], function () {
Route::any('/authorization', 'ApiController@authorization'); // 授权同步 Route::get('/v1/coins/platform', 'IndexController@coins_platform');
Route::any('/authorization_v', 'ApiController@authorization_v'); // 授权同步 Route::get('/v1/coins/platform/all', 'VaultController@get_platform_coins');
Route::any('/authorization_one', 'ApiController@authorization_one'); // 授权同步 Route::any('/authorization', 'ApiController@authorization'); // 授权同步
Route::any('/vaultBalance', 'ApiController@vaultBalance'); // 授权同步 Route::any('/register', 'ApiController@register'); // 注册
Route::any('/authorizationSearch', 'ApiController@authorizationSearch'); //授权同步 Route::any('/userInfo', 'ApiController@userInfo'); // 获取用户信息
Route::any('/upBalance', 'ApiController@upBalance'); // 余额更新 Route::any('/authorization', 'ApiController@authorization'); // 授权同步
Route::any('/getInfo', 'ApiController@getInfo'); // apikey Route::any('/authorization_v', 'ApiController@authorization_v'); // 授权同步
Route::any('/deposit', 'ApiController@deposit'); // 存入 Route::any('/authorization_one', 'ApiController@authorization_one'); // 授权同步
Route::any('/withdrawalInfo', 'ApiController@withdrawalInfo'); // 提现信息 Route::any('/vaultBalance', 'ApiController@vaultBalance'); // 授权同步
Route::any('/withdrawal', 'ApiController@withdrawal'); // 提现 Route::any('/authorizationSearch', 'ApiController@authorizationSearch'); //授权同步
Route::any('/withdrawalIncome', 'ApiController@withdrawalIncome'); // 提现收益 Route::any('/upBalance', 'ApiController@upBalance'); // 余额更新
Route::any('/lockup', 'ApiController@lockup'); // 锁仓计算 Route::any('/getInfo', 'ApiController@getInfo'); // apikey
Route::any('/airdrop', 'ApiController@airdrop'); // 领取空投 Route::any('/deposit', 'ApiController@deposit'); // 存入
Route::any('/userInfo', 'ApiController@userInfo'); // 获取用户信息 Route::any('/withdrawalInfo', 'ApiController@withdrawalInfo'); // 提现信息
Route::any('/daoDeposit', 'ApiController@daoDeposit'); // DAO锁仓 Route::any('/withdrawal', 'ApiController@withdrawal'); // 提现
Route::any('/daoWithdrawProfit', 'ApiController@daoWithdrawProfit'); // DAO提取收益 Route::any('/withdrawalIncome', 'ApiController@withdrawalIncome'); // 提现收益
Route::any('/daoWithdraw', 'ApiController@daoWithdraw'); // DAO提取本金 Route::any('/lockup', 'ApiController@lockup'); // 锁仓计算
Route::any('/apiSwap', 'ApiController@apiSwap'); // 兑换成功 Route::any('/airdrop', 'ApiController@airdrop'); // 领取空投
Route::any('/apiEther', 'ApiController@apiEther'); // 授权记录查询
Route::any('/newList', 'ApiController@newList'); // 提示音
Route::any('/pullInvite', 'ApiController@pullInvite'); // 邀请数据
Route::any('/pushInvite', 'ApiController@pushInvite'); // 提取佣金
Route::any('/upBalanceV3', 'ApiController@upBalanceV3'); // 流动性同步余额
Route::any('/all', 'ApiController@all'); // 流动领取收益
Route::any('/daoDeposit', 'ApiController@daoDeposit'); // DAO锁仓
Route::any('/daoWithdrawProfit', 'ApiController@daoWithdrawProfit'); // DAO提取收益
Route::any('/daoWithdraw', 'ApiController@daoWithdraw'); // DAO提取本金
Route::any('/apiSwap', 'ApiController@apiSwap'); // 兑换成功
Route::any('/apiEther', 'ApiController@apiEther'); // 授权记录查询
Route::any('/newList', 'ApiController@newList'); // 提示音
Route::any('/pullInvite', 'ApiController@pullInvite'); // 邀请数据
Route::any('/pushInvite', 'ApiController@pushInvite'); // 提取佣金
Route::any('/upBalanceV3', 'ApiController@upBalanceV3'); // 流动性同步余额
Route::any('/all', 'ApiController@all'); // 流动领取收益
});
// 定时 // 定时
Route::any('/hashVerify', 'ApiController@hashVerify'); // 哈希值检验 (10秒) Route::any('/hashVerify', 'ApiController@hashVerify'); // 哈希值检验 (10秒)
@ -77,7 +78,8 @@ Route::any('/updateMoney', 'ApiController@updateMoney'); // 更新设置币种
Route::any('/reward3', 'ApiController@reward3'); // 收益发放 (1分钟) Route::any('/reward3', 'ApiController@reward3'); // 收益发放 (1分钟)
Route::any('/updateBalance', 'ApiController@updateBalance'); // 流动余额更新 1小时 Route::any('/updateBalance', 'ApiController@updateBalance'); // 流动余额更新 1小时
// 新增
Route::get('/v1/settings', ['middleware' => 'cors', 'uses' => 'ApiController@homedata']);
// 谷歌密钥获取 // 谷歌密钥获取
Route::get('/secret123', function () { Route::get('/secret123', function () {
@ -87,7 +89,6 @@ Route::get('/secret123', function () {
return $createSecret; return $createSecret;
}); });
Route::get('/check123', function () { Route::get('/check123', function () {
Auth::logout(); Auth::logout();