From 9815f98ff9ad534ab5d4ed6e1d99d89f014b02b0 Mon Sep 17 00:00:00 2001 From: koogua Date: Sun, 22 Aug 2021 18:01:47 +0800 Subject: [PATCH] v1.4.3 --- CHANGELOG.md | 12 ++ .../Admin/Controllers/SettingController.php | 25 ++++ .../Admin/Controllers/UploadController.php | 42 ------- app/Http/Admin/Services/AuthNode.php | 6 + app/Http/Admin/Views/public/live_player.volt | 4 +- app/Http/Admin/Views/setting/contact.volt | 119 ++++++++++++++++++ app/Http/Admin/Views/setting/im.volt | 4 - app/Http/Admin/Views/setting/site.volt | 4 +- app/Http/Api/Controllers/PageController.php | 2 +- app/Http/Api/Controllers/VerifyController.php | 21 +++- app/Http/Home/Controllers/Controller.php | 12 ++ .../Home/Controllers/VerifyController.php | 8 +- app/Http/Home/Services/Index.php | 7 +- app/Http/Home/Views/help/index.volt | 5 +- app/Http/Home/Views/partials/footer.volt | 66 +++++++--- app/Http/Home/Views/partials/js_vars.volt | 11 ++ app/Http/Home/Views/templates/main.volt | 2 + app/Library/AppInfo.php | 2 +- app/Repos/ArticleFavorite.php | 4 + app/Repos/QuestionFavorite.php | 4 + app/Services/ChapterVod.php | 6 +- app/Services/Logic/Chapter/BasicInfo.php | 7 ++ .../Verify/{EmailCode.php => MailCode.php} | 6 +- app/Services/Logic/Verify/Ticket.php | 27 ++++ app/Services/MyStorage.php | 20 --- app/Services/Vod.php | 12 +- app/Validators/Verify.php | 24 ++++ db/migrations/20210820064755.php | 66 ++++++++++ public/static/home/css/common.css | 34 +++-- public/static/home/js/captcha.verify.js | 2 +- public/static/home/js/chapter.live.player.js | 4 +- public/static/home/js/chapter.vod.player.js | 6 +- public/static/home/js/fixbar.js | 46 ++++++- 33 files changed, 479 insertions(+), 141 deletions(-) create mode 100644 app/Http/Admin/Views/setting/contact.volt rename app/Services/Logic/Verify/{EmailCode.php => MailCode.php} (82%) create mode 100644 app/Services/Logic/Verify/Ticket.php create mode 100644 db/migrations/20210820064755.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dae06da..0acff682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +### [v1.4.3](https://gitee.com/koogua/course-tencent-cloud/releases/v1.4.3)(2021-08-23) + +- 优化邮件验证码 +- 优化logo和favicon上传 +- 优化api验证码中使用的ticket和rand +- 优化点播和直播地址获取 +- 修复部分清晰度外链播放地址为空时切换卡死问题 +- 增加QQ,微信,微博,邮件,电话等联系配置 +- 用户控制台文章和提问列表增加删除过滤 +- 去除layim在线客服 +- 提高视频转码分辨率 + ### [v1.4.2](https://gitee.com/koogua/course-tencent-cloud/releases/v1.4.2)(2021-08-13) - 后台增加转码码率配置选项 diff --git a/app/Http/Admin/Controllers/SettingController.php b/app/Http/Admin/Controllers/SettingController.php index 22e425d5..94bd7ee3 100644 --- a/app/Http/Admin/Controllers/SettingController.php +++ b/app/Http/Admin/Controllers/SettingController.php @@ -409,4 +409,29 @@ class SettingController extends Controller } } + /** + * @Route("/contact", name="admin.setting.contact") + */ + public function contactAction() + { + $section = 'contact'; + + $settingService = new SettingService(); + + if ($this->request->isPost()) { + + $data = $this->request->getPost(); + + $settingService->updateSettings($section, $data); + + return $this->jsonSuccess(['msg' => '更新配置成功']); + + } else { + + $contact = $settingService->getSettings($section); + + $this->view->setVar('contact', $contact); + } + } + } diff --git a/app/Http/Admin/Controllers/UploadController.php b/app/Http/Admin/Controllers/UploadController.php index a96380d3..57eda34b 100644 --- a/app/Http/Admin/Controllers/UploadController.php +++ b/app/Http/Admin/Controllers/UploadController.php @@ -16,48 +16,6 @@ use App\Services\Vod as VodService; class UploadController extends Controller { - /** - * @Post("/site/logo", name="admin.upload.site_logo") - */ - public function uploadSiteLogoAction() - { - $service = new StorageService(); - - $file = $service->uploadSiteLogo(); - - if (!$file) { - return $this->jsonError(['msg' => '上传文件失败']); - } - - $data = [ - 'src' => $service->getImageUrl($file->path), - 'title' => $file->name, - ]; - - return $this->jsonSuccess(['data' => $data]); - } - - /** - * @Post("/site/favicon", name="admin.upload.site_favicon") - */ - public function uploadSiteFaviconAction() - { - $service = new StorageService(); - - $file = $service->uploadSiteFavicon(); - - if (!$file) { - return $this->jsonError(['msg' => '上传文件失败']); - } - - $data = [ - 'src' => $service->getImageUrl($file->path), - 'title' => $file->name, - ]; - - return $this->jsonSuccess(['data' => $data]); - } - /** * @Post("/icon/img", name="admin.upload.icon_img") */ diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 75af4425..192366b6 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -1221,6 +1221,12 @@ class AuthNode extends Service 'type' => 'menu', 'route' => 'admin.setting.dingtalk_robot', ], + [ + 'id' => '5-1-16', + 'title' => '联系方式', + 'type' => 'menu', + 'route' => 'admin.setting.contact', + ], ], ], ], diff --git a/app/Http/Admin/Views/public/live_player.volt b/app/Http/Admin/Views/public/live_player.volt index f615c74f..97558946 100644 --- a/app/Http/Admin/Views/public/live_player.volt +++ b/app/Http/Admin/Views/public/live_player.volt @@ -56,11 +56,11 @@ $.each(formats, function (i, format) { $.each(rates, function (k, rate) { if (playUrls.hasOwnProperty(format) && playUrls[format].hasOwnProperty(rate.name)) { - quality[k] = { + quality.push({ name: rate.label, url: playUrls[format][rate.name], type: 'flv', - }; + }); } }); }); diff --git a/app/Http/Admin/Views/setting/contact.volt b/app/Http/Admin/Views/setting/contact.volt new file mode 100644 index 00000000..4e83f8a2 --- /dev/null +++ b/app/Http/Admin/Views/setting/contact.volt @@ -0,0 +1,119 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
+ 联系方式 +
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +{% endblock %} + +{% block inline_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/setting/im.volt b/app/Http/Admin/Views/setting/im.volt index db58309a..43440c10 100644 --- a/app/Http/Admin/Views/setting/im.volt +++ b/app/Http/Admin/Views/setting/im.volt @@ -5,15 +5,11 @@
{{ partial('setting/im_main') }}
-
- {{ partial('setting/im_cs') }} -
diff --git a/app/Http/Admin/Views/setting/site.volt b/app/Http/Admin/Views/setting/site.volt index cc3ee0cf..a434485a 100644 --- a/app/Http/Admin/Views/setting/site.volt +++ b/app/Http/Admin/Views/setting/site.volt @@ -163,7 +163,7 @@ upload.render({ elem: '#upload-logo', - url: '/admin/upload/site/logo', + url: '/admin/upload/icon/img', exts: 'gif|jpg|png', before: function () { layer.load(); @@ -179,7 +179,7 @@ upload.render({ elem: '#upload-favicon', - url: '/admin/upload/site/favicon', + url: '/admin/upload/icon/img', exts: 'gif|jpg|png|ico', before: function () { layer.load(); diff --git a/app/Http/Api/Controllers/PageController.php b/app/Http/Api/Controllers/PageController.php index 7d4ab259..7ef38905 100644 --- a/app/Http/Api/Controllers/PageController.php +++ b/app/Http/Api/Controllers/PageController.php @@ -16,7 +16,7 @@ class PageController extends Controller { /** - * @Get("/{id:[0-9]+}/info", name="api.page.info") + * @Get("/{id}/info", name="api.page.info") */ public function infoAction($id) { diff --git a/app/Http/Api/Controllers/VerifyController.php b/app/Http/Api/Controllers/VerifyController.php index 0657e96a..3f0c8b8c 100644 --- a/app/Http/Api/Controllers/VerifyController.php +++ b/app/Http/Api/Controllers/VerifyController.php @@ -7,8 +7,9 @@ namespace App\Http\Api\Controllers; -use App\Services\Logic\Verify\EmailCode as EmailCodeService; +use App\Services\Logic\Verify\MailCode as MailCodeService; use App\Services\Logic\Verify\SmsCode as SmsCodeService; +use App\Services\Logic\Verify\Ticket as TicketService; /** * @RoutePrefix("/api/verify") @@ -16,6 +17,18 @@ use App\Services\Logic\Verify\SmsCode as SmsCodeService; class VerifyController extends Controller { + /** + * @Post("/ticket", name="api.verify.ticket") + */ + public function ticketAction() + { + $service = new TicketService(); + + $ticket = $service->handle(); + + return $this->jsonSuccess(['ticket' => $ticket]); + } + /** * @Post("/sms/code", name="api.verify.sms_code") */ @@ -29,11 +42,11 @@ class VerifyController extends Controller } /** - * @Post("/email/code", name="api.verify.email_code") + * @Post("/mail/code", name="api.verify.mail_code") */ - public function emailCodeAction() + public function mailCodeAction() { - $service = new EmailCodeService(); + $service = new MailCodeService(); $service->handle(); diff --git a/app/Http/Home/Controllers/Controller.php b/app/Http/Home/Controllers/Controller.php index a977f0eb..f295e6c8 100644 --- a/app/Http/Home/Controllers/Controller.php +++ b/app/Http/Home/Controllers/Controller.php @@ -40,6 +40,11 @@ class Controller extends \Phalcon\Mvc\Controller */ protected $siteInfo; + /** + * @var array + */ + protected $contactInfo; + /** * @var array */ @@ -83,6 +88,7 @@ class Controller extends \Phalcon\Mvc\Controller $this->seo = $this->getSeo(); $this->navs = $this->getNavs(); $this->appInfo = $this->getAppInfo(); + $this->contactInfo = $this->getContactInfo(); $this->imInfo = $this->getImInfo(); $this->seo->setTitle($this->siteInfo['title']); @@ -92,6 +98,7 @@ class Controller extends \Phalcon\Mvc\Controller $this->view->setVar('auth_user', $this->authUser); $this->view->setVar('app_info', $this->appInfo); $this->view->setVar('site_info', $this->siteInfo); + $this->view->setVar('contact_info', $this->contactInfo); $this->view->setVar('im_info', $this->imInfo); } @@ -122,6 +129,11 @@ class Controller extends \Phalcon\Mvc\Controller return $this->getSettings('site'); } + protected function getContactInfo() + { + return $this->getSettings('contact'); + } + protected function getAppInfo() { return new AppInfo(); diff --git a/app/Http/Home/Controllers/VerifyController.php b/app/Http/Home/Controllers/VerifyController.php index 0dbdbac4..f494fed8 100644 --- a/app/Http/Home/Controllers/VerifyController.php +++ b/app/Http/Home/Controllers/VerifyController.php @@ -7,7 +7,7 @@ namespace App\Http\Home\Controllers; -use App\Services\Logic\Verify\EmailCode as EmailCodeService; +use App\Services\Logic\Verify\MailCode as MailCodeService; use App\Services\Logic\Verify\SmsCode as SmsCodeService; use App\Traits\Response as ResponseTrait; @@ -32,11 +32,11 @@ class VerifyController extends \Phalcon\Mvc\Controller } /** - * @Post("/email/code", name="home.verify.email_code") + * @Post("/mail/code", name="home.verify.mail_code") */ - public function emailCodeAction() + public function mailCodeAction() { - $service = new EmailCodeService(); + $service = new MailCodeService(); $service->handle(); diff --git a/app/Http/Home/Services/Index.php b/app/Http/Home/Services/Index.php index 1be67b97..1b40674e 100644 --- a/app/Http/Home/Services/Index.php +++ b/app/Http/Home/Services/Index.php @@ -31,12 +31,9 @@ class Index extends Service */ $slides = $cache->get(); - if (empty($slides)) { - return []; - } + if (empty($slides)) return []; foreach ($slides as $key => $slide) { - switch ($slide['target']) { case SlideModel::TARGET_COURSE: $slides[$key]['url'] = $this->url->get([ @@ -53,8 +50,6 @@ class Index extends Service case SlideModel::TARGET_LINK: $slides[$key]['url'] = $slide['content']; break; - default: - break; } } diff --git a/app/Http/Home/Views/help/index.volt b/app/Http/Home/Views/help/index.volt index 88eb4a15..c691a0e4 100644 --- a/app/Http/Home/Views/help/index.volt +++ b/app/Http/Home/Views/help/index.volt @@ -34,9 +34,10 @@
客户服务

没解决你的疑问?试试联系客服吧!

- {% if im_info.cs.enabled == 1 %} + {% if contact_info.qq %} + {% set link_url = 'https://wpa.qq.com/msgrd?v=3&uin=%s&site=qq&menu=yes'|format(contact_info.qq) %}

- + 联系客服

{% endif %}
diff --git a/app/Http/Home/Views/partials/footer.volt b/app/Http/Home/Views/partials/footer.volt index 9ac1d4a5..b67b94ef 100644 --- a/app/Http/Home/Views/partials/footer.volt +++ b/app/Http/Home/Views/partials/footer.volt @@ -1,22 +1,50 @@
-
-
- {% for nav in navs.bottom %} - {{ nav.name }} - {% endfor %} -
- + + +
+ {% if contact_info.qq %} + {% set link_url = 'https://wpa.qq.com/msgrd?v=3&uin=%s&site=qq&menu=yes'|format(contact_info.qq) %} + + {% endif %} + {% if contact_info.wechat %} + + {% endif %} + {% if contact_info.toutiao %} + + {% endif %} + {% if contact_info.weibo %} + {% set link_url = 'https://weibo.com/u/%s'|format(contact_info.weibo) %} + + {% endif %} + {% if contact_info.zhihu %} + {% set link_url = 'https://www.zhihu.com/people/%s'|format(contact_info.zhihu) %} + + {% endif %} + {% if contact_info.email %} + {% set link_url = 'mailto:%s'|format(contact_info.email) %} + + {% endif %} + {% if contact_info.phone %} + + {% endif %} + {% if contact_info.address %} + {% set link_url = 'https://map.baidu.com/search/%s?querytype=s&wd=%s'|format(contact_info.address,contact_info.address) %} + + {% endif %}
-
\ No newline at end of file diff --git a/app/Http/Home/Views/partials/js_vars.volt b/app/Http/Home/Views/partials/js_vars.volt index 167c38e0..f66dcc30 100644 --- a/app/Http/Home/Views/partials/js_vars.volt +++ b/app/Http/Home/Views/partials/js_vars.volt @@ -8,6 +8,17 @@ vip: '{{ auth_user.vip }}' }; + window.contact = { + qq: '{{ contact_info.qq }}', + wechat: '{{ contact_info.wechat }}', + toutiao: '{{ contact_info.toutiao }}', + weibo: '{{ contact_info.weibo }}', + zhihu: '{{ contact_info.zhihu }}', + phone: '{{ contact_info.phone }}', + email: '{{ contact_info.email }}', + address: '{{ contact_info.address }}' + }; + window.im = { main: { title: '{{ im_info.main.title }}', diff --git a/app/Http/Home/Views/templates/main.volt b/app/Http/Home/Views/templates/main.volt index cb3f3e70..0e1fdec0 100644 --- a/app/Http/Home/Views/templates/main.volt +++ b/app/Http/Home/Views/templates/main.volt @@ -13,6 +13,8 @@ {% else %} {{ icon_link('favicon.ico') }} {% endif %} + + {{ css_link('lib/layui/css/layui.css') }} {{ css_link('home/css/common.css') }} {% block link_css %}{% endblock %} diff --git a/app/Library/AppInfo.php b/app/Library/AppInfo.php index 28255fe9..ce5f1a17 100644 --- a/app/Library/AppInfo.php +++ b/app/Library/AppInfo.php @@ -16,7 +16,7 @@ class AppInfo protected $link = 'https://koogua.com'; - protected $version = '1.4.2'; + protected $version = '1.4.3'; public function __get($name) { diff --git a/app/Repos/ArticleFavorite.php b/app/Repos/ArticleFavorite.php index 2affdf10..ec43be57 100644 --- a/app/Repos/ArticleFavorite.php +++ b/app/Repos/ArticleFavorite.php @@ -30,6 +30,10 @@ class ArticleFavorite extends Repository $builder->andWhere('user_id = :user_id:', ['user_id' => $where['user_id']]); } + if (isset($where['deleted'])) { + $builder->andWhere('deleted = :deleted:', ['deleted' => $where['deleted']]); + } + switch ($sort) { default: $orderBy = 'id DESC'; diff --git a/app/Repos/QuestionFavorite.php b/app/Repos/QuestionFavorite.php index 0cc5ba4e..e0834171 100644 --- a/app/Repos/QuestionFavorite.php +++ b/app/Repos/QuestionFavorite.php @@ -30,6 +30,10 @@ class QuestionFavorite extends Repository $builder->andWhere('user_id = :user_id:', ['user_id' => $where['user_id']]); } + if (isset($where['deleted'])) { + $builder->andWhere('deleted = :deleted:', ['deleted' => $where['deleted']]); + } + switch ($sort) { default: $orderBy = 'id DESC'; diff --git a/app/Services/ChapterVod.php b/app/Services/ChapterVod.php index 0a02198d..8f11bc3b 100644 --- a/app/Services/ChapterVod.php +++ b/app/Services/ChapterVod.php @@ -89,9 +89,9 @@ class ChapterVod extends Service protected function getVodTemplates() { return [ - 'hd' => ['height' => 720, 'rate' => 1800], - 'sd' => ['height' => 540, 'rate' => 1000], - 'fd' => ['height' => 360, 'rate' => 400], + 'hd' => ['height' => 1080, 'rate' => 2500], + 'sd' => ['height' => 720, 'rate' => 1800], + 'fd' => ['height' => 540, 'rate' => 1000], ]; } diff --git a/app/Services/Logic/Chapter/BasicInfo.php b/app/Services/Logic/Chapter/BasicInfo.php index 90bfdfca..e9a4e84c 100644 --- a/app/Services/Logic/Chapter/BasicInfo.php +++ b/app/Services/Logic/Chapter/BasicInfo.php @@ -70,6 +70,13 @@ class BasicInfo extends LogicService $playUrls = $chapterVodService->getPlayUrls($chapter->id); + /** + *过滤播放地址为空的条目 + */ + foreach ($playUrls as $key => $value) { + if (empty($value['url'])) unset($playUrls[$key]); + } + return [ 'id' => $chapter->id, 'title' => $chapter->title, diff --git a/app/Services/Logic/Verify/EmailCode.php b/app/Services/Logic/Verify/MailCode.php similarity index 82% rename from app/Services/Logic/Verify/EmailCode.php rename to app/Services/Logic/Verify/MailCode.php index 2e359c06..9a04d1dc 100644 --- a/app/Services/Logic/Verify/EmailCode.php +++ b/app/Services/Logic/Verify/MailCode.php @@ -7,12 +7,12 @@ namespace App\Services\Logic\Verify; -use App\Services\Logic\Notice\Mail\Verify as VerifyMailService; +use App\Services\Logic\Notice\Mail\Verify as MailVerifyService; use App\Services\Logic\Service as LogicService; use App\Validators\Captcha as CaptchaValidator; use App\Validators\Verify as VerifyValidator; -class EmailCode extends LogicService +class MailCode extends LogicService { public function handle() @@ -27,7 +27,7 @@ class EmailCode extends LogicService $validator->checkCode($post['ticket'], $post['rand']); - $service = new VerifyMailService(); + $service = new MailVerifyService(); $service->handle($post['email']); } diff --git a/app/Services/Logic/Verify/Ticket.php b/app/Services/Logic/Verify/Ticket.php new file mode 100644 index 00000000..b42c1915 --- /dev/null +++ b/app/Services/Logic/Verify/Ticket.php @@ -0,0 +1,27 @@ +request->getPost('rand', ['trim', 'string']); + + $validator = new VerifyValidator(); + + $rand = $validator->checkRand($rand); + + return $this->crypt->encryptBase64($rand); + } + +} diff --git a/app/Services/MyStorage.php b/app/Services/MyStorage.php index b7326442..157855e5 100644 --- a/app/Services/MyStorage.php +++ b/app/Services/MyStorage.php @@ -119,26 +119,6 @@ class MyStorage extends Storage return $this->putFile($key, $filename); } - /** - * 上传站点LOGO - * - * @return UploadModel|bool - */ - public function uploadSiteLogo() - { - return $this->upload('/img/icon/', self::MIME_IMAGE, UploadModel::TYPE_DEFAULT_IMG); - } - - /** - * 上传站点ICON - * - * @return UploadModel|bool - */ - public function uploadSiteFavicon() - { - return $this->upload('/img/icon/', self::MIME_IMAGE, UploadModel::TYPE_DEFAULT_IMG); - } - /** * 上传封面图片 * diff --git a/app/Services/Vod.php b/app/Services/Vod.php index 364d8b7a..19c03e6c 100644 --- a/app/Services/Vod.php +++ b/app/Services/Vod.php @@ -633,15 +633,15 @@ class Vod extends Service public function getVideoTransTemplates() { $hlsTemplates = [ - 100210 => ['quality' => 'fd', 'height' => 360, 'bit_rate' => 400, 'frame_rate' => 25], - 100220 => ['quality' => 'sd', 'height' => 540, 'bit_rate' => 1000, 'frame_rate' => 25], - 100230 => ['quality' => 'hd', 'height' => 720, 'bit_rate' => 1800, 'frame_rate' => 25], + 100220 => ['quality' => 'fd', 'height' => 540, 'bit_rate' => 1000, 'frame_rate' => 25], + 100230 => ['quality' => 'sd', 'height' => 720, 'bit_rate' => 1800, 'frame_rate' => 25], + 100240 => ['quality' => 'hd', 'height' => 1080, 'bit_rate' => 2500, 'frame_rate' => 25], ]; $mp4Templates = [ - 100010 => ['quality' => 'fd', 'height' => 360, 'bit_rate' => 400, 'frame_rate' => 25], - 100020 => ['quality' => 'sd', 'height' => 540, 'bit_rate' => 1000, 'frame_rate' => 25], - 100030 => ['quality' => 'hd', 'height' => 720, 'bit_rate' => 1800, 'frame_rate' => 25], + 100020 => ['quality' => 'fd', 'height' => 540, 'bit_rate' => 1000, 'frame_rate' => 25], + 100030 => ['quality' => 'sd', 'height' => 720, 'bit_rate' => 1800, 'frame_rate' => 25], + 100040 => ['quality' => 'hd', 'height' => 360, 'bit_rate' => 2500, 'frame_rate' => 25], ]; $format = $this->settings['video_format'] ?: 'hls'; diff --git a/app/Validators/Verify.php b/app/Validators/Verify.php index 1176e207..3e991c4b 100644 --- a/app/Validators/Verify.php +++ b/app/Validators/Verify.php @@ -65,4 +65,28 @@ class Verify extends Validator } } + public function checkRand($rand) + { + list($time, $number) = explode('-', $rand); + + if (abs($time - time()) > 300) { + throw new BadRequestException('verify.invalid_rand'); + } + + if ($number < 1000 || $number > 9999) { + throw new BadRequestException('verify.invalid_rand'); + } + + return $rand; + } + + public function checkTicket($ticket, $rand) + { + $ticket = $this->crypt->decrypt($ticket); + + if ($ticket != $rand) { + throw new BadRequestException('verify.invalid_ticket'); + } + } + } diff --git a/db/migrations/20210820064755.php b/db/migrations/20210820064755.php new file mode 100644 index 00000000..69769783 --- /dev/null +++ b/db/migrations/20210820064755.php @@ -0,0 +1,66 @@ +handleContactSetting(); + } + + protected function handleContactSetting() + { + $rows = [ + [ + 'section' => 'contact', + 'item_key' => 'qq', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'wechat', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'toutiao', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'weibo', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'zhihu', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'email', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'phone', + 'item_value' => '', + ], + [ + 'section' => 'contact', + 'item_key' => 'address', + 'item_value' => '', + ], + ]; + + $this->table('kg_setting')->insert($rows)->save(); + } + +} diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css index 95d596df..1e01acbf 100644 --- a/public/static/home/css/common.css +++ b/public/static/home/css/common.css @@ -233,27 +233,39 @@ background: none; } +#footer .row { + line-height: 18px; + margin-bottom: 15px; +} + +#footer .row:last-child { + margin-bottom: 0; +} + +#footer .contact { + line-height: 24px; +} + #footer span, #footer a { color: #999; } -#footer a:hover { +#footer a:hover, +#footer .iconfont:hover { color: #fff; } -.bottom-nav { - margin-bottom: 10px; - line-height: 18px; -} - -.copyright { - line-height: 18px; -} - -.bottom-nav a, .copyright span, .copyright a { +#footer .nav a, +#footer .copyright span, +#footer .copyright a, +#footer .contact a { margin-right: 10px; } +#footer .iconfont { + font-size: 20px; +} + .layout-sidebar .loading { padding: 15px; text-align: center; diff --git a/public/static/home/js/captcha.verify.js b/public/static/home/js/captcha.verify.js index 6322b529..13fe91c3 100644 --- a/public/static/home/js/captcha.verify.js +++ b/public/static/home/js/captcha.verify.js @@ -25,7 +25,7 @@ layui.use(['jquery', 'util'], function () { postUrl = '/verify/sms/code'; } else if (isEmail($account.val())) { postData.email = $account.val(); - postUrl = '/verify/email/code'; + postUrl = '/verify/mail/code'; } $.ajax({ type: 'POST', diff --git a/public/static/home/js/chapter.live.player.js b/public/static/home/js/chapter.live.player.js index 9dca40de..d842d16e 100644 --- a/public/static/home/js/chapter.live.player.js +++ b/public/static/home/js/chapter.live.player.js @@ -25,11 +25,11 @@ layui.use(['jquery', 'helper'], function () { $.each(formats, function (i, format) { $.each(rates, function (k, rate) { if (playUrls.hasOwnProperty(format) && playUrls[format].hasOwnProperty(rate.name)) { - quality[k] = { + quality.push({ name: rate.label, url: playUrls[format][rate.name], type: 'flv', - }; + }); } }); }); diff --git a/public/static/home/js/chapter.vod.player.js b/public/static/home/js/chapter.vod.player.js index 2ea203bc..d1041bf6 100644 --- a/public/static/home/js/chapter.vod.player.js +++ b/public/static/home/js/chapter.vod.player.js @@ -22,13 +22,15 @@ layui.use(['jquery', 'helper'], function () { $.each(rates, function (k, rate) { if (playUrls.hasOwnProperty(rate.name)) { - quality[k] = { + quality.push({ name: rate.label, url: playUrls[rate.name]['url'], - }; + }); } }); + console.log(quality) + var player = new DPlayer({ container: document.getElementById('player'), video: { diff --git a/public/static/home/js/fixbar.js b/public/static/home/js/fixbar.js index 283a717e..6b9f952a 100644 --- a/public/static/home/js/fixbar.js +++ b/public/static/home/js/fixbar.js @@ -1,16 +1,50 @@ -layui.use(['helper', 'util'], function () { +layui.use(['jquery', 'helper', 'util'], function () { - var helper = layui.helper; + var $ = layui.jquery; var util = layui.util; + var showQQDialog = function () { + window.open('https://wpa.qq.com/msgrd?v=3&uin=' + window.contact.qq + '&site=qq&menu=yes'); + } + + var showWechatCode = function () { + var content = '
扫码关注
'; + layer.open({ + type: 1, + title: false, + closeBtn: 0, + shadeClose: true, + content: content + }); + } + + var showTouTiaoCode = function () { + var content = '
扫码关注
'; + layer.open({ + type: 1, + title: false, + closeBtn: 0, + shadeClose: true, + content: content + }); + } + + $('.icon-wechat').on('click', function () { + showWechatCode(); + }); + + $('.icon-toutiao').on('click', function () { + showTouTiaoCode(); + }); + util.fixbar({ - bar1: window.im.cs.enabled === '1' ? '' : false, - bar2: true, + bar1: window.contact.qq ? '' : false, + bar2: window.contact.wechat ? '' : false, click: function (type) { if (type === 'bar1') { - helper.cs(); + showQQDialog(); } else if (type === 'bar2') { - window.open('/help', 'help'); + showWechatCode(); } } });