mirror of
https://github.com/lsky-org/lsky-pro.git
synced 2025-01-08 11:57:52 +08:00
✨ Add Multilingualism. Closed #145
This commit is contained in:
parent
c09bece154
commit
d09d57dbe1
@ -28,7 +28,7 @@ class Image extends Base
|
||||
{
|
||||
$id = $this->request->post('id');
|
||||
if (!$image = $this->model->where('id', $id)->find()) {
|
||||
$this->response('未找到该图片数据', [], 500);
|
||||
$this->response(lang('The picture data was not found'), [], 500);
|
||||
}
|
||||
$this->response('success', $this->parseData($image));
|
||||
}
|
||||
@ -56,9 +56,9 @@ class Image extends Base
|
||||
$data = explode(',', $data);
|
||||
}
|
||||
if ($user->deleteImages($data)) {
|
||||
$this->response('删除成功!');
|
||||
$this->response(lang('Delete succeeded!'));
|
||||
}
|
||||
$this->response('删除失败!', [], 500);
|
||||
$this->response(lang('Deletion failed!'), [], 500);
|
||||
}
|
||||
|
||||
private function parseData($data)
|
||||
|
@ -17,16 +17,16 @@ class Token extends Base
|
||||
$user = null;
|
||||
try {
|
||||
if (!$user = Users::get(['email' => $email])) {
|
||||
throw new Exception('账号不存在');
|
||||
throw new Exception(lang('Account does not exist'));
|
||||
}
|
||||
if ($user->password != md5($password)) {
|
||||
throw new Exception('账号密码错误');
|
||||
throw new Exception(lang('Account password error'));
|
||||
}
|
||||
if ('true' == $refresh) {
|
||||
$token = make_token();
|
||||
$user->token = $token;
|
||||
if (!$user->save()) {
|
||||
throw new Exception('Token 刷新失败');
|
||||
throw new Exception(lang('Token refresh failed'));
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
@ -20,7 +20,7 @@ class Upload extends Base
|
||||
|
||||
// 是否允许游客上传
|
||||
if (!$this->getConfig('allowed_tourist_upload') && !request()->user) {
|
||||
$this->response('管理员关闭了游客上传通道');
|
||||
$this->response(lang('The administrator closed the tourist upload channel'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ class Upload extends Controller
|
||||
public function exec()
|
||||
{
|
||||
if (!$this->configs['allowed_tourist_upload'] && !$this->user) {
|
||||
throw new Exception('管理员关闭了游客上传!');
|
||||
throw new Exception(lang('The administrator turned off the tourist upload!'));
|
||||
}
|
||||
|
||||
$sameIpDayMaxUploadCount = $this->getConfig('same_ip_day_max_upload');
|
||||
@ -81,7 +81,7 @@ class Upload extends Controller
|
||||
$ipUploadCount = Images::where('ip', '=', request()->ip())->where('create_time', '>=', $startTimestamp)
|
||||
->count();
|
||||
if ($ipUploadCount >= $sameIpDayMaxUploadCount) {
|
||||
throw new Exception('今日图片上传数量已达到上限');
|
||||
throw new Exception(lang('The number of pictures uploaded today has reached the maximum'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,11 +93,11 @@ class Upload extends Controller
|
||||
|
||||
if ($this->user) {
|
||||
if (($this->user->use_quota + $size) > $this->user->quota) {
|
||||
throw new Exception('保存失败!您的储存容量不足,请联系管理员!');
|
||||
throw new Exception(lang('Save failed! Your storage capacity is insufficient, please contact the administrator!'));
|
||||
}
|
||||
|
||||
if (!$this->user->state) {
|
||||
throw new Exception('你的账号被冻结,请联系管理员!');
|
||||
throw new Exception(lang('Your account is frozen, please contact the administrator!'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ class Upload extends Controller
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new Exception('自动水印功能配置异常');
|
||||
throw new Exception(lang('Abnormal configuration of automatic watermark function'));
|
||||
}
|
||||
$watermark->save($watermarkImage);
|
||||
$temp = $watermarkImage;
|
||||
@ -166,7 +166,7 @@ class Upload extends Controller
|
||||
if (Config::get('app.app_debug')) {
|
||||
throw new Exception($this->strategy->getError());
|
||||
}
|
||||
throw new Exception('上传失败,请检查策略配置是否正确!');
|
||||
throw new Exception(lang('Upload failed. Please check whether the policy configuration is correct!'));
|
||||
}
|
||||
|
||||
isset($watermarkImage) && @unlink($watermarkImage);
|
||||
@ -185,7 +185,7 @@ class Upload extends Controller
|
||||
// 是否直接拦截色情图片
|
||||
if (Config::get('system.intercept_salacity')) {
|
||||
$this->strategy->delete($pathname);
|
||||
throw new Exception('图片[' . $image->getInfo('name') . ']涉嫌违规,禁止上传!');
|
||||
throw new Exception(lang('The picture %s is suspected of violation. Uploading is prohibited!', [$image->getInfo('name')]));
|
||||
}
|
||||
$suspicious = 1;
|
||||
}
|
||||
@ -218,7 +218,7 @@ class Upload extends Controller
|
||||
'parent_id' => 0,
|
||||
'name' => $this->user->default_folder
|
||||
])) {
|
||||
throw new Exception('文件夹创建失败!');
|
||||
throw new Exception(lang('Folder creation failed!'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ class Upload extends Controller
|
||||
|
||||
if (!$model = Images::create($imageData)) {
|
||||
$this->strategy->delete($pathname);
|
||||
throw new Exception('图片数据保存失败');
|
||||
throw new Exception(lang('Failed to save picture data'));
|
||||
}
|
||||
|
||||
$data = [
|
||||
@ -258,7 +258,7 @@ class Upload extends Controller
|
||||
{
|
||||
$image = $this->request->file('image');
|
||||
if (null === $image) {
|
||||
throw new Exception('图片资源获取失败');
|
||||
throw new Exception(lang('Picture resource acquisition failed'));
|
||||
}
|
||||
if (!is_uploaded_file($image->getPathname())) {
|
||||
throw new Exception('file is not uploaded via HTTP POST');
|
||||
|
@ -54,23 +54,23 @@ class Users extends Model
|
||||
public static function login($account, $password, $field = 'email')
|
||||
{
|
||||
if (!$account) {
|
||||
throw new Exception('请输入账号');
|
||||
throw new Exception(lang('Please enter the account number'));
|
||||
}
|
||||
|
||||
if (!$password) {
|
||||
throw new Exception('请输入密码');
|
||||
throw new Exception(lang('Please input a password'));
|
||||
}
|
||||
|
||||
if ($user = self::get([$field => $account])) {
|
||||
if (0 === $user->state) {
|
||||
throw new Exception('你的账户已被冻结,请联系管理员!');
|
||||
throw new Exception(lang('Your account has been frozen, please contact the administrator!'));
|
||||
}
|
||||
if ($user->password !== md5($password)) {
|
||||
throw new Exception('密码不正确');
|
||||
throw new Exception(lang('Incorrect password'));
|
||||
}
|
||||
Session::set('uid', $user->id);
|
||||
} else {
|
||||
throw new Exception('用户不存在');
|
||||
throw new Exception(lang('User does not exist'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ trait Core
|
||||
{
|
||||
$configs = [];
|
||||
$data = \app\common\model\Config::all();
|
||||
foreach ($data as $key => &$value) {
|
||||
foreach ($data as &$value) {
|
||||
$configs[$value->name] = $value->value;
|
||||
}
|
||||
if ($name) {
|
||||
@ -63,7 +63,7 @@ trait Core
|
||||
'msg' => $msg,
|
||||
'data' => $data ?: new \stdClass(),
|
||||
'time' => time()
|
||||
], $type, 200);
|
||||
], $type);
|
||||
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
@ -18,11 +18,11 @@ class Folders extends Validate
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'parent_id.require' => '没有找到上级文件夹',
|
||||
'parent_id.number' => '上级文件夹异常',
|
||||
'parent_id.integer' => '上级文件夹异常',
|
||||
'name.require' => '文件夹名称不能为空',
|
||||
'name.max' => '文件夹名称长度最大30个字符',
|
||||
'name.chsAlphaNum' => '文件夹名称只能是汉字、字母和数字'
|
||||
'parent_id.require' => '{%Parent folder not found}',
|
||||
'parent_id.number' => '{%Parent folder exception}',
|
||||
'parent_id.integer' => '{%Parent folder exception}',
|
||||
'name.require' => '{%Folder name cannot be empty}',
|
||||
'name.max' => '{%Folder name length max. 30 characters}',
|
||||
'name.chsAlphaNum' => '{%Folder names can only be Chinese characters, letters and numbers}'
|
||||
];
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ class Group extends Validate
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'name.require' => '角色组名称不能为空',
|
||||
'name.max' => '角色组名称长度最大30个字符',
|
||||
'name.chsAlphaNum' => '角色组名称只能是汉字、字母和数字'
|
||||
'name.require' => '{%Role group name cannot be empty}',
|
||||
'name.max' => '{%The maximum length of the role group name is 30 characters}',
|
||||
'name.chsAlphaNum' => '{%The role group name can only be Chinese characters, letters and numbers}'
|
||||
];
|
||||
}
|
||||
|
@ -22,20 +22,20 @@ class Users extends Validate
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'username.require' => '用户名不能为空',
|
||||
'username.max' => '用户名字符长度超出',
|
||||
'username.unique' => '用户名已存在,请更换',
|
||||
'nickname.max' => '昵称字符长度超出',
|
||||
'default_folder.max' => '默认上传文件夹名称长度超出',
|
||||
'default_folder.chsAlphaNum'=> '默认上传文件夹名称只能是汉字、字母和数字',
|
||||
'email.require' => '邮箱不能为空',
|
||||
'email.email' => '邮箱格式不正确',
|
||||
'email.max' => '邮箱字符长度超出',
|
||||
'email.unique' => '邮箱已存在',
|
||||
'password.require' => '密码不能为空',
|
||||
'password.confirm' => '两次输入的密码不一致',
|
||||
'captcha.require' => '请输入验证码',
|
||||
'captcha.captcha' => '验证码错误',
|
||||
'username.require' => '{%User name cannot be empty}',
|
||||
'username.max' => '{%The user name character length exceeds the limit}',
|
||||
'username.unique' => '{%User name already exists, please replace}',
|
||||
'nickname.max' => '{%The length of nickname characters exceeds the limit}',
|
||||
'default_folder.max' => '{%Default upload folder name length exceeds limit}',
|
||||
'default_folder.chsAlphaNum'=> '{%The default upload folder name can only be Chinese characters, letters and numbers}',
|
||||
'email.require' => '{%Mailbox cannot be empty}',
|
||||
'email.email' => '{%The mailbox format is incorrect}',
|
||||
'email.max' => '{%Mailbox character length exceeds the limit}',
|
||||
'email.unique' => '{%Mailbox already exists}',
|
||||
'password.require' => '{%Password cannot be empty}',
|
||||
'password.confirm' => '{%The passwords entered twice are inconsistent}',
|
||||
'captcha.require' => '{%Please enter the verification code}',
|
||||
'captcha.captcha' => '{%Verification code error}',
|
||||
];
|
||||
|
||||
public function sceneEdit()
|
||||
|
@ -23,19 +23,19 @@ class ApiAuthenticate
|
||||
public function handle(Request $request, \Closure $next)
|
||||
{
|
||||
if (!$this->getConfig('open_api')) { // 站点是否开启了接口
|
||||
$this->response('管理员关闭了接口', [], 500);
|
||||
$this->response(lang('The administrator turned off API functionality'), [], 500);
|
||||
}
|
||||
|
||||
$user = null;
|
||||
$token = $request->header('token', $request->request('token'));
|
||||
if ($token) {
|
||||
if (!$user = Users::get(['token' => $token])) {
|
||||
$this->response('认证失败', [], 401);
|
||||
$this->response(lang('Authentication failed'), [], 401);
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($request->path(), $this->paths)) {
|
||||
if (!$token) $this->response('Token 不存在', [], 401);
|
||||
if (!$token) $this->response(lang('Token does not exist'), [], 401);
|
||||
}
|
||||
|
||||
$request->user = $user;
|
||||
|
@ -33,7 +33,7 @@ class Auth extends Base
|
||||
if ($this->request->isPost()) {
|
||||
try {
|
||||
if ($this->getConfig('close_register')) {
|
||||
throw new Exception('站点已关闭注册');
|
||||
throw new Exception(lang('Site registration closed'));
|
||||
}
|
||||
$data = $this->request->post();
|
||||
$validate = $this->validate($data, 'Users');
|
||||
@ -45,7 +45,7 @@ class Auth extends Base
|
||||
Session::flash('error', $e->getMessage());
|
||||
return $this->fetch();
|
||||
}
|
||||
Session::flash('success', '注册成功');
|
||||
Session::flash('success', lang('Registration successful'));
|
||||
$this->redirect(url('auth/login'));
|
||||
}
|
||||
return $this->fetch();
|
||||
@ -61,16 +61,16 @@ class Auth extends Base
|
||||
try {
|
||||
$data = $this->request->post();
|
||||
$validate = $this->validate($data, [
|
||||
'password|密码' => 'require|confirm',
|
||||
'password|'.lang('Password') => 'require|confirm',
|
||||
]);
|
||||
if (true !== $validate) {
|
||||
$this->error($validate);
|
||||
}
|
||||
if ($data['code'] != Session::get('code', 'forgot_')) {
|
||||
throw new Exception('验证码不正确');
|
||||
throw new Exception(lang('Incorrect verification code'));
|
||||
}
|
||||
if (!$user = Users::get(['email' => Session::get('email', 'forgot_')])) {
|
||||
throw new Exception('用户不存在');
|
||||
throw new Exception(lang('User does not exist'));
|
||||
}
|
||||
$user->password = $data['password'];
|
||||
$user->save();
|
||||
@ -78,7 +78,7 @@ class Auth extends Base
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$delSession();
|
||||
$this->success('重置成功');
|
||||
$this->success(lang('Reset successful'));
|
||||
}
|
||||
$delSession();
|
||||
return $this->fetch();
|
||||
@ -89,19 +89,23 @@ class Auth extends Base
|
||||
if ($this->request->isPost()) {
|
||||
$data = $this->request->post();
|
||||
$validate = $this->validate($data, [
|
||||
'email|邮箱' => 'require|email',
|
||||
'captcha|验证码' => 'require|captcha'
|
||||
'email|'.lang('Mailbox') => 'require|email',
|
||||
'captcha|'.lang('Verification Code') => 'require|captcha'
|
||||
]);
|
||||
if (true !== $validate) {
|
||||
$this->error($validate);
|
||||
}
|
||||
|
||||
if (!$user = Users::get(['email' => $data['email']])) {
|
||||
$this->error('账号不存在');
|
||||
$this->error(lang('Account does not exist'));
|
||||
}
|
||||
|
||||
$code = generate_code();
|
||||
$err = $this->sendMail($data['email'], '找回密码', "尊敬的 {$user->username}, 您好,您正在申请重置密码操作,本次的验证码是 <b>{$code}</b>,如果不是您本人操作请忽略!");
|
||||
$err = $this->sendMail(
|
||||
$data['email'],
|
||||
lang('Retrieve password'),
|
||||
lang('Retrieve password mail content', [$user->username, $code])
|
||||
);
|
||||
|
||||
if (true !== $err) {
|
||||
$this->error($err);
|
||||
@ -109,7 +113,7 @@ class Auth extends Base
|
||||
|
||||
Session::set('code', $code, 'forgot_');
|
||||
Session::set('email', $data['email'], 'forgot_');
|
||||
$this->success('发送成功');
|
||||
$this->success(lang('Sent successfully'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class Index extends Base
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('欢迎回来');
|
||||
$this->success(lang('Welcome back'));
|
||||
}
|
||||
return view('index/home');
|
||||
}
|
||||
@ -40,7 +40,7 @@ class Index extends Base
|
||||
public function gallery()
|
||||
{
|
||||
if (!$this->getConfig('open_gallery')) {
|
||||
abort(404, "画廊功能已关闭");
|
||||
abort(404, lang('Gallery feature is off'));
|
||||
}
|
||||
$images = [];
|
||||
Images::order('id', 'desc')
|
||||
@ -62,7 +62,7 @@ class Index extends Base
|
||||
public function api()
|
||||
{
|
||||
if (!$this->getConfig('open_api')) {
|
||||
abort(404, "API 接口已关闭");
|
||||
abort(404, lang('API interface closed'));
|
||||
}
|
||||
$this->assign('domain', $this->request->domain());
|
||||
return $this->fetch();
|
||||
|
@ -19,7 +19,7 @@ class Install extends Controller
|
||||
{
|
||||
// 检测是否已安装
|
||||
if (file_exists(app()->getAppPath() . 'install.lock') && !Session::has('install_success')) {
|
||||
exit('你已安装成功,需要重新安装请删除 install.lock 文件');
|
||||
exit(lang('Installed tips'));
|
||||
}
|
||||
|
||||
$phpVerGt56 = PHP_VERSION >= 5.6;
|
||||
@ -53,7 +53,7 @@ class Install extends Controller
|
||||
try {
|
||||
$installSql = app()->getAppPath() . 'sql/install.sql';
|
||||
if (!is_file($installSql)) {
|
||||
throw new Exception('数据库 SQL 文件不存在');
|
||||
throw new Exception(lang('The database SQL file does not exist'));
|
||||
}
|
||||
$db = Db::connect(array_merge(\config('database.'), [
|
||||
'hostname' => $hostname,
|
||||
@ -88,7 +88,7 @@ class Install extends Controller
|
||||
} catch (\PDOException $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('数据写入成功');
|
||||
$this->success(lang('Data written successfully'));
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@ -102,7 +102,7 @@ class Install extends Controller
|
||||
$data['update_time'] = time();
|
||||
$data['create_time'] = time();
|
||||
if ($data['password'] != $data['password_confirm']) {
|
||||
throw new Exception('两次输入的密码不一致!');
|
||||
throw new Exception(lang('The passwords entered twice are inconsistent!'));
|
||||
}
|
||||
$data['password'] = md5($data['password']);
|
||||
$data['reg_ip'] = request()->ip();
|
||||
@ -119,7 +119,7 @@ class Install extends Controller
|
||||
'{hostport}',
|
||||
], $config, @file_get_contents(app()->getRootPath() . '.env.example'));
|
||||
if (!@file_put_contents(app()->getRootPath() . '.env', $env)) {
|
||||
throw new \Exception('配置文件写入失败');
|
||||
throw new \Exception(lang('Configuration file write failed'));
|
||||
}
|
||||
|
||||
$db = Db::connect(array_merge(\config('database.'), $config));
|
||||
@ -128,7 +128,7 @@ class Install extends Controller
|
||||
|
||||
// 创建安装锁文件
|
||||
if (!@fopen(app()->getAppPath() . 'install.lock', 'w')) {
|
||||
throw new \Exception('安装锁文件创建失败');
|
||||
throw new \Exception(lang('Setup lock file creation failed'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@unlink(app()->getAppPath() . 'install.lock');
|
||||
@ -143,7 +143,7 @@ class Install extends Controller
|
||||
Session::flash('install_success', true);
|
||||
// 删除session
|
||||
Session::delete('db');
|
||||
$this->success('设置成功');
|
||||
$this->success(lang('Set successfully'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -33,6 +33,6 @@ class Upload extends Base
|
||||
return json(['error' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
$this->result($data, 200, '上传成功');
|
||||
$this->result($data, 200, lang('Upload succeeded'));
|
||||
}
|
||||
}
|
||||
|
@ -71,11 +71,11 @@ class User extends Base
|
||||
foreach ($deletes as $key => $val) {
|
||||
if (1 === count($val)) {
|
||||
if (!$strategy[$key]->delete(isset($val[0]) ? $val[0] : null)) {
|
||||
// throw new Exception('删除失败');
|
||||
// throw new Exception(lang('Deletion failed'));
|
||||
}
|
||||
} else {
|
||||
if (!$strategy[$key]->deletes($val)) {
|
||||
// throw new Exception('批量删除失败');
|
||||
// throw new Exception(lang('Batch deletion failed'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -91,7 +91,7 @@ class User extends Base
|
||||
if ($deleteId) {
|
||||
return true;
|
||||
}
|
||||
$this->success('删除成功');
|
||||
$this->success(lang('Delete succeeded'));
|
||||
}
|
||||
|
||||
public function createFolder()
|
||||
@ -113,7 +113,7 @@ class User extends Base
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('创建成功');
|
||||
$this->success(lang('Created successfully'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ class User extends Base
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('删除成功');
|
||||
$this->success(lang('Delete succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,11 +151,11 @@ class User extends Base
|
||||
$count = $this->user->folders()->where('id', $folderId)->count();
|
||||
if ($count || $folderId == 0) {
|
||||
if (Images::where('id', 'in', $ids)->setField('folder_id', $folderId)) {
|
||||
$this->success('移动成功');
|
||||
$this->success(lang('Move succeeded'));
|
||||
}
|
||||
$this->error('移动失败');
|
||||
$this->error(lang('Move failed'));
|
||||
} else {
|
||||
$this->error('该文件夹不存在!');
|
||||
$this->error(lang('The folder does not exist!'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -184,7 +184,7 @@ class User extends Base
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('重命名成功');
|
||||
$this->success(lang('Rename succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,17 +195,17 @@ class User extends Base
|
||||
$id = $this->request->post('id');
|
||||
$name = $this->request->post('name');
|
||||
|
||||
$validate = Validate::make(['name|别名' => 'require|max:60|chsDash']);
|
||||
$validate = Validate::make(['name|'.lang('Alias') => 'require|max:60|chsDash']);
|
||||
if (!$validate->check(['name' => $name])) {
|
||||
throw new \Exception($validate->getError());
|
||||
}
|
||||
if (!$this->user->images()->where('id', $id)->update(['alias_name' => $name])) {
|
||||
throw new \Exception('重命名失败');
|
||||
throw new \Exception(lang('Rename failed'));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('重命名成功');
|
||||
$this->success(lang('Rename succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ class User extends Base
|
||||
}
|
||||
if ($data['password_old']) {
|
||||
if (md5($data['password_old']) != $this->user->password) {
|
||||
throw new Exception('原密码不正确');
|
||||
throw new Exception(lang('The original password is incorrect'));
|
||||
}
|
||||
}
|
||||
if (!$data['password']) unset($data['password']);
|
||||
@ -255,7 +255,7 @@ class User extends Base
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('保存成功');
|
||||
$this->success(lang('Saved successfully'));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class Group extends Base
|
||||
public function index()
|
||||
{
|
||||
$groups = GroupModel::select()->order('id', 'desc')->each(function ($item) {
|
||||
$item->strategy_str = isset($this->strategyList[$item->strategy]) ? $this->strategyList[$item->strategy]['name'] : '未知';
|
||||
$item->strategy_str = isset($this->strategyList[$item->strategy]) ? $this->strategyList[$item->strategy]['name'] : lang('Unknown');
|
||||
return $item;
|
||||
});
|
||||
$this->assign([
|
||||
@ -47,13 +47,13 @@ class Group extends Base
|
||||
throw new Exception($validate);
|
||||
}
|
||||
if (!GroupModel::create($data)) {
|
||||
throw new Exception('添加失败');
|
||||
throw new Exception(lang('Add failed'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
$this->success('添加成功');
|
||||
$this->success(lang('Added successfully'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,16 +69,16 @@ class Group extends Base
|
||||
$data['default'] = array_key_exists('default', $data) ? 1 : 0;
|
||||
if ($data['default'] === 0) {
|
||||
if (!GroupModel::where('default', 1)->where('id', 'neq', $data['id'])->count()) {
|
||||
throw new Exception('至少保留一个默认分组');
|
||||
throw new Exception(lang('Keep at least one default group'));
|
||||
}
|
||||
}
|
||||
if (!GroupModel::update($data)) {
|
||||
throw new Exception('编辑失败');
|
||||
throw new Exception(lang('Edit failed'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('编辑成功');
|
||||
$this->success(lang('Edit succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,13 +89,13 @@ class Group extends Base
|
||||
try {
|
||||
$id = $this->request->post('id');
|
||||
if (1 == $id) {
|
||||
throw new Exception('默认组不可删除');
|
||||
throw new Exception(lang('The default group cannot be deleted'));
|
||||
}
|
||||
$group = GroupModel::find($id);
|
||||
// 至少保留一个默认分组
|
||||
$defaultId = GroupModel::where('default', 1)->where('id', 'neq', $id)->value('id');
|
||||
if (!$defaultId) {
|
||||
throw new Exception('至少保留一个默认分组');
|
||||
throw new Exception(lang('Keep at least one default group'));
|
||||
}
|
||||
// 转移该组下的用户到默认分组
|
||||
\app\common\model\Users::where('group_id', $group->id)->setField('group_id', $defaultId);
|
||||
@ -105,7 +105,7 @@ class Group extends Base
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('删除成功');
|
||||
$this->success(lang('Delete succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,16 +124,16 @@ class Group extends Base
|
||||
$value = $this->request->post('value');
|
||||
if (1 != $value) {
|
||||
if (!GroupModel::where('default', 1)->where('id', 'neq', $id)->count()) {
|
||||
$this->error('至少保留一个默认分组');
|
||||
$this->error(lang('Keep at least one default group'));
|
||||
}
|
||||
}
|
||||
if (!GroupModel::update([
|
||||
'id' => $id,
|
||||
'default' => $value
|
||||
])) {
|
||||
$this->error('设置失败');
|
||||
$this->error(lang('Setting failed'));
|
||||
}
|
||||
$this->success('设置成功');
|
||||
$this->success(lang('Setting succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,15 +143,15 @@ class Group extends Base
|
||||
$id = $this->request->post('id');
|
||||
$strategy = $this->request->post('strategy');
|
||||
if (!array_key_exists($strategy, $this->strategyList)) {
|
||||
$this->error('储存策略不存在');
|
||||
$this->error(lang('Storage policy does not exist'));
|
||||
}
|
||||
if (!GroupModel::update([
|
||||
'id' => $id,
|
||||
'strategy' => $strategy
|
||||
])) {
|
||||
$this->error('设置失败');
|
||||
$this->error(lang('Setting failed'));
|
||||
}
|
||||
$this->success('设置成功');
|
||||
$this->success(lang('Setting succeeded'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ class Images extends Base
|
||||
]
|
||||
])->each(function ($item) {
|
||||
$username = Users::where('id', $item->user_id)->value('username');
|
||||
$item->username = $username ? $username : '访客';
|
||||
$item->strategyStr = isset($this->strategyList[$item->strategy]) ? $this->strategyList[$item->strategy]['name'] : '未知';
|
||||
$item->username = $username ? $username : lang('Visitor');
|
||||
$item->strategyStr = isset($this->strategyList[$item->strategy]) ? $this->strategyList[$item->strategy]['name'] : lang('Unknown');
|
||||
return $item;
|
||||
});
|
||||
$this->assign([
|
||||
@ -98,11 +98,11 @@ class Images extends Base
|
||||
foreach ($deletes as $key => $val) {
|
||||
if (1 === count($val)) {
|
||||
if (!$strategy[$key]->delete(isset($val[0]) ? $val[0] : null)) {
|
||||
// throw new Exception('删除失败');
|
||||
// throw new Exception(lang('Deletion failed'));
|
||||
}
|
||||
} else {
|
||||
if (!$strategy[$key]->deletes($val)) {
|
||||
// throw new Exception('批量删除失败');
|
||||
// throw new Exception(lang('Batch deletion failed'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ class Images extends Base
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('删除成功');
|
||||
$this->success(lang('Delete succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,11 +145,11 @@ class Images extends Base
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->error('获取失败');
|
||||
$this->error(lang('Acquisition failed'));
|
||||
} catch (RequestException $e) {
|
||||
$this->error('接口发生异常,' . $e->getMessage());
|
||||
$this->error(lang('The interface is abnormal, %s', [$e->getMessage()]));
|
||||
}
|
||||
$this->success('获取成功', null, $data);
|
||||
$this->success(lang('Get success'), null, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class Strategy extends Base
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('保存成功');
|
||||
$this->success(lang('Saved successfully'));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class System extends Base
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('保存成功');
|
||||
$this->success(lang('Saved successfully'));
|
||||
}
|
||||
// 命名规则
|
||||
$naming = \think\facade\Config::pull('naming');
|
||||
@ -78,11 +78,11 @@ class System extends Base
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$email = $this->request->post('email');
|
||||
$err = $this->sendMail($email, '测试', '这是一封测试邮件!');
|
||||
$err = $this->sendMail($email, lang('Test'), lang('This is a test email!'));
|
||||
if (true !== $err) {
|
||||
$this->error($err);
|
||||
}
|
||||
$this->success('发送成功');
|
||||
$this->success(lang('Sent successfully'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ class System extends Base
|
||||
$upgrade = null;
|
||||
try {
|
||||
if (!class_exists('ZipArchive')) {
|
||||
throw new \Exception('无法继续执行, 请确保 ZipArchive 正确安装');
|
||||
throw new \Exception(lang('Cannot continue, please make sure ZipArrive is installed correctly'));
|
||||
}
|
||||
|
||||
ignore_user_abort(true);
|
||||
@ -106,33 +106,33 @@ class System extends Base
|
||||
$release = $upgrade->release(); // 获取最新版
|
||||
// 判断是否已经是最新版
|
||||
if ($upgrade->check($release->version)) {
|
||||
throw new \Exception('当前系统已经是最新版');
|
||||
throw new \Exception(lang('The current system is the latest version'));
|
||||
}
|
||||
$upgradeFile = app()->getRuntimePath() . 'upgrade.zip';// 判断是否存在安装包
|
||||
$file = file_exists($upgradeFile) ? $upgradeFile : $upgrade->download($release->url);
|
||||
|
||||
// 校验 MD5
|
||||
if (strtolower(md5_file($file)) !== strtolower($release->md5)) {
|
||||
throw new \Exception('安装包损坏, 请稍后重试');
|
||||
throw new \Exception(lang('The installation package is corrupt. Please try again later'));
|
||||
}
|
||||
|
||||
$dir = $upgrade->unzip($file, $upgrade->getWorkspace()); // 解压安装包到工作区目录
|
||||
$path = rtrim($dir . strtolower($release->path), '/') . '/'; // 新版本程序解压后的根目录
|
||||
$updateSql = $path . $release->sql; // 更新数据库结构 sql 文件路径
|
||||
if (!$sql = @file_get_contents($updateSql)) {
|
||||
throw new \Exception('SQL 文件获取失败');
|
||||
throw new \Exception(lang('SQL file acquisition failed'));
|
||||
}
|
||||
|
||||
// 创建安装锁文件
|
||||
if (!@fopen($path . 'application/install.lock', 'w')) {
|
||||
throw new \Exception('安装锁文件创建失败');
|
||||
throw new \Exception(lang('Setup lock file creation failed'));
|
||||
}
|
||||
|
||||
Db::startTrans();
|
||||
|
||||
// 检测新增表字段
|
||||
if (!$tableFields = @include($path . 'config/table.php')) {
|
||||
throw new \Exception('表字段配置文件获取失败');
|
||||
throw new \Exception(lang('Failed to get table field configuration file'));
|
||||
}
|
||||
foreach ($tableFields as $table => $fields) {
|
||||
foreach ($fields as $field => $sql) {
|
||||
@ -191,7 +191,7 @@ class System extends Base
|
||||
@$upgrade->rmdir($upgrade->getWorkspace());
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('升级完成');
|
||||
$this->success(lang('Upgrade Complete'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -212,6 +212,6 @@ class System extends Base
|
||||
} catch (\Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('备份完成, ' . $backup);
|
||||
$this->success(lang('Backup complete, %s', [$backup]));
|
||||
}
|
||||
}
|
||||
|
@ -49,17 +49,17 @@ class Users extends Base
|
||||
$id = $this->request->post('id');
|
||||
if (is_array($id)) {
|
||||
if (in_array($this->user->id, $id)) {
|
||||
$this->error('不能删除自己的账号!');
|
||||
$this->error(lang('You cannot delete your account!'));
|
||||
}
|
||||
} else {
|
||||
if ($id == $this->user->id) {
|
||||
$this->error('不能删除自己的账号!');
|
||||
$this->error(lang('You cannot delete your account!'));
|
||||
}
|
||||
}
|
||||
if (!UsersModel::destroy($id)) {
|
||||
$this->error('删除失败');
|
||||
$this->error(lang('Deletion failed'));
|
||||
}
|
||||
$this->success('删除成功');
|
||||
$this->success(lang('Delete succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,18 +69,18 @@ class Users extends Base
|
||||
$id = $this->request->post('id');
|
||||
if (is_array($id)) {
|
||||
if (in_array($this->user->id, $id)) {
|
||||
$this->error('不能冻结自己的账号!');
|
||||
$this->error(lang('You can\'t freeze your account!'));
|
||||
}
|
||||
} else {
|
||||
if ($id == $this->user->id) {
|
||||
$this->error('不能冻结自己的账号!');
|
||||
$this->error(lang('You can\'t freeze your account!'));
|
||||
}
|
||||
}
|
||||
$model = new UsersModel();
|
||||
if (!$model->where('id', 'in', $id)->update(['state' => 0])) {
|
||||
$this->error('冻结失败');
|
||||
$this->error(lang('Freeze failed'));
|
||||
}
|
||||
$this->success('冻结成功');
|
||||
$this->success(lang('Freeze succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,10 +89,10 @@ class Users extends Base
|
||||
if ($this->request->isPost()) {
|
||||
$id = $this->request->post('id');
|
||||
if (!$user = UsersModel::get($id)) {
|
||||
$this->error('数据获取失败');
|
||||
$this->error(lang('Data acquisition failed'));
|
||||
}
|
||||
unset($user->password);
|
||||
$this->success('成功', null, $user);
|
||||
$this->success(lang('Success'), null, $user);
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,12 +107,12 @@ class Users extends Base
|
||||
}
|
||||
if (!$data['password']) unset($data['password'], $data['password_confirm']);
|
||||
if (!UsersModel::update($data)) {
|
||||
throw new Exception('修改失败');
|
||||
throw new Exception(lang('Modification failed'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('保存成功');
|
||||
$this->success(lang('Saved successfully'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,15 +122,15 @@ class Users extends Base
|
||||
$id = $this->request->post('id');
|
||||
$state = $this->request->post('state');
|
||||
if (!$user = UsersModel::get($id)) {
|
||||
$this->error('数据获取失败');
|
||||
$this->error(lang('Data acquisition failed'));
|
||||
}
|
||||
if ($user->id === $this->user->id) {
|
||||
$this->error('不可修改自己的状态');
|
||||
$this->error(lang('You cannot modify your status'));
|
||||
}
|
||||
if (!$user->where('id', $id)->setField('state', $state)) {
|
||||
$this->error('状态修改失败');
|
||||
$this->error(lang('Status modification failed'));
|
||||
}
|
||||
$this->success('状态修改成功');
|
||||
$this->success(lang('Status modification succeeded'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,12 +140,12 @@ class Users extends Base
|
||||
$id = $this->request->post('id');
|
||||
$groupId = $this->request->post('group_id');
|
||||
if (!$group = \app\common\model\Group::find($groupId)) {
|
||||
$this->error('数据获取失败');
|
||||
$this->error('Data acquisition failed');
|
||||
}
|
||||
if (!UsersModel::where('id', $id)->setField('group_id', $groupId)) {
|
||||
$this->error('修改失败');
|
||||
$this->error(lang('Modification failed'));
|
||||
}
|
||||
$this->success('修改成功');
|
||||
$this->success(lang('Modified successfully'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
<td>
|
||||
<select class="mdui-select strategy">
|
||||
{foreach $strategy_list as $strategy => $val}
|
||||
<option value="{$strategy}" {if $value.strategy eq $strategy} selected{/if}>{$val.name}</option>
|
||||
<option value="{$strategy}" {if $value.strategy eq $strategy} selected{/if}>{:lang($val.name)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</td>
|
||||
@ -65,7 +65,7 @@
|
||||
<label class="mdui-textfield-label">{:lang('Strategy used')}</label>
|
||||
<select class="mdui-select" name="strategy">
|
||||
{foreach $strategy_list as $strategy => $val}
|
||||
<option value="{$strategy}">{$val.name}</option>
|
||||
<option value="{$strategy}">{:lang($val.name)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
@ -95,7 +95,7 @@
|
||||
<label class="mdui-textfield-label">{:lang('Strategy used')}</label>
|
||||
<select class="mdui-select" name="strategy">
|
||||
{foreach $strategy_list as $strategy => $val}
|
||||
<option value="{$strategy}">{$val.name}</option>
|
||||
<option value="{$strategy}">{:lang($val.name)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div class="mdui-chip">
|
||||
<span class="mdui-chip-icon"><i class="mdui-icon material-icons"></i></span>
|
||||
<span class="mdui-chip-title">{:lang('There are %s pictures in total', ['<small class="mdui-text-color-red">'.$images->total().'</small>'])}</span>
|
||||
<a href="" class="mdui-chip-delete" mdui-tooltip="{content: '刷新', position: 'right'}"><i class="mdui-icon material-icons"></i></a>
|
||||
<a href="" class="mdui-chip-delete" mdui-tooltip="{content: '{:lang('Refresh')}', position: 'right'}"><i class="mdui-icon material-icons"></i></a>
|
||||
</div>
|
||||
<div class="mdui-clearfix mdui-m-t-1"></div>
|
||||
<form action="" method="get" id="search-form">
|
||||
|
@ -22,10 +22,10 @@
|
||||
<form action="{:url('admin/strategy/index')}" method="post">
|
||||
{foreach $value as $val}
|
||||
<div class="mdui-textfield">
|
||||
<label class="mdui-textfield-label">{$val.title}{$val.tip ? '(' . $val.tip . ')' : ''}</label>
|
||||
<label class="mdui-textfield-label">{:lang($val.title)}{$val.tip ? '(' . lang($val.tip) . ')' : ''}</label>
|
||||
{switch $val.type}
|
||||
{case text}
|
||||
<input class="mdui-textfield-input" type="{$val.input_type}" name="{$val.name}" value="{$val.value}" autocomplete="off" placeholder="{$val.title}"/>
|
||||
<input class="mdui-textfield-input" type="{$val.input_type}" name="{$val.name}" value="{$val.value}" autocomplete="off" placeholder="{:lang($val.title)}"/>
|
||||
{/case}
|
||||
{case bool}
|
||||
<label class="mdui-switch">
|
||||
|
@ -19,43 +19,43 @@
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-cyan mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Number of pictures')}</p>
|
||||
<span class="mdui-text-color-white">{$images_num} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
|
||||
<span class="mdui-text-color-white">{$images_num} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-orange mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Suspicious picture')}</p>
|
||||
<span class="mdui-text-color-white">{$suspicious_images_num} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
|
||||
<span class="mdui-text-color-white">{$suspicious_images_num} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-deep-purple mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Number of users')}</p>
|
||||
<span class="mdui-text-color-white">{$users_num} <small class="mdui-text-color-white">{:lang('Ge')}</small></span>
|
||||
<span class="mdui-text-color-white">{$users_num} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-red-accent mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Upload today')}</p>
|
||||
<span class="mdui-text-color-white">{$today} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
|
||||
<span class="mdui-text-color-white">{$today} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-indigo-accent mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Uploaded yesterday')}</p>
|
||||
<span class="mdui-text-color-white">{$yesterday} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
|
||||
<span class="mdui-text-color-white">{$yesterday} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-brown mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Upload this month')}</p>
|
||||
<span class="mdui-text-color-white">{$month} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
|
||||
<span class="mdui-text-color-white">{$month} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-col item mdui-m-b-2">
|
||||
<div class="mdui-color-blue-grey mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
|
||||
<p><i class="mdui-icon material-icons"></i> {:lang('Visitor upload')}</p>
|
||||
<span class="mdui-text-color-white">{$tourists} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
|
||||
<span class="mdui-text-color-white">{$tourists} <small class="mdui-text-color-white">{:lang('Piece')}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -78,8 +78,8 @@
|
||||
{foreach $naming.path as $value}
|
||||
<tr>
|
||||
<td>{$value.name}</td>
|
||||
<td>{$value.example}</td>
|
||||
<td>{$value.explain}</td>
|
||||
<td>{:lang($value.example)}</td>
|
||||
<td>{:lang($value.explain)}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
@ -102,8 +102,8 @@
|
||||
{foreach $naming.file as $value}
|
||||
<tr>
|
||||
<td>{$value.name}</td>
|
||||
<td>{$value.example}</td>
|
||||
<td>{$value.explain}</td>
|
||||
<td>{:lang($value.example)}</td>
|
||||
<td>{:lang($value.explain)}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
@ -127,7 +127,7 @@
|
||||
});
|
||||
|
||||
$('#test-send-mail').click(function () {
|
||||
mdui.prompt(lang('Please input email'),
|
||||
mdui.prompt(lang('Please input mailbox'),
|
||||
function (value) {
|
||||
app.request("{:url('admin/system/testMail')}", {email: value});
|
||||
},
|
||||
|
@ -28,7 +28,7 @@
|
||||
<th>{:lang('User name')}</th>
|
||||
<th>{:lang('Role group')}</th>
|
||||
<th>{:lang('Nickname')}</th>
|
||||
<th>{:lang('Email')}</th>
|
||||
<th>{:lang('Mailbox')}</th>
|
||||
<th>{:lang('Used capacity')}</th>
|
||||
<th>{:lang('Total capacity')}</th>
|
||||
<th>{:lang('Account status')}</th>
|
||||
@ -43,7 +43,7 @@
|
||||
<td>
|
||||
<select class="mdui-select group">
|
||||
{foreach $groups as $group}
|
||||
<option value="{$group.id}" {if $value.group_id eq $group.id}selected{/if}>{$group.name}</option>
|
||||
<option value="{$group.id}" {if $value.group_id eq $group.id}selected{/if}>{:lang($group.name)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</td>
|
||||
@ -82,8 +82,8 @@
|
||||
<input class="mdui-textfield-input" type="text" name="username" value="" placeholder="{:lang('User name')}" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="mdui-textfield">
|
||||
<label class="mdui-textfield-label">{:lang('Email')}</label>
|
||||
<input class="mdui-textfield-input" type="email" name="email" value="" placeholder="{:lang('Email')}" autocomplete="off"/>
|
||||
<label class="mdui-textfield-label">{:lang('Mailbox')}</label>
|
||||
<input class="mdui-textfield-input" type="email" name="email" value="" placeholder="{:lang('Mailbox')}" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="mdui-textfield">
|
||||
<label class="mdui-textfield-label">{:lang('Nickname')}</label>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{extend name="common:base" /}
|
||||
|
||||
{block name="title"}找回密码 - {$config.site_name}{/block}
|
||||
{block name="title"}{:lang('Retrieve password')} - {$config.site_name}{/block}
|
||||
|
||||
{block name="main"}
|
||||
<div class="mdui-container">
|
||||
@ -8,37 +8,37 @@
|
||||
<div class="mdui-row">
|
||||
<div class="forgot-container">
|
||||
<div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
|
||||
<div class="panel-header">找回密码</div>
|
||||
<div class="panel-header">{:lang('Retrieve password')}</div>
|
||||
<div class="panel-body-box">
|
||||
<form id="send-code" action="{:url('auth/forgot')}" method="post">
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">请输入邮箱</label>
|
||||
<label class="mdui-textfield-label">{:lang('Please input mailbox')}</label>
|
||||
<input class="mdui-textfield-input" type="email" name="email" value="" required/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">验证码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Verification Code')}</label>
|
||||
<input class="mdui-textfield-input" type="text" name="captcha" maxlength="5" autocomplete="off" required/>
|
||||
<img src="{:captcha_src()}" class="captcha" onclick="this.src = '{:captcha_src()}' + '?t=' + new Date().getTime()" alt="验证码">
|
||||
<img src="{:captcha_src()}" class="captcha" onclick="this.src = '{:captcha_src()}' + '?t=' + new Date().getTime()" alt="{:lang('Verification Code')}">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">发送验证码</button>
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">{:lang('Send verification code')}</button>
|
||||
</div>
|
||||
</form>
|
||||
<form id="reset-password" class="none" action="{:url('auth/forgot')}" method="post">
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">邮件验证码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Mail verification code')}</label>
|
||||
<input class="mdui-textfield-input" type="text" name="code" maxlength="5" autocomplete="off" required/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">新密码</label>
|
||||
<label class="mdui-textfield-label">{:lang('New password')}</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password" value="" required/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">确认新密码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Confirm new password')}</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password_confirm" value="" required/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">重置密码</button>
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">{:lang('Reset password')}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -69,4 +69,4 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
{/block}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{extend name="common:base" /}
|
||||
|
||||
{block name="title"}登录 - {$config.site_name}{/block}
|
||||
{block name="title"}{:lang('Sign In')} - {$config.site_name}{/block}
|
||||
|
||||
{block name="css"}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
@ -12,33 +12,33 @@
|
||||
<div class="mdui-row">
|
||||
<div class="login-container">
|
||||
<div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
|
||||
<div class="panel-header">登录账号</div>
|
||||
<div class="panel-header">{:lang('Login account')}</div>
|
||||
<div class="panel-body-box">
|
||||
<form action="{:url('auth/login')}" method="post">
|
||||
{include file="common:alert"}
|
||||
<div class="mt-3">
|
||||
<label class="mdui-textfield-label">登录方式</label>
|
||||
<label class="mdui-textfield-label">{:lang('Login mode')}</label>
|
||||
<select class="mdui-select" mdui-select name="type">
|
||||
<option value="email" {if input('post.type') === 'email'} selected{/if}>邮箱</option>
|
||||
<option value="username" {if input('post.type') === 'username'} selected{/if}>用户名</option>
|
||||
<option value="email" {if input('post.type') === 'email'} selected{/if}>{:lang('Mailbox')}</option>
|
||||
<option value="username" {if input('post.type') === 'username'} selected{/if}>{:lang('User name')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">账号</label>
|
||||
<label class="mdui-textfield-label">{:lang('Account')}</label>
|
||||
<input class="mdui-textfield-input" type="text" name="account" value="{:input('post.account')}"/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">密码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Password')}</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password"/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">登录</button>
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">{:lang('Sign In')}</button>
|
||||
</div>
|
||||
{:token()}
|
||||
</form>
|
||||
<p class="mdui-clearfix mdui-m-t-1">
|
||||
<a class="mdui-float-left" href="{:url('auth/forgot')}">忘记密码?</a>
|
||||
<a class="mdui-float-right" href="{:url('auth/register')}">注册账号</a>
|
||||
<a class="mdui-float-left" href="{:url('auth/forgot')}">{:lang('Forgot your password?')}</a>
|
||||
<a class="mdui-float-right" href="{:url('auth/register')}">{:lang('Registered account')}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{extend name="common:base" /}
|
||||
|
||||
{block name="title"}注册 - {$config.site_name}{/block}
|
||||
{block name="title"}{:lang('Sign Up')} - {$config.site_name}{/block}
|
||||
|
||||
{block name="css"}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
@ -12,42 +12,42 @@
|
||||
<div class="mdui-row">
|
||||
<div class="register-container">
|
||||
<div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
|
||||
<div class="panel-header">注册账号</div>
|
||||
<div class="panel-header">{:lang('Registered account')}</div>
|
||||
<div class="panel-body-box">
|
||||
<form action="{:url('auth/register')}" method="post">
|
||||
{include file="common:alert"}
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">用户名</label>
|
||||
<label class="mdui-textfield-label">{:lang('User name')}</label>
|
||||
<input class="mdui-textfield-input" type="text" name="username" maxlength="15" value="{:input('post.username')}"/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">邮箱</label>
|
||||
<label class="mdui-textfield-label">{:lang('Mailbox')}</label>
|
||||
<input class="mdui-textfield-input" type="email" name="email" value="{:input('post.email')}"/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">密码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Password')}</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password" value="{:input('post.password')}"/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">确认密码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Confirm password')}</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password_confirm"/>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">验证码</label>
|
||||
<label class="mdui-textfield-label">{:lang('Verification Code')}</label>
|
||||
<input class="mdui-textfield-input" type="text" name="captcha" maxlength="5" autocomplete="off"/>
|
||||
<img src="{:captcha_src()}" class="captcha" onclick="this.src = '{:captcha_src()}' + '?t=' + new Date().getTime()" alt="验证码">
|
||||
<img src="{:captcha_src()}" class="captcha" onclick="this.src = '{:captcha_src()}' + '?t=' + new Date().getTime()" alt="{:lang('Verification Code')}">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
{if $config.close_register}
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple" disabled>已关闭注册</button>
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple" disabled>{:lang('Registration closed')}</button>
|
||||
{else /}
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">注册</button>
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">{:lang('Sign Up')}</button>
|
||||
{/if}
|
||||
</div>
|
||||
{:token()}
|
||||
</form>
|
||||
<p class="mdui-clearfix mdui-m-t-1">
|
||||
已有账号?<a href="{:url('auth/login')}">登录</a>
|
||||
{:lang('Existing account?')}<a href="{:url('auth/login')}"> {:lang('Sign In')}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -57,7 +57,7 @@
|
||||
<div class="mask">
|
||||
<div class="content">
|
||||
<div class="panel-box">
|
||||
<h3>站点已关闭注册</h3>
|
||||
<h3>{:lang('Site registration closed')}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<html lang="{$lang}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||
@ -13,7 +13,7 @@
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="/static/app/iconfont/iconfont.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@0.4.3/dist/css/mdui.min.css">
|
||||
<link rel="stylesheet" href="/static/app/css/app.css?v=1.6">
|
||||
<link rel="stylesheet" href="/static/app/css/app.css?v=1.7">
|
||||
<link rel="stylesheet" href="/static/app/css/markdown.css?v=1.0">
|
||||
<!--[if IE]>
|
||||
<script>window.location.href = '/compatibility.html';</script>
|
||||
@ -156,7 +156,7 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@0.4.3/dist/js/mdui.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked@0.8.0/marked.min.js"></script>
|
||||
<script src="/static/app/js/app.js?v=1.2"></script>
|
||||
<script src="/static/app/js/app.js?v=1.3"></script>
|
||||
{block name="js"}{/block}
|
||||
<script>
|
||||
var ver = '{$config.system_version}';
|
||||
|
@ -17,20 +17,20 @@
|
||||
<div class="mdui-container">
|
||||
<main>
|
||||
<div class="mdui-m-b-2">
|
||||
<h2>1. 获取Token</h2>
|
||||
<h2>1. Get token</h2>
|
||||
<div class="mdui-row">
|
||||
<div class="mdui-col-md-6">
|
||||
<div class="mdui-table-fluid mdui-m-t-1">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>功能</td>
|
||||
<td>接口</td>
|
||||
<td>Function</td>
|
||||
<td>Interface</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>请求方式</td>
|
||||
<td>Request mode</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -42,42 +42,42 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">请求参数</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Request parameters</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>是否必须</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Required</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>email</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>邮箱</td>
|
||||
<td>Yes</td>
|
||||
<td>Mailbox</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>password</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>账号密码</td>
|
||||
<td>Yes</td>
|
||||
<td>Account password</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">返回数据说明</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Return data description</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>实例值</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Instance value</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -85,25 +85,25 @@
|
||||
<td>code</td>
|
||||
<td>Number</td>
|
||||
<td>200</td>
|
||||
<td>状态码,成功返回200,失败返回500</td>
|
||||
<td>The status code returns 200 for success and 500 for failure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>msg</td>
|
||||
<td>String</td>
|
||||
<td>success</td>
|
||||
<td>提示信息</td>
|
||||
<td>Prompt information</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time</td>
|
||||
<td>Number</td>
|
||||
<td>1544176295</td>
|
||||
<td>响应时间戳</td>
|
||||
<td>Response timestamp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>data</td>
|
||||
<td>array|object</td>
|
||||
<td>{"token": "8961576c9090ef0902c4b89406f8d557"}</td>
|
||||
<td>获取的token数据</td>
|
||||
<td>Obtained token data</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -111,20 +111,20 @@
|
||||
</div>
|
||||
|
||||
<div class="mdui-m-b-2">
|
||||
<h2>2. 图片上传</h2>
|
||||
<h2>2. Picture upload</h2>
|
||||
<div class="mdui-row">
|
||||
<div class="mdui-col-md-6">
|
||||
<div class="mdui-table-fluid mdui-m-t-1">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>功能</td>
|
||||
<td>接口</td>
|
||||
<td>Function</td>
|
||||
<td>Interface</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>请求方式</td>
|
||||
<td>Request mode</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -136,39 +136,39 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">请求参数</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Request parameters</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>是否必须</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Required</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>image</td>
|
||||
<td>File</td>
|
||||
<td>是</td>
|
||||
<td>表单名称</td>
|
||||
<td>Yes</td>
|
||||
<td>Form name</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mdui-shadow-2 mdui-m-t-2 mdui-m-b-1 mdui-p-a-3 mdui-text-color-red">
|
||||
注意:请求时header如果有参数 token,接口则认证该token,上传的图片也是在该token用户下,否则为游客上传。
|
||||
Note: if the header has a token parameter during the request, the interface will authenticate the token, and the uploaded image is also in the token user account, otherwise the system will consider it as uploaded by tourists.
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">返回数据说明</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Return data description</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>实例值</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Instance value</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -176,19 +176,19 @@
|
||||
<td>code</td>
|
||||
<td>Number</td>
|
||||
<td>200</td>
|
||||
<td>状态码,成功返回200,失败返回500</td>
|
||||
<td>The status code returns 200 for success and 500 for failure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>msg</td>
|
||||
<td>String</td>
|
||||
<td>success</td>
|
||||
<td>提示信息</td>
|
||||
<td>Prompt information</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time</td>
|
||||
<td>Number</td>
|
||||
<td>1544176295</td>
|
||||
<td>响应时间戳</td>
|
||||
<td>Response timestamp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>data</td>
|
||||
@ -196,15 +196,15 @@
|
||||
<td>
|
||||
<pre>{
|
||||
"name": "9B7BCFBD05891B2D42187F126887777A.jpg",
|
||||
"url": "http://域名/2018/12/08/5c0b519f44701.jpg"
|
||||
"url": "http://domain.com/2018/12/08/5c0b519f44701.jpg"
|
||||
}</pre>
|
||||
</td>
|
||||
<td>图片数据</td>
|
||||
<td>Picture data</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">上传示例</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Upload example</h4>
|
||||
<pre class="mdui-shadow-2 mdui-p-a-3">
|
||||
POST /api/upload HTTP/1.1
|
||||
Host: {$domain}
|
||||
@ -217,34 +217,34 @@ Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx2mqINKHVPJ8yM
|
||||
Content-Disposition: form-data; name="image"; filename="test.png"
|
||||
Content-Type: image/png
|
||||
</pre>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">响应错误示例</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Response error example</h4>
|
||||
<pre class="mdui-shadow-2 mdui-p-a-3">
|
||||
{
|
||||
"code": 500,
|
||||
"msg": "管理员关闭了游客上传!",
|
||||
"msg": "The administrator turned off the tourist upload!",
|
||||
"data": null,
|
||||
"time": 1544245931
|
||||
}</pre>
|
||||
</div>
|
||||
|
||||
<div class="mdui-shadow-2 mdui-m-t-2 mdui-m-b-1 mdui-p-a-3 mdui-text-color-red">
|
||||
注意:以下接口均需要 Token
|
||||
Note: token is required for the following interfaces
|
||||
</div>
|
||||
<div class="mdui-m-b-2">
|
||||
<h2>3. 获取图片列表</h2>
|
||||
<h2>3. Get picture list</h2>
|
||||
<div class="mdui-row">
|
||||
<div class="mdui-col-md-6">
|
||||
<div class="mdui-table-fluid mdui-m-t-1">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>功能</td>
|
||||
<td>接口</td>
|
||||
<td>Function</td>
|
||||
<td>Interface</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>请求方式</td>
|
||||
<td>Request mode</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -256,42 +256,42 @@ Content-Type: image/png
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">请求参数</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Request parameters</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>是否必须</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Required</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>page</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>页码</td>
|
||||
<td>Yes</td>
|
||||
<td>Page number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>rows</td>
|
||||
<td>String</td>
|
||||
<td>否</td>
|
||||
<td>每页数量, 默认 20 条</td>
|
||||
<td>No</td>
|
||||
<td>Quantity per page, 20 by default</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">返回数据(data)说明</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Return data description</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>实例值</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Instance value</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -299,38 +299,38 @@ Content-Type: image/png
|
||||
<td>total</td>
|
||||
<td>Number</td>
|
||||
<td>999</td>
|
||||
<td>数据总量</td>
|
||||
<td>Total data</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>per_page</td>
|
||||
<td>String</td>
|
||||
<td>1</td>
|
||||
<td>每页数量</td>
|
||||
<td>Number per page</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>current_page</td>
|
||||
<td>Number</td>
|
||||
<td>1</td>
|
||||
<td>当前所在页码</td>
|
||||
<td>Current page</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>last_page</td>
|
||||
<td>Number</td>
|
||||
<td>999</td>
|
||||
<td>最后一页页码</td>
|
||||
<td>Last page number</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">图片数据说明</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Picture data description</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>实例值</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Instance value</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -338,91 +338,91 @@ Content-Type: image/png
|
||||
<td>id</td>
|
||||
<td>Number</td>
|
||||
<td>1</td>
|
||||
<td>图片ID</td>
|
||||
<td>Picture ID</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>strategy</td>
|
||||
<td>String</td>
|
||||
<td>oss</td>
|
||||
<td>储存策略, (cos:腾讯云, kodo:七牛云, local:本地, oss:阿里云oss, remote:远程储存, uss:又拍云)</td>
|
||||
<td>Storage strategy, (cos: Tencent cloud, kodo: qiniu cloud, local: local, soo: Alibaba cloud OSS, remote: remote storage, uss: shooting cloud again)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>path</td>
|
||||
<td>String</td>
|
||||
<td>2019/10/31</td>
|
||||
<td>图片所在路径</td>
|
||||
<td>Picture path</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>alias_name</td>
|
||||
<td>String</td>
|
||||
<td>test</td>
|
||||
<td>图片别名</td>
|
||||
<td>Picture alias</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>String</td>
|
||||
<td>929616303ca92.jpg</td>
|
||||
<td>图片名称</td>
|
||||
<td>Picture name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pathname</td>
|
||||
<td>String</td>
|
||||
<td>2019/10/31/929616303ca92.jpg</td>
|
||||
<td>图片路径+名称</td>
|
||||
<td>Picture path + name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>size</td>
|
||||
<td>String</td>
|
||||
<td>30405.00</td>
|
||||
<td>图片大小(字节: b)</td>
|
||||
<td>Picture size (bytes: b)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mime</td>
|
||||
<td>String</td>
|
||||
<td>image/jpeg</td>
|
||||
<td>图片 mime 类型</td>
|
||||
<td>Picture MIME type</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sha1</td>
|
||||
<td>String</td>
|
||||
<td>0143f7904f12e2a76ff2935f21a771b8adadf961</td>
|
||||
<td>图片 sha1 值</td>
|
||||
<td>Picture SHA1 value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>md5</td>
|
||||
<td>String</td>
|
||||
<td>e630c1d832f1701b0afe09cfe86a7f2b</td>
|
||||
<td>图片 md5 值</td>
|
||||
<td>Picture MD5 value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ip</td>
|
||||
<td>String</td>
|
||||
<td>192.168.0.1</td>
|
||||
<td>上传者 IP</td>
|
||||
<td>Uploader IP</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>suspicious</td>
|
||||
<td>Number</td>
|
||||
<td>0</td>
|
||||
<td>是否是可疑图片, (0:否, 1:是)</td>
|
||||
<td>Is it a suspicious picture, (0: No, 1: Yes)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>upload_time</td>
|
||||
<td>Number</td>
|
||||
<td>1572491936</td>
|
||||
<td>图片上传时间</td>
|
||||
<td>Picture upload time</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>upload_date</td>
|
||||
<td>String</td>
|
||||
<td>2019-10-31 11:18:56</td>
|
||||
<td>图片上传日期</td>
|
||||
<td>Picture upload date</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>url</td>
|
||||
<td>String</td>
|
||||
<td>http://domain.com/2019/10/31/929616303ca92.jpg</td>
|
||||
<td>图片链接</td>
|
||||
<td>Pictures linking</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -430,20 +430,20 @@ Content-Type: image/png
|
||||
</div>
|
||||
|
||||
<div class="mdui-m-b-2">
|
||||
<h2>4. 获取单张图片</h2>
|
||||
<h2>4. Get a single picture</h2>
|
||||
<div class="mdui-row">
|
||||
<div class="mdui-col-md-6">
|
||||
<div class="mdui-table-fluid mdui-m-t-1">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>功能</td>
|
||||
<td>接口</td>
|
||||
<td>Function</td>
|
||||
<td>Interface</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>请求方式</td>
|
||||
<td>Request mode</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -455,45 +455,45 @@ Content-Type: image/png
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">请求参数</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Request parameters</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>是否必须</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Request</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>图片ID</td>
|
||||
<td>Yes</td>
|
||||
<td>Picture ID</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">返回数据(data)与第三条相同</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">The returned data is the same as the third one</h4>
|
||||
</div>
|
||||
|
||||
<div class="mdui-m-b-2">
|
||||
<h2>5. 删除图片</h2>
|
||||
<h2>5. Delete picture</h2>
|
||||
<div class="mdui-row">
|
||||
<div class="mdui-col-md-6">
|
||||
<div class="mdui-table-fluid mdui-m-t-1">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>功能</td>
|
||||
<td>接口</td>
|
||||
<td>Function</td>
|
||||
<td>Interface</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>请求方式</td>
|
||||
<td>Request mode</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -505,23 +505,23 @@ Content-Type: image/png
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">请求参数</h4>
|
||||
<h4 class="mdui-m-t-2 mdui-m-b-1">Request parameters</h4>
|
||||
<div class="mdui-table-fluid">
|
||||
<table class="mdui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>参数名称</td>
|
||||
<td>类型</td>
|
||||
<td>是否必须</td>
|
||||
<td>说明</td>
|
||||
<td>Parameter name</td>
|
||||
<td>Type</td>
|
||||
<td>Required</td>
|
||||
<td>Explain</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>图片ID, 删除多个使用逗号分隔</td>
|
||||
<td>Yes</td>
|
||||
<td>Picture ID, delete multiple, separated by commas</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -74,11 +74,11 @@
|
||||
});
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
app.msg(true, lang('Copy success'));
|
||||
app.msg(true, lang('Copy successful'));
|
||||
});
|
||||
|
||||
clipboard.on('error', function(e) {
|
||||
app.msg(false, lang('Copy fail'));
|
||||
app.msg(false, lang('Copy failed'));
|
||||
});
|
||||
|
||||
var sort = function (uls) {
|
||||
|
@ -253,14 +253,14 @@
|
||||
// 监听复制操作
|
||||
var clipboard = new ClipboardJS('.copy-url');
|
||||
clipboard.on('success', function(e) {
|
||||
app.msg(true, lang('Copy success'));
|
||||
app.msg(true, lang('Copy successful'));
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
clipboard.on('error', function(e) {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
app.msg(false, lang('Copy fail'));
|
||||
app.msg(false, lang('Copy failed'));
|
||||
});
|
||||
|
||||
// Context Start
|
||||
|
@ -12,7 +12,7 @@
|
||||
<input class="mdui-textfield-input" type="text" value="{$user.username}" disabled/>
|
||||
</div>
|
||||
<div class="mdui-textfield">
|
||||
<label class="mdui-textfield-label">{:lang('Email')}</label>
|
||||
<label class="mdui-textfield-label">{:lang('Mailbox')}</label>
|
||||
<input class="mdui-textfield-input" type="email" value="{$user.email}" disabled/>
|
||||
</div>
|
||||
<div class="mdui-textfield">
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
// [English]
|
||||
return [
|
||||
|
||||
];
|
||||
|
@ -22,8 +22,8 @@ return [
|
||||
'Home upload info' => '最大可上传 %s 的图片,单次同时可选择 %s 张。本站已托管 %s 张图片。',
|
||||
'Account input tip' => '请输入用户名或邮箱',
|
||||
'Password input tip' => '请输入密码',
|
||||
'Copy success' => '复制成功',
|
||||
'Copy fail' => '复制失败',
|
||||
'Copy successful' => '复制成功',
|
||||
'Copy failed' => '复制失败',
|
||||
'Upload pasted photos?' => '是否上传粘贴的图片?',
|
||||
'Confirm' => '确定',
|
||||
'Cancel' => '取消',
|
||||
@ -76,21 +76,30 @@ return [
|
||||
'MD5:' => 'MD5:',
|
||||
'Type:' => '类型:',
|
||||
'User name' => '用户名',
|
||||
'Email' => '邮箱',
|
||||
'Mailbox' => '邮箱',
|
||||
'Token tip' => '注意:Token 具有管理图片权限,请不要随意泄漏。',
|
||||
'Nickname' => '昵称',
|
||||
'Default upload folder' => '默认上传文件夹',
|
||||
'Default upload folder tip' => '默认上传文件夹名(不存在上传时自动创建)',
|
||||
'Old password' => '原密码',
|
||||
'Old password tip' => '原密码,不修改请留空',
|
||||
'Account' => '账号',
|
||||
'Password' => '密码',
|
||||
'Forgot your password?' => '忘记密码?',
|
||||
'Registered account' => '注册账号',
|
||||
'Registration closed' => '已关闭注册',
|
||||
'Send verification code' => '发送验证码',
|
||||
'Mail verification code' => '邮件验证码',
|
||||
'New password' => '新密码',
|
||||
'Confirm new password' => '确认新密码',
|
||||
'Reset password' => '重置密码',
|
||||
'Password tip' => '密码,不修改请留空',
|
||||
'Confirm password' => '确认密码',
|
||||
'Save' => '保存',
|
||||
'Reset' => '重置',
|
||||
'Occupied storage' => '占用储存',
|
||||
'Zhang' => '张',
|
||||
'Ge' => '个',
|
||||
'Piece' => '张',
|
||||
'Number of pictures' => '图片数量',
|
||||
'Suspicious picture' => '可疑图片',
|
||||
'Number of users' => '用户数量',
|
||||
'Upload today' => '今日上传',
|
||||
@ -118,8 +127,9 @@ return [
|
||||
'Variable name' => '变量名',
|
||||
'Example' => '示例',
|
||||
'Explain' => '说明',
|
||||
'Please input email' => '请输入邮箱',
|
||||
'Please input mailbox' => '请输入邮箱',
|
||||
'Turn off registration' => '关闭注册',
|
||||
'Existing account?' => '已有账号?',
|
||||
'Website title' => '网站标题',
|
||||
'Website keywords' => '网站关键字',
|
||||
'Website description' => '网站描述',
|
||||
@ -146,7 +156,7 @@ return [
|
||||
'Mail smtp username' => 'SMTP用户名',
|
||||
'Mail smtp password' => 'SMTP密码',
|
||||
'Mail smtp port' => 'SMTP端口',
|
||||
'Mail form email' => '发件人邮箱',
|
||||
'Mail form mailbox' => '发件人邮箱',
|
||||
'Icp number' => '备案号',
|
||||
'Soft delete' => '软删除',
|
||||
'Soft delete tip' => '删除图片时不删除源文件,不建议开启',
|
||||
@ -171,6 +181,7 @@ return [
|
||||
'Connection address' => '连接地址',
|
||||
'Login account' => '登录账号',
|
||||
'Login password' => '登录密码',
|
||||
'Login mode' => '登录方式',
|
||||
'Connection port' => '连接端口',
|
||||
'Turn on picture yellow identification' => '开启图片鉴黄',
|
||||
'Turn on picture yellow identification tip' => '接口申请地址:<a href="https://www.moderatecontent.com" target="_blank">https://www.moderatecontent.com</a>',
|
||||
@ -227,5 +238,150 @@ return [
|
||||
'Qiniu KODO' => '七牛云KODO',
|
||||
'Upyun USS' => '又拍云USS',
|
||||
'Remote' => '远程',
|
||||
'Storage strategy tips' => '储存策略,可配置多个,使用不同的角色组来控制用户图片储存策略。'
|
||||
'Storage strategy tips' => '储存策略,可配置多个,使用不同的角色组来控制用户图片储存策略。',
|
||||
'It is already the latest version' => '已经是最新版本',
|
||||
'New version detected [%s]' => '检测到新版本[%s]',
|
||||
'Ignore' => '忽略',
|
||||
'Don\'t prompt again' => '不再提示',
|
||||
'Upgrade now' => '立即升级',
|
||||
'Upgrade note' => '将会在升级前备份原系统文件, 但不包括 runtime 和 public 目录以及数据库',
|
||||
'Do you need to back up the original system?' => '⚠ 是否需要备份原系统?',
|
||||
'Backup' => '备份',
|
||||
'No backup' => '不备份',
|
||||
'System prompt' => '系统提示',
|
||||
'Upgrading, please do not close the window' => '升级中, 请不要关闭窗口...',
|
||||
'Upgrade failed' => '升级失败, 请稍后重试(帮助文档: <a target="_blank" href="https://www.kancloud.cn/wispx/lsky-pro/1569428">https://www.kancloud.cn/wispx/lsky-pro/1569428</a>)',
|
||||
|
||||
// Admin controller
|
||||
'Unknown' => '未知',
|
||||
'Add failed' => '添加失败',
|
||||
'Added successfully' => '添加成功',
|
||||
'Edit failed' => '编辑失败',
|
||||
'Edit succeeded' => '编辑成功',
|
||||
'Setting failed' => '设置失败',
|
||||
'Setting succeeded' => '设置成功',
|
||||
'Keep at least one default group' => '至少保留一个默认组',
|
||||
'The default group cannot be deleted' => '默认组不可删除',
|
||||
'Storage policy does not exist' => '储存策略不存在',
|
||||
'Visitor' => '访客',
|
||||
'Acquisition failed' => '获取失败',
|
||||
'Get success' => '获取成功',
|
||||
'The interface is abnormal, %s' => '接口发生异常,%s',
|
||||
'Test' => '测试',
|
||||
'This is a test email!' => '这是一封测试邮件!',
|
||||
'Cannot continue, please make sure ZipArrive is installed correctly' => '无法继续执行, 请确保 ZipArchive 正确安装',
|
||||
'The current system is the latest version' => '当前系统已经是最新版',
|
||||
'The installation package is corrupt. Please try again later' => '安装包损坏, 请稍后重试',
|
||||
'SQL file acquisition failed' => 'SQL 文件获取失败',
|
||||
'Failed to get table field configuration file' => '表字段配置文件获取失败',
|
||||
'Upgrade Complete' => '升级完成',
|
||||
'Backup complete, %s' => '备份完成,%s',
|
||||
'You cannot delete your account!' => '不能删除自己的账号!',
|
||||
'You can\'t freeze your account!' => '不能冻结自己的账号!',
|
||||
'Freeze failed' => '冻结失败',
|
||||
'Freeze succeeded' => '冻结成功',
|
||||
'Data acquisition failed' => '数据获取失败',
|
||||
'Success' => '成功',
|
||||
'Modification failed' => '修改失败',
|
||||
'Modified successfully' => '修改成功',
|
||||
'You cannot modify your status' => '不可修改自己的状态',
|
||||
'Status modification failed' => '状态修改失败',
|
||||
'Status modification succeeded' => '状态修改成功',
|
||||
|
||||
// Api controller
|
||||
'The picture data was not found' => '未找到该图片数据',
|
||||
'Delete succeeded' => '删除成功',
|
||||
'Deletion failed' => '删除失败',
|
||||
'Delete succeeded!' => '删除成功!',
|
||||
'Deletion failed!' => '删除失败!',
|
||||
'Account does not exist' => '账号不存在',
|
||||
'Account password error' => '账号密码错误',
|
||||
'Token refresh failed' => 'Token 刷新失败',
|
||||
'The administrator closed the tourist upload channel' => '管理员关闭了游客上传通道',
|
||||
'The administrator turned off the tourist upload!' => '管理员关闭了游客上传!',
|
||||
'The number of pictures uploaded today has reached the maximum' => '今日图片上传数量已达到上限',
|
||||
'Save failed! Your storage capacity is insufficient, please contact the administrator!' => '保存失败!您的储存容量不足,请联系管理员!',
|
||||
'Your account is frozen, please contact the administrator!' => '你的账号被冻结,请联系管理员!',
|
||||
'Abnormal configuration of automatic watermark function' => '自动水印功能配置异常',
|
||||
'Upload failed. Please check whether the policy configuration is correct!' => '上传失败,请检查策略配置是否正确!',
|
||||
'The picture %s is suspected of violation. Uploading is prohibited!' => '图片[%s]涉嫌违规,禁止上传!',
|
||||
'Folder creation failed!' => '文件夹创建失败!',
|
||||
'Failed to save picture data' => '图片数据保存失败',
|
||||
'Picture resource acquisition failed' => '图片资源获取失败',
|
||||
'Please enter the account number' => '请输入账号',
|
||||
'Please input a password' => '请输入密码',
|
||||
'Your account has been frozen, please contact the administrator!' => '你的账户已被冻结,请联系管理员!',
|
||||
'Incorrect password' => '密码不正确',
|
||||
'User does not exist' => '用户不存在',
|
||||
|
||||
// Validate
|
||||
'Parent folder not found' => '没有找到上级文件夹',
|
||||
'Parent folder exception' => '上级文件夹异常',
|
||||
'Folder name cannot be empty' => '文件夹名称不能为空',
|
||||
'Folder name length max. 30 characters' => '文件夹名称长度最大30个字符',
|
||||
'Folder names can only be Chinese characters, letters and numbers' => '文件夹名称只能是汉字、字母和数字',
|
||||
'Role group name cannot be empty' => '角色组名称不能为空',
|
||||
'The maximum length of the role group name is 30 characters' => '角色组名称长度最大30个字符',
|
||||
'The role group name can only be Chinese characters, letters and numbers' => '角色组名称只能是汉字、字母和数字',
|
||||
'User name cannot be empty' => '用户名不能为空',
|
||||
'The user name character length exceeds the limit' => '用户名字符长度超出',
|
||||
'User name already exists, please replace' => '用户名已存在,请更换',
|
||||
'The length of nickname characters exceeds the limit' => '昵称字符长度超出',
|
||||
'Default upload folder name length exceeds limit' => '默认上传文件夹名称长度超出',
|
||||
'The default upload folder name can only be Chinese characters, letters and numbers' => '默认上传文件夹名称只能是汉字、字母和数字',
|
||||
'Mailbox cannot be empty' => '邮箱不能为空',
|
||||
'The mailbox format is incorrect' => '邮箱格式不正确',
|
||||
'Mailbox character length exceeds the limit' => '邮箱字符长度超出',
|
||||
'Mailbox already exists' => '邮箱已存在',
|
||||
'Password cannot be empty' => '密码不能为空',
|
||||
'The passwords entered twice are inconsistent' => '两次输入的密码不一致',
|
||||
'Please enter the verification code' => '请输入验证码',
|
||||
'Verification code error' => '验证码错误',
|
||||
|
||||
// Middleware
|
||||
'The administrator turned off API functionality' => '管理员关闭了接口',
|
||||
'Authentication failed' => '认证失败',
|
||||
'Token does not exist' => 'Token 不存在',
|
||||
|
||||
// Index controller
|
||||
'Site registration closed' => '站点已关闭注册',
|
||||
'Registration successful' => '注册成功',
|
||||
'Incorrect verification code' => '验证码不正确',
|
||||
'Reset successful' => '重置成功',
|
||||
'Verification Code' => '验证码',
|
||||
'Retrieve password' => '找回密码',
|
||||
'Retrieve password mail content' => "尊敬的 %s, 您好,您正在申请重置密码操作,本次的验证码是 <b>%s</b>,如果不是您本人操作请忽略!",
|
||||
'Sent successfully' => '发送成功',
|
||||
'Welcome back' => '欢迎回来',
|
||||
'Gallery feature is off' => '画廊功能已关闭',
|
||||
'API interface closed' => 'API 接口已关闭',
|
||||
'Installed tips' => '你已安装成功,需要重新安装请删除 install.lock 文件',
|
||||
'The database SQL file does not exist' => '数据库 SQL 文件不存在',
|
||||
'Data written successfully' => '数据写入成功',
|
||||
'The passwords entered twice are inconsistent!' => '两次输入的密码不一致!',
|
||||
'Configuration file write failed' => '配置文件写入失败',
|
||||
'Setup lock file creation failed' => '安装锁文件创建失败',
|
||||
'Set successfully' => '设置成功',
|
||||
'Upload succeeded' => '上传成功',
|
||||
'Created successfully' => '创建成功',
|
||||
'Move succeeded' => '移动成功',
|
||||
'Move failed' => '移动失败',
|
||||
'The folder does not exist!' => '该文件夹不存在!',
|
||||
'Rename succeeded' => '重命名成功',
|
||||
'Rename failed' => '重命名失败',
|
||||
'The original password is incorrect' => '原密码不正确',
|
||||
'Saved successfully' => '保存成功',
|
||||
'Batch deletion failed' => '批量删除失败',
|
||||
|
||||
// Naming config
|
||||
'Year' => '年',
|
||||
'Month' => '月',
|
||||
'Day' => '日',
|
||||
'Upload date' => '上传日期',
|
||||
'Unique ID' => '唯一ID',
|
||||
'MD5 (non file)' => 'md5(非文件md5)',
|
||||
'16 bit random string' => '16位随机字符串',
|
||||
'8 bit random string' => '8位随机字符串',
|
||||
'Nothing' => '无',
|
||||
'Original file name' => '原文件名',
|
||||
];
|
||||
|
@ -130,7 +130,7 @@ INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `
|
||||
(NULL, 'mail', 'text', 'text', 'mail_smtp_username', 'Mail smtp username', NULL, '', ''),
|
||||
(NULL, 'mail', 'text', 'password', 'mail_smtp_password', 'Mail smtp password', NULL, '', ''),
|
||||
(NULL, 'mail', 'text', 'number', 'mail_smtp_port', 'Mail smtp port', '25/465', '25', ''),
|
||||
(NULL, 'mail', 'text', 'email', 'mail_form_email', 'Mail form email', NULL, '', ''),
|
||||
(NULL, 'mail', 'text', 'email', 'mail_form_email', 'Mail form mailbox', NULL, '', ''),
|
||||
|
||||
(NULL, 'other', 'bool', 'checkbox', 'soft_delete', 'Soft delete', 'Soft delete tip', '0', ''),
|
||||
(NULL, 'other', 'bool', 'checkbox', 'open_gallery', 'Open gallery', 'Open gallery tip', '0', ''),
|
||||
|
@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS `lsky_group` (
|
||||
`create_time` int(11) DEFAULT NULL COMMENT '添加时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='文件夹表';
|
||||
INSERT IGNORE INTO `lsky_group` (`id`, `strategy`, `name`, `default`, `create_time`) VALUES ('1', 'local', '默认组', '1', '0');
|
||||
INSERT IGNORE INTO `lsky_group` (`id`, `strategy`, `name`, `default`, `create_time`) VALUES ('1', 'local', 'Default group', '1', '0');
|
||||
|
||||
-- v1.5.1
|
||||
UPDATE `lsky_config` SET `value` = '1.5.1' WHERE `lsky_config`.`name` = 'system_version';
|
||||
|
@ -18,79 +18,79 @@ return [
|
||||
[
|
||||
'name' => '{Y}',
|
||||
'example' => '2018',
|
||||
'explain' => '年',
|
||||
'explain' => 'Year',
|
||||
'value' => date('Y'),
|
||||
],
|
||||
[
|
||||
'name' => '{m}',
|
||||
'example' => '01',
|
||||
'explain' => '月',
|
||||
'explain' => 'Month',
|
||||
'value' => date('m'),
|
||||
],
|
||||
[
|
||||
'name' => '{d}',
|
||||
'example' => '04',
|
||||
'explain' => '日',
|
||||
'explain' => 'Day',
|
||||
'value' => date('d'),
|
||||
],
|
||||
[
|
||||
'name' => '{Ymd}',
|
||||
'example' => '20180104',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('Ymd'),
|
||||
],
|
||||
[
|
||||
'name' => '{ymd}',
|
||||
'example' => '180104',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('ymd'),
|
||||
],
|
||||
[
|
||||
'name' => '{Y-m-d}',
|
||||
'example' => '2018-01-04',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('Y-m-d'),
|
||||
],
|
||||
[
|
||||
'name' => '{y-m-d}',
|
||||
'example' => '18-01-04',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('y-m-d'),
|
||||
],
|
||||
[
|
||||
'name' => '{time-stamp}',
|
||||
'example' => '1514995200',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => $time,
|
||||
],
|
||||
[
|
||||
'name' => '{uniqid}',
|
||||
'example' => '5bb2f89a38935',
|
||||
'explain' => '唯一ID',
|
||||
'explain' => 'Unique ID',
|
||||
'value' => $uniqid,
|
||||
],
|
||||
[
|
||||
'name' => '{md5-32}',
|
||||
'example' => 'f96087bb0a9a5e8723dbde0d0f8dce34',
|
||||
'explain' => 'md5(非文件md5)',
|
||||
'explain' => 'MD5 (non file)',
|
||||
'value' => $md5,
|
||||
],
|
||||
[
|
||||
'name' => '{md5-16}',
|
||||
'example' => '0a9a5e8723dbde0d',
|
||||
'explain' => 'md5(非文件md5)',
|
||||
'explain' => 'MD5 (non file)',
|
||||
'value' => substr($md5, 8, 16),
|
||||
],
|
||||
[
|
||||
'name' => '{rend-character}',
|
||||
'example' => 'HgTLmGcDceplMduF',
|
||||
'explain' => '16位随机字符串',
|
||||
'explain' => '16 bit random string',
|
||||
'value' => str_rand(),
|
||||
],
|
||||
[
|
||||
'name' => '{rend-character-8}',
|
||||
'example' => 'HgTLmGcD',
|
||||
'explain' => '8位随机字符串',
|
||||
'explain' => '16 bit random string',
|
||||
'value' => str_rand(8),
|
||||
],
|
||||
],
|
||||
@ -98,85 +98,85 @@ return [
|
||||
[
|
||||
'name' => '{Y}',
|
||||
'example' => '2018',
|
||||
'explain' => '年',
|
||||
'explain' => 'Year',
|
||||
'value' => date('Y'),
|
||||
],
|
||||
[
|
||||
'name' => '{m}',
|
||||
'example' => '01',
|
||||
'explain' => '月',
|
||||
'explain' => 'Month',
|
||||
'value' => date('m'),
|
||||
],
|
||||
[
|
||||
'name' => '{d}',
|
||||
'example' => '04',
|
||||
'explain' => '日',
|
||||
'explain' => 'Day',
|
||||
'value' => date('d'),
|
||||
],
|
||||
[
|
||||
'name' => '{Ymd}',
|
||||
'example' => '20180104',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('Ymd'),
|
||||
],
|
||||
[
|
||||
'name' => '{ymd}',
|
||||
'example' => '180104',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('ymd'),
|
||||
],
|
||||
[
|
||||
'name' => '{Y-m-d}',
|
||||
'example' => '2018-01-04',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('Y-m-d'),
|
||||
],
|
||||
[
|
||||
'name' => '{y-m-d}',
|
||||
'example' => '18-01-04',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => date('y-m-d'),
|
||||
],
|
||||
[
|
||||
'name' => '{time-stamp}',
|
||||
'example' => '1514995200',
|
||||
'explain' => '上传日期',
|
||||
'explain' => 'Upload date',
|
||||
'value' => $time,
|
||||
],
|
||||
[
|
||||
'name' => '{uniqid}',
|
||||
'example' => '5bb2f89a38935',
|
||||
'explain' => '唯一ID',
|
||||
'explain' => 'Unique ID',
|
||||
'value' => $uniqid,
|
||||
],
|
||||
[
|
||||
'name' => '{md5-32}',
|
||||
'example' => 'f96087bb0a9a5e8723dbde0d0f8dce34',
|
||||
'explain' => 'md5(非文件md5)',
|
||||
'explain' => 'MD5 (non file)',
|
||||
'value' => $md5,
|
||||
],
|
||||
[
|
||||
'name' => '{md5-16}',
|
||||
'example' => '0a9a5e8723dbde0d',
|
||||
'explain' => 'md5(非文件md5)',
|
||||
'explain' => 'MD5 (non file)',
|
||||
'value' => substr($md5, 8, 16),
|
||||
],
|
||||
[
|
||||
'name' => '{rend-character}',
|
||||
'example' => 'HgTLmGcDceplMduF',
|
||||
'explain' => '16位随机字符串',
|
||||
'explain' => '16 bit random string',
|
||||
'value' => str_rand(),
|
||||
],
|
||||
[
|
||||
'name' => '{rend-character-8}',
|
||||
'example' => 'HgTLmGcD',
|
||||
'explain' => '8位随机字符串',
|
||||
'explain' => '8 bit random string',
|
||||
'value' => str_rand(8),
|
||||
],
|
||||
[
|
||||
'name' => '{original}',
|
||||
'example' => '无',
|
||||
'explain' => '原文件名',
|
||||
'example' => 'Nothing',
|
||||
'explain' => 'Original file name',
|
||||
'value' => '{original}',
|
||||
],
|
||||
],
|
||||
|
@ -69,7 +69,9 @@ body {
|
||||
.mdui-drawer-body-left footer {
|
||||
width: calc(100% - 240px);
|
||||
}
|
||||
.mdui-tab a {
|
||||
.mdui-tab a,
|
||||
.mdui-btn,
|
||||
.mdui-fab {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
main {
|
||||
|
File diff suppressed because one or more lines are too long
@ -43,7 +43,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
.mdui-tab a {
|
||||
.mdui-tab a, .mdui-btn, .mdui-fab {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
|
@ -161,9 +161,9 @@ var app = {
|
||||
loading = true;
|
||||
var content = '<div class="mdui-valign">' +
|
||||
'<div class="mdui-spinner mdui-spinner-colorful mdui-m-r-3"></div>' +
|
||||
'升级中, 请不要关闭窗口...' +
|
||||
lang('Upgrading, please do not close the window') +
|
||||
'</div>';
|
||||
var error = '升级失败, 请稍后重试(帮助文档: <a target="_blank" href="https://www.kancloud.cn/wispx/lsky-pro/1569428">https://www.kancloud.cn/wispx/lsky-pro/1569428</a>)';
|
||||
var error = lang('Upgrade failed');
|
||||
|
||||
$d = mdui.dialog({
|
||||
overlay: true,
|
||||
@ -180,7 +180,7 @@ var app = {
|
||||
url: '/admin/system/upgrade.html',
|
||||
type: 'POST',
|
||||
success: function (res) {
|
||||
mdui.alert(res.msg, '系统提示', function () {
|
||||
mdui.alert(res.msg, lang('System prompt'), function () {
|
||||
history.go(0);
|
||||
}, {
|
||||
modal: true,
|
||||
@ -192,7 +192,7 @@ var app = {
|
||||
loading = false;
|
||||
},
|
||||
error: function () {
|
||||
mdui.alert(error, '系统提示');
|
||||
mdui.alert(error, lang('System prompt'));
|
||||
}
|
||||
});
|
||||
}, 1000)
|
||||
@ -208,7 +208,7 @@ var app = {
|
||||
} else {
|
||||
$d.close();
|
||||
loading = false;
|
||||
mdui.alert(res.msg, '系统提示', function () {
|
||||
mdui.alert(res.msg, lang('System prompt'), function () {
|
||||
history.go(0);
|
||||
}, {
|
||||
modal: true,
|
||||
@ -219,7 +219,7 @@ var app = {
|
||||
error: function () {
|
||||
$d.close();
|
||||
loading = false;
|
||||
mdui.alert(error, '系统提示');
|
||||
mdui.alert(error, lang('System prompt'));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -237,32 +237,32 @@ var app = {
|
||||
success: function (response) {
|
||||
if (app.versionCompare(ver, response.version) === 0) {
|
||||
// 已经是最新版
|
||||
auto && app.msg(true, '已经是最新版本');
|
||||
auto && app.msg(true, lang('It is already the latest version'));
|
||||
} else {
|
||||
if (!app.cookie.has('no_update') || auto) {
|
||||
mdui.dialog({
|
||||
title: '检测到新版本[' + response.version + ']',
|
||||
title: lang('New version detected [%s]', [response.version]),
|
||||
content: '<div class="markdown-body mdui-p-l-3 mdui-p-r-3">' + marked(response.info) + '</div>',
|
||||
modal: true,
|
||||
history: false,
|
||||
buttons: [
|
||||
{
|
||||
text: '忽略'
|
||||
text: lang('Ignore')
|
||||
},
|
||||
{
|
||||
text: '不再提示',
|
||||
text: lang('Don\'t prompt again'),
|
||||
onClick: function () {
|
||||
app.cookie.set('no_update', true, 30, '/');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '立即升级',
|
||||
text: lang('Upgrade now'),
|
||||
close: false,
|
||||
onClick: function (inst) {
|
||||
inst.close();
|
||||
mdui.confirm(
|
||||
'将会在升级前备份原系统文件, 但不包括 runtime 和 public 目录以及数据库',
|
||||
'⚠ 是否需要备份原系统?',
|
||||
lang('Upgrade note'),
|
||||
lang('Do you need to back up the original system?'),
|
||||
function () {
|
||||
app.upgrade(true);
|
||||
},
|
||||
@ -270,8 +270,8 @@ var app = {
|
||||
app.upgrade(false);
|
||||
},
|
||||
{
|
||||
confirmText: '备份',
|
||||
cancelText: '不备份',
|
||||
confirmText: lang('Backup'),
|
||||
cancelText: lang('No backup'),
|
||||
modal: true,
|
||||
closeOnEsc: false,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user