修改原有框架中英文映射
This commit is contained in:
@@ -25,7 +25,7 @@ class InstallController extends BaseController
|
||||
{
|
||||
parent::__construct();
|
||||
if ($this->adminId > 1) {
|
||||
throw new ApiException('仅超级管理员能够操作');
|
||||
throw new ApiException('Only super admin can perform this action');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,17 +105,17 @@ class InstallController extends BaseController
|
||||
{
|
||||
$spl_file = current($request->file());
|
||||
if (!$spl_file->isValid()) {
|
||||
return $this->fail('上传文件校验失败');
|
||||
return $this->fail('upload file validation failed');
|
||||
}
|
||||
$config = config('plugin.saipackage.upload', [
|
||||
'size' => 1024 * 1024 * 5,
|
||||
'type' => ['zip']
|
||||
]);
|
||||
if (!in_array($spl_file->getUploadExtension(), $config['type'])) {
|
||||
return $this->fail('文件格式上传失败,请选择zip格式文件上传');
|
||||
return $this->fail('upload failed, please upload zip file');
|
||||
}
|
||||
if ($spl_file->getSize() > $config['size']) {
|
||||
return $this->fail('文件大小不能超过5M');
|
||||
return $this->fail('file size cannot exceed 5M');
|
||||
}
|
||||
$install = new InstallLogic();
|
||||
$info = $install->upload($spl_file);
|
||||
@@ -132,7 +132,7 @@ class InstallController extends BaseController
|
||||
{
|
||||
$appName = $request->post("appName", '');
|
||||
if (empty($appName)) {
|
||||
return $this->fail('参数错误');
|
||||
return $this->fail('Invalid parameters');
|
||||
}
|
||||
$install = new InstallLogic($appName);
|
||||
$info = $install->install();
|
||||
@@ -150,12 +150,12 @@ class InstallController extends BaseController
|
||||
{
|
||||
$appName = $request->post("appName", '');
|
||||
if (empty($appName)) {
|
||||
return $this->fail('参数错误');
|
||||
return $this->fail('Invalid parameters');
|
||||
}
|
||||
$install = new InstallLogic($appName);
|
||||
$install->uninstall();
|
||||
UserMenuCache::clearMenuCache();
|
||||
return $this->success('卸载插件成功');
|
||||
return $this->success('uninstall plugin success');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +167,7 @@ class InstallController extends BaseController
|
||||
{
|
||||
Server::restart();
|
||||
|
||||
return $this->success('重载成功');
|
||||
return $this->success('reload success');
|
||||
}
|
||||
|
||||
// ========== 商店代理接口 ==========
|
||||
@@ -278,7 +278,7 @@ class InstallController extends BaseController
|
||||
{
|
||||
$token = $request->input('token');
|
||||
if (empty($token)) {
|
||||
return $this->fail('未登录');
|
||||
return $this->fail('not logged in');
|
||||
}
|
||||
|
||||
$result = $this->proxyRequest(
|
||||
@@ -299,7 +299,7 @@ class InstallController extends BaseController
|
||||
{
|
||||
$token = $request->input('token');
|
||||
if (empty($token)) {
|
||||
return $this->fail('未登录');
|
||||
return $this->fail('not logged in');
|
||||
}
|
||||
|
||||
$result = $this->proxyRequest(
|
||||
@@ -322,7 +322,7 @@ class InstallController extends BaseController
|
||||
$appId = $request->input('app_id');
|
||||
|
||||
if (empty($token)) {
|
||||
return $this->fail('未登录');
|
||||
return $this->fail('not logged in');
|
||||
}
|
||||
|
||||
$result = $this->proxyRequest(
|
||||
@@ -345,11 +345,11 @@ class InstallController extends BaseController
|
||||
$versionId = $request->input('id');
|
||||
|
||||
if (empty($token)) {
|
||||
return $this->fail('未登录');
|
||||
return $this->fail('not logged in');
|
||||
}
|
||||
|
||||
if (empty($versionId)) {
|
||||
return $this->fail('版本ID不能为空');
|
||||
return $this->fail('version id is required');
|
||||
}
|
||||
|
||||
$result = $this->proxyRequest(
|
||||
@@ -365,7 +365,7 @@ class InstallController extends BaseController
|
||||
}
|
||||
|
||||
if (!isset($result['raw'])) {
|
||||
return $this->fail('下载失败');
|
||||
return $this->fail('download failed');
|
||||
}
|
||||
|
||||
// 保存临时 zip 文件
|
||||
@@ -380,7 +380,7 @@ class InstallController extends BaseController
|
||||
$install = new InstallLogic();
|
||||
$info = $install->uploadFromPath($tempZip);
|
||||
|
||||
return $this->success($info, '下载成功,请在插件列表中安装');
|
||||
return $this->success($info, 'download success, please install in plugin list');
|
||||
} catch (Throwable $e) {
|
||||
@unlink($tempZip);
|
||||
return $this->fail($e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user