update: app version

This commit is contained in:
Tokumeikoi 2020-11-19 21:21:21 +08:00
parent 732edcad57
commit 7a9527d48a
4 changed files with 42 additions and 7 deletions

View File

@ -132,6 +132,14 @@ class ConfigController extends Controller
'telegram' => [
'telegram_bot_enable' => config('v2board.telegram_bot_enable', 0),
'telegram_bot_token' => config('v2board.telegram_bot_token')
],
'app' => [
'windows_version' => config('v2board.window_version'),
'windows_download_url' => config('v2board.windows_download_url'),
'macos_version' => config('v2board.macos_version'),
'macos_download_url' => config('v2board.macos_download_url'),
'android_version' => config('v2board.android_version'),
'android_download_url' => config('v2board.android_download_url')
]
]
]);

View File

@ -51,14 +51,34 @@ class AppController extends Controller
die(Yaml::dump($config));
}
public function getVersion()
public function getVersion(Request $request)
{
if (strpos($request->header('user-agent'), 'tunnelab/4.0.0') !== -1) {
if (strpos($request->header('user-agent'), 'Win64') !== -1) {
return response([
'data' => [
'version' => config('v2board.windows_version'),
'download_url' => config('v2board.windows_download_url')
]
]);
} else {
return response([
'data' => [
'version' => config('v2board.macos_version'),
'download_url' => config('v2board.macos_download_url')
]
]);
}
return;
}
return response([
'data' => [
'version' => '4.0.0',
'download_url' => '',
'android_version' => '4.0.0',
'android_download_url' => ''
'windows_version' => config('v2board.windows_version'),
'windows_download_url' => config('v2board.windows_download_url'),
'macos_version' => config('v2board.macos_version'),
'macos_download_url' => config('v2board.macos_download_url'),
'android_version' => config('v2board.android_version'),
'android_download_url' => config('v2board.android_download_url')
]
]);
}

View File

@ -100,7 +100,14 @@ class ConfigSave extends FormRequest
'telegram_bot_enable' => 'in:0,1',
'telegram_bot_token' => '',
'telegram_discuss_id' => '',
'telegram_channel_id' => ''
'telegram_channel_id' => '',
// app
'windows_version' => '',
'windows_download_url' => '',
'macos_version' => '',
'macos_download_url' => '',
'android_version' => '',
'android_download_url' => ''
];
}

View File

@ -5,7 +5,7 @@ namespace App\Utils;
class CacheKey
{
CONST KEYS = [
'EMAIL_VERIFY_CODE' => '邮箱验证',
'EMAIL_VERIFY_CODE' => '邮箱验证',
'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
'SERVER_V2RAY_ONLINE_USER' => '节点在线用户',
'SERVER_V2RAY_LAST_CHECK_AT' => '节点最后检查时间',