feature: i18n

This commit is contained in:
Tokumeikoi 2020-10-13 23:55:17 +08:00
parent c984fa2e0b
commit 393680c963
14 changed files with 19 additions and 11 deletions

View File

@ -73,10 +73,12 @@ class ShadowsocksTidalabController extends Controller
Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_ONLINE_USER', $server->id), count($data), 3600);
$serverService = new ServerService();
$userService = new UserService();
DB::beginTransaction();
foreach ($data as $item) {
$u = $item['u'] * $server->rate;
$d = $item['d'] * $server->rate;
if (!$userService->trafficFetch((float)$u, (float)$d, (int)$item['user_id'])) {
DB::rollBack();
return response([
'ret' => 0,
'msg' => 'user fetch fail'
@ -92,6 +94,7 @@ class ShadowsocksTidalabController extends Controller
'trojan'
);
}
DB::commit();
return response([
'ret' => 1,

View File

@ -74,10 +74,12 @@ class TrojanTidalabController extends Controller
Cache::put(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server->id), count($data), 3600);
$serverService = new ServerService();
$userService = new UserService();
DB::beginTransaction();
foreach ($data as $item) {
$u = $item['u'] * $server->rate;
$d = $item['d'] * $server->rate;
if (!$userService->trafficFetch($u, $d, $item['user_id'])) {
DB::rollBack();
return response([
'ret' => 0,
'msg' => 'user fetch fail'
@ -93,6 +95,7 @@ class TrojanTidalabController extends Controller
'trojan'
);
}
DB::commit();
return response([
'ret' => 1,

View File

@ -80,7 +80,7 @@ class UserService
{
$user = User::find($userId);
if (!$user) {
return false;
return true;
}
$user->t = time();
$user->u = $user->u + $u;

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

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" href="/assets/admin/antd.chunk.css?v={{$verison}}">
<link rel="stylesheet" href="/assets/admin/components.chunk.css?v={{$verison}}">
<link rel="stylesheet" href="/assets/admin/umi.css?v={{$verison}}">
<link rel="stylesheet" href="/assets/admin/custom.css?v={{$verison}}">
<meta charset="utf-8">
@ -27,7 +27,7 @@
<body>
<div id="root"></div>
<script src="/assets/admin/vendors.async.js?v={{$verison}}"></script>
<script src="/assets/admin/antd.async.js?v={{$verison}}"></script>
<script src="/assets/admin/components.async.js?v={{$verison}}"></script>
<script src="/assets/admin/umi.js?v={{$verison}}"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-P1E9Z5LRRK"></script>

View File

@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" href="/assets/user/antd.chunk.css?v={{$verison}}">
<link rel="stylesheet" href="/assets/user/components.chunk.css?v={{$verison}}">
<link rel="stylesheet" href="/assets/user/umi.css?v={{$verison}}">
<link rel="stylesheet" href="/assets/user/custom.css?v={{$verison}}">
<meta charset="utf-8">
@ -28,7 +28,7 @@
<body>
<div id="root"></div>
<script src="/assets/user/vendors.async.js?v={{$verison}}"></script>
<script src="/assets/user/antd.async.js?v={{$verison}}"></script>
<script src="/assets/user/components.async.js?v={{$verison}}"></script>
<script src="/assets/user/umi.js?v={{$verison}}"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-P1E9Z5LRRK"></script>