--{:lang('Role group tips')}
-
| {:lang('Strategy used')} | -{:lang('Name')} | -{:lang('Register default')} | -{:lang('Operation')} | -
|---|---|---|---|
| - - | -{$value.name} | -- - | -
-
-
-
-
- |
-
diff --git a/.editorconfig b/.editorconfig
index 1fc7824c..1671c9b9 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -8,8 +8,11 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true
-[*.{html, less, js}]
-indent_size = 2
-
[*.md]
trim_trailing_whitespace = false
+
+[*.{yml,yaml}]
+indent_size = 2
+
+[docker-compose.yml]
+indent_size = 4
diff --git a/.env.example b/.env.example
index feef3f0e..903168a0 100644
--- a/.env.example
+++ b/.env.example
@@ -1,18 +1,52 @@
-[app]
-debug = false
-trace = false
+APP_NAME=Laravel
+APP_ENV=local
+APP_KEY=
+APP_DEBUG=true
+APP_URL=http://localhost
-[database]
-hostname = '{hostname}'
-database = '{database}'
-username = '{username}'
-password = '{password}'
-hostport = '{hostport}'
-charset = utf8mb4
-prefix = lsky_
+LOG_CHANNEL=stack
+LOG_DEPRECATIONS_CHANNEL=null
+LOG_LEVEL=debug
-[system]
-single_user_mode = false
-intercept_salacity = false
-url_query = ''
-watermark = false
\ No newline at end of file
+DB_CONNECTION=mysql
+DB_HOST=127.0.0.1
+DB_PORT=3306
+DB_DATABASE=lsky
+DB_USERNAME=root
+DB_PASSWORD=
+
+BROADCAST_DRIVER=log
+CACHE_DRIVER=file
+FILESYSTEM_DRIVER=local
+QUEUE_CONNECTION=sync
+SESSION_DRIVER=file
+SESSION_LIFETIME=120
+
+MEMCACHED_HOST=127.0.0.1
+
+REDIS_HOST=127.0.0.1
+REDIS_PASSWORD=null
+REDIS_PORT=6379
+
+MAIL_MAILER=smtp
+MAIL_HOST=mailhog
+MAIL_PORT=1025
+MAIL_USERNAME=null
+MAIL_PASSWORD=null
+MAIL_ENCRYPTION=null
+MAIL_FROM_ADDRESS=null
+MAIL_FROM_NAME="${APP_NAME}"
+
+AWS_ACCESS_KEY_ID=
+AWS_SECRET_ACCESS_KEY=
+AWS_DEFAULT_REGION=us-east-1
+AWS_BUCKET=
+AWS_USE_PATH_STYLE_ENDPOINT=false
+
+PUSHER_APP_ID=
+PUSHER_APP_KEY=
+PUSHER_APP_SECRET=
+PUSHER_APP_CLUSTER=mt1
+
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..967315dd
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+* text=auto
+*.css linguist-vendored
+*.scss linguist-vendored
+*.js linguist-vendored
+CHANGELOG.md export-ignore
diff --git a/.gitignore b/.gitignore
index 95e9ccce..eb003b01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,35 +1,15 @@
-# General
-.DS_Store
-.AppleDouble
-.LSOverride
-.idea
-.vscode
-*.iml
-runtime/.tmp
-/public/20*
-/application/install.lock
-backups
+/node_modules
+/public/hot
+/public/storage
+/storage/*.key
+/vendor
.env
-
-# Icon must end with two \r
-Icon
-
-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
+.env.backup
+.phpunit.result.cache
+docker-compose.override.yml
+Homestead.json
+Homestead.yaml
+npm-debug.log
+yarn-error.log
+/.idea
+/.vscode
diff --git a/.styleci.yml b/.styleci.yml
new file mode 100644
index 00000000..877ea701
--- /dev/null
+++ b/.styleci.yml
@@ -0,0 +1,14 @@
+php:
+ preset: laravel
+ version: 8
+ disabled:
+ - no_unused_imports
+ finder:
+ not-name:
+ - index.php
+ - server.php
+js:
+ finder:
+ not-name:
+ - webpack.mix.js
+css: true
diff --git a/README.md b/README.md
index 803be85e..18739453 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-
+




--{:lang('Role group tips')}
-
| {:lang('Strategy used')} | -{:lang('Name')} | -{:lang('Register default')} | -{:lang('Operation')} | -
|---|---|---|---|
| - - | -{$value.name} | -- - | -
-
-
-
-
- |
-
| {:lang('User')} | -{:lang('Storage strategy')} | -{:lang('Alias')} | -{:lang('Route')} | -{:lang('Size')} | -{:lang('Type')} | -{:lang('Upload IP')} | -{:lang('Upload time')} | -{:lang('Operation')} | -
|---|---|---|---|---|---|---|---|---|
| {$value.username} | -{:lang($value.strategyStr)} | -{$value.alias_name ?: '-'} | -{$value.pathname} | -{$value.size|format_size} | -{$value.mime} | -{$value.ip} | -{$value.date} | -
-
-
-
-
- |
-
--{:lang('Storage strategy tips')}
-
{:lang('Occupied storage')}
- {$storage[0]} - {if $storage[0]}{$storage[1]}{else/}Kb{/if} - - {:lang('Number of pictures')}
- {$images_num} {:lang('Piece')} - {:lang('Suspicious picture')}
- {$suspicious_images_num} {:lang('Piece')} - {:lang('Number of users')}
- {$users_num} {:lang('Piece')} - {:lang('Upload today')}
- {$today} {:lang('Piece')} - {:lang('Uploaded yesterday')}
- {$yesterday} {:lang('Piece')} - {:lang('Upload this month')}
- {$month} {:lang('Piece')} - {:lang('Visitor upload')}
- {$tourists} {:lang('Piece')} -| {:lang('System configuration')} | -||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {:lang('Operating system')}: | -{:php_uname('s')} | -{:lang('Server IP:')} | -{:GetHostByName($Think.server.http_host)} | -{:lang('Website domain name:')} | -{$Think.server.http_host} | -|||||||||
| {:lang('Operating environment:')} | -{$Think.server.server_software} | -{:lang('PHP version:')} | -{$Think.PHP_VERSION} | -{:lang('File upload restrictions:')} | -{:ini_get('upload_max_filesize')} | -|||||||||
| {:lang('Software information')} | -||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {:lang('Software version:')} | -v{$config.system_version} | -|||||||||||||
| {:lang('User manual:')} | -https://www.kancloud.cn/wispx/lsky-pro/content | -|||||||||||||
| {:lang('Warehouse address:')} | -https://github.com/wisp-x/lsky-pro | -|||||||||||||
| {:lang('Contact author:')} | -i@wispx.cn | -|||||||||||||
--- {:lang('System management tips')} -
-
| {:lang('Variable name')} | -{:lang('Example')} | -{:lang('Explain')} | -
|---|---|---|
| {$value.name} | -{:lang($value.example)} | -{:lang($value.explain)} | -
| {:lang('Variable name')} | -{:lang('Example')} | -{:lang('Explain')} | -
|---|---|---|
| {$value.name} | -{:lang($value.example)} | -{:lang($value.explain)} | -
| {:lang('User name')} | -{:lang('Role group')} | -{:lang('Nickname')} | -{:lang('Mailbox')} | -{:lang('Used capacity')} | -{:lang('Total capacity')} | -{:lang('Account status')} | -{:lang('Register IP')} | -{:lang('Create time')} | -{:lang('Operation')} | -
|---|---|---|---|---|---|---|---|---|---|
| {$value.username} | -- - | -{$value.nickname} | -{$value.email} | -{$value.use_quota|format_size} | -{$value.quota|format_size} | -- - | -{$value.reg_ip} | -{$value.create_time} | -
-
-
-
-
- |
-
- {:lang('Existing account?')} {:lang('Sign In')} -
-| Function | -Interface | -
| Request mode | -POST | -
| URL | -{$domain}/api/token | -
| Parameter name | -Type | -Required | -Explain | -
| String | -Yes | -Mailbox | -|
| password | -String | -Yes | -Account password | -
| Parameter name | -Type | -Instance value | -Explain | -
| code | -Number | -200 | -The status code returns 200 for success and 500 for failure | -
| msg | -String | -success | -Prompt information | -
| time | -Number | -1544176295 | -Response timestamp | -
| data | -array|object | -{"token": "8961576c9090ef0902c4b89406f8d557"} | -Obtained token data | -
| Function | -Interface | -
| Request mode | -POST | -
| URL | -{$domain}/api/upload | -
| Parameter name | -Type | -Required | -Explain | -
| image | -File | -Yes | -Form name | -
| Parameter name | -Type | -Instance value | -Explain | -
| code | -Number | -200 | -The status code returns 200 for success and 500 for failure | -
| msg | -String | -success | -Prompt information | -
| time | -Number | -1544176295 | -Response timestamp | -
| data | -array|object | -
-{
- "name": "9B7BCFBD05891B2D42187F126887777A.jpg",
- "url": "http://domain.com/2018/12/08/5c0b519f44701.jpg"
-}
- |
- Picture data | -
-POST /api/upload HTTP/1.1
-Host: {$domain}
-
-Connection: keep-alive
-Content-Length: 57398
-Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx2mqINKHVPJ8yMdK
-
-------WebKitFormBoundaryx2mqINKHVPJ8yMdK
-Content-Disposition: form-data; name="image"; filename="test.png"
-Content-Type: image/png
-
-
-{
- "code": 500,
- "msg": "The administrator turned off the tourist upload!",
- "data": null,
- "time": 1544245931
-}
- | Function | -Interface | -
| Request mode | -POST | -
| URL | -{$domain}/api/images | -
| Parameter name | -Type | -Required | -Explain | -
| page | -String | -Yes | -Page number | -
| rows | -String | -No | -Quantity per page, 20 by default | -
| Parameter name | -Type | -Instance value | -Explain | -
| total | -Number | -999 | -Total data | -
| per_page | -String | -1 | -Number per page | -
| current_page | -Number | -1 | -Current page | -
| last_page | -Number | -999 | -Last page number | -
| Parameter name | -Type | -Instance value | -Explain | -
| id | -Number | -1 | -Picture ID | -
| strategy | -String | -oss | -Storage strategy, (cos: Tencent cloud, kodo: qiniu cloud, local: local, soo: Alibaba cloud OSS, remote: remote storage, uss: shooting cloud again) | -
| path | -String | -2019/10/31 | -Picture path | -
| alias_name | -String | -test | -Picture alias | -
| name | -String | -929616303ca92.jpg | -Picture name | -
| pathname | -String | -2019/10/31/929616303ca92.jpg | -Picture path + name | -
| size | -String | -30405.00 | -Picture size (bytes: b) | -
| mime | -String | -image/jpeg | -Picture MIME type | -
| sha1 | -String | -0143f7904f12e2a76ff2935f21a771b8adadf961 | -Picture SHA1 value | -
| md5 | -String | -e630c1d832f1701b0afe09cfe86a7f2b | -Picture MD5 value | -
| ip | -String | -192.168.0.1 | -Uploader IP | -
| suspicious | -Number | -0 | -Is it a suspicious picture, (0: No, 1: Yes) | -
| upload_time | -Number | -1572491936 | -Picture upload time | -
| upload_date | -String | -2019-10-31 11:18:56 | -Picture upload date | -
| url | -String | -http://domain.com/2019/10/31/929616303ca92.jpg | -Pictures linking | -
| Function | -Interface | -
| Request mode | -POST | -
| URL | -{$domain}/api/image | -
| Parameter name | -Type | -Request | -Explain | -
| id | -String | -Yes | -Picture ID | -
| Function | -Interface | -
| Request mode | -POST | -
| URL | -{$domain}/api/delete | -
| Parameter name | -Type | -Required | -Explain | -
| id | -String | -Yes | -Picture ID, delete multiple, separated by commas | -
{:lang('Home upload info', [format_size($config.upload_max_size), $config.upload_single_num, $images_count])}
-| - PHP版本 ≥ 5.6: - | -- {if ($phpVerGt56) } - - {else/} - - {/if} - | -
| - fileInfo 拓展: - | -- {if ($isFileInfo) } - - {else/} - - {/if} - | -
| - curl 拓展: - | -- {if ($isCurl) } - - {else/} - - {/if} - | -
| - PDO 拓展: - | -- {if ($pdo) } - - {else/} - - {/if} - | -
| - ZipArchive: - | -- {if ($isZip) } - - {else/} - - {/if} - | -
| - 文件写入权限: - | -- {if ($dir) } - - {else/} - - {/if} - | -
- 为了获得更好的浏览体验,我们强烈建议您 - 升级到最新版本的IE浏览器,或者使用较新版本的 - Google Chrome、 Firefox、 - Safari 等。 如果您使用的是 IE 10 或以上版本,请关闭“兼容性视图”。 -
- - diff --git a/application/index/view/user/images.html b/application/index/view/user/images.html deleted file mode 100644 index bfab3b81..00000000 --- a/application/index/view/user/images.html +++ /dev/null @@ -1,590 +0,0 @@ -{extend name="common:base" /} - -{block name="title"}{:lang('Picture management')} - {$config.site_name}{/block} - -{block name="css"} - - -{/block} - -{block name="main"} -
- | {:lang('Alias:')} | -- |
| {:lang('Link:')} | -- - | -
| {:lang('Position:')} | -- |
| {:lang('Size:')} | -- |
| {:lang('MD5:')} | -- |
| {:lang('Type:')} | -- |
' . $label . $output . ''; - } - if ($echo) { - echo($output); - return; - } - return $output; - } - - public function inject(Response $response, &$content) - { - $config = $this->config; - $type = isset($config['type']) ? $config['type'] : 'Html'; - - unset($config['type']); - - $trace = Loader::factory($type, '\\think\\debug\\', $config); - - if ($response instanceof Redirect) { - //TODO 记录 - } else { - $output = $trace->output($response, $this->app['log']->getLog()); - if (is_string($output)) { - // trace调试信息注入 - $pos = strripos($content, '