diff --git a/CHANGELOG.md b/CHANGELOG.md index ee828153..2cbc7afc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +### [v1.7.0](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.0)(2024-05-15) + +- 升级layui-2.9.8 +- 调整html编辑器属性 +- 增加代码块内容复制 +- 清理无用的Captcha配置 +- 联系人QQ改为上传二维码图片 +- 修正logo,favicon上传路径 +- 登录后台同时登录前台 +- 移动端修正评论发表 + ### [v1.6.9](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.9)(2024-04-15) - 增加用户删除和还原功能 diff --git a/app/Console/Tasks/SyncAppInfoTask.php b/app/Console/Tasks/SyncAppInfoTask.php index cbca2b44..361d029e 100644 --- a/app/Console/Tasks/SyncAppInfoTask.php +++ b/app/Console/Tasks/SyncAppInfoTask.php @@ -15,6 +15,8 @@ class SyncAppInfoTask extends Task public function mainAction() { + echo '------ start sync app info ------' . PHP_EOL; + $url = 'https://www.koogua.com/api/instance/collect'; $site = $this->getSettings('site'); @@ -37,6 +39,8 @@ class SyncAppInfoTask extends Task $client = new Client(); $client->request('POST', $url, ['form_params' => $params]); + + echo '------ end sync app info ------' . PHP_EOL; } } diff --git a/app/Http/Admin/Services/Session.php b/app/Http/Admin/Services/Session.php index 232ca195..f20a7ec1 100644 --- a/app/Http/Admin/Services/Session.php +++ b/app/Http/Admin/Services/Session.php @@ -8,6 +8,7 @@ namespace App\Http\Admin\Services; use App\Services\Auth\Admin as AdminAuth; +use App\Services\Auth\Home as HomeAuth; use App\Validators\Account as AccountValidator; class Session extends Service @@ -35,6 +36,8 @@ class Session extends Service $this->auth->saveAuthInfo($user); + $this->loginHome($user); + $this->eventsManager->fire('Account:afterLogin', $this, $user); } @@ -47,4 +50,11 @@ class Session extends Service $this->eventsManager->fire('Account:afterLogout', $this, $user); } + protected function loginHome($user) + { + $auth = new HomeAuth(); + + $auth->saveAuthInfo($user); + } + } diff --git a/app/Library/AppInfo.php b/app/Library/AppInfo.php index 3a8f3414..a7f0f48e 100644 --- a/app/Library/AppInfo.php +++ b/app/Library/AppInfo.php @@ -16,7 +16,7 @@ class AppInfo protected $link = 'https://www.koogua.com'; - protected $version = '1.6.9'; + protected $version = '1.7.0'; public function __get($name) { diff --git a/app/Library/Paginator/Adapter/XunSearch.php b/app/Library/Paginator/Adapter/XunSearch.php index f524bce1..c2d57e25 100644 --- a/app/Library/Paginator/Adapter/XunSearch.php +++ b/app/Library/Paginator/Adapter/XunSearch.php @@ -42,7 +42,7 @@ class XunSearch extends PaginatorAdapter public function __construct(array $config) { - if (!isset($config['xs']) || ($config['xs'] instanceof \XS) == false) { + if (!isset($config['xs']) || !($config['xs'] instanceof \XS)) { throw new PaginatorException('Invalid xs parameter'); } diff --git a/public/static/admin/js/content.editor.js b/public/static/admin/js/content.editor.js index d9e370a5..c14cbb7a 100644 --- a/public/static/admin/js/content.editor.js +++ b/public/static/admin/js/content.editor.js @@ -6,18 +6,31 @@ layui.use(['jquery'], function () { var options = { uploadJson: '/admin/upload/content/img', - cssPath: '/static/lib/kindeditor/content.css', + cssPath: '/static/home/css/content.css', width: '100%', height: '300px', items: [ 'selectall', '|', 'undo', 'redo', '|', - 'copy', 'plainpaste', 'wordpaste', '|', - 'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', - 'insertorderedlist', 'insertunorderedlist', 'table', '|', - 'superscript', 'subscript', '|', 'image', 'link', 'unlink', '|', + 'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|', + 'insertorderedlist', 'insertunorderedlist', 'table', 'code', '|', + 'image', 'link', 'unlink', '|', 'source', 'about' ], + htmlTags: { + span: ['.color', '.background-color'], + a: ['id', 'class', 'href', 'target', 'name'], + img: ['id', 'class', 'src', 'width', 'height', 'alt', 'title'], + table: ['id', 'class'], + div: ['id', 'class'], + pre: ['id', 'class'], + hr: ['id', 'class'], + embed: ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', 'align', 'wmode'], + iframe: ['id', 'class', 'src', 'width', 'height'], + 'td,th': ['id', 'class'], + 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6': ['id', 'class'], + 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del': ['id', 'class'], + }, extraFileUploadParams: { csrf_token: $('meta[name="csrf-token"]').attr('content') } diff --git a/public/static/home/css/content.css b/public/static/home/css/content.css index fd953ae6..d5ff9a65 100644 --- a/public/static/home/css/content.css +++ b/public/static/home/css/content.css @@ -178,7 +178,8 @@ font-family: Consolas, Monaco, Andale Mono, monospace; line-height: 1.7em; overflow: auto; - padding: 6px 10px; + padding: 15px 10px; + margin-bottom: 15px; border-left: 5px solid #6CE26C; } @@ -218,4 +219,25 @@ .ke-content blockquote p { color: #666; +} + +.ke-content pre { + position: relative; +} + +.ke-content pre > span.kg-copy { + position: absolute; + top: 10px; + right: 10px; + padding: 0 10px; + color: #fff; + font-size: 12px; + border-radius: 3px; + background: rgba(0, 0, 0, 0.5); + cursor: pointer; + display: none; +} + +.ke-content pre:hover > span.kg-copy { + display: block; } \ No newline at end of file diff --git a/public/static/home/js/content.editor.js b/public/static/home/js/content.editor.js index cbefda90..01c091f3 100644 --- a/public/static/home/js/content.editor.js +++ b/public/static/home/js/content.editor.js @@ -12,12 +12,23 @@ layui.use(['jquery'], function () { items: [ 'selectall', '|', 'undo', 'redo', '|', - 'copy', 'plainpaste', 'wordpaste', '|', - 'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', - 'insertorderedlist', 'insertunorderedlist', 'table', '|', - 'superscript', 'subscript', '|', 'image', 'link', 'unlink', '|', + 'formatblock', 'formatblock', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|', + 'insertorderedlist', 'insertunorderedlist', 'table', 'code', '|', + 'image', 'link', 'unlink', '|', 'source', 'about' ], + htmlTags: { + span: ['.color', '.background-color'], + a: ['id', 'class', 'href', 'target', 'name'], + img: ['id', 'class', 'src', 'width', 'height', 'alt', 'title'], + table: ['id', 'class'], + div: ['id', 'class'], + pre: ['id', 'class'], + hr: ['id', 'class'], + 'td,th': ['id', 'class'], + 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6': ['id', 'class'], + 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del': ['id', 'class'], + }, extraFileUploadParams: { csrf_token: $('meta[name="csrf-token"]').attr('content') } diff --git a/public/static/home/js/copy.js b/public/static/home/js/copy.js index c66d263f..0c7bfc12 100644 --- a/public/static/home/js/copy.js +++ b/public/static/home/js/copy.js @@ -1,9 +1,22 @@ -layui.use(['layer'], function () { +layui.use(['jquery','layer'], function () { + var $ = layui.jquery; var layer = layui.layer; + + if ($('.ke-content').length > 0) { + var kePres = $('pre'); + if (kePres.length > 0) { + kePres.each(function () { + var text = $(this).text(); + var btn = $('复制').attr('data-clipboard-text', text); + $(this).prepend(btn); + }); + } + } + var clipboard = new ClipboardJS('.kg-copy'); - clipboard.on('success', function (e) { + clipboard.on('success', function () { layer.msg('内容已经复制到剪贴板'); });