【程序目录】增加获取系统当前版本号

This commit is contained in:
evoxwht 2022-06-20 14:29:52 +08:00
parent 8e1325bf9e
commit 817f304692
2 changed files with 19 additions and 0 deletions

View File

@ -44,4 +44,21 @@ class PublicController
{
return app('json')->success(getWorkerManUrl());
}
/**
* 获取当前系统版本
* @return array
*/
public function getVersion()
{
$version_arr = [];
$curent_version = @file(app()->getRootPath() . '.version');
foreach ($curent_version as $val) {
list($k, $v) = explode('=', $val);
$version_arr[$k] = $v;
}
return app('json')->success($version_arr);
}
}

View File

@ -30,6 +30,8 @@ Route::group(function () {
Route::get('captcha_pro', 'Login/captcha')->name('')->option(['real_name' => '获取验证码']);
//获取客服数据
Route::get('get_workerman_url', 'PublicController/getWorkerManUrl')->option(['real_name' => '获取客服数据']);
//获取系统当前版本号
Route::get('get_version', 'PublicController/getVersion')->option(['real_name' => '获取系统当前版本号']);
//测试
Route::get('index', 'Test/index')->option(['real_name' => '测试地址']);
})->middleware(AllowOriginMiddleware::class);