优化获取版本号

This commit is contained in:
evoxwht 2023-06-21 15:45:35 +08:00
parent c16f4fccbf
commit b17ac4b581
2 changed files with 3 additions and 2 deletions

View File

@ -643,7 +643,8 @@ class PublicController
*/
public function getVersion()
{
return app('json')->success(['version' => get_crmeb_version()]);
$version = parse_ini_file(app()->getRootPath() . '.version');
return app('json')->success(['version' => $version['version'], 'version_code' => $version['version_code']]);
}
/**

View File

@ -21,7 +21,7 @@ Route::group(function () {
Route::any('order_call_back', 'v1.order.StoreOrderController/callBack')->option(['real_name' => '商家寄件回调']);//商家寄件回调
Route::get('get_script', 'v1.PublicController/getScript')->option(['real_name' => '获取统计代码']);//获取统计代码
Route::get('version', 'v1.PublicController/getVersion')->option(['real_name' => '获取代码版本号']);
})->option(['mark' => 'serve', 'mark_name' => '服务接口']);
})->middleware(\app\http\middleware\AllowOriginMiddleware::class)->option(['mark' => 'serve', 'mark_name' => '服务接口']);
Route::group(function () {
//apple快捷登陆