diff --git a/app/Http/Admin/Controllers/UploadController.php b/app/Http/Admin/Controllers/UploadController.php
index 432e5129..ca020f3b 100644
--- a/app/Http/Admin/Controllers/UploadController.php
+++ b/app/Http/Admin/Controllers/UploadController.php
@@ -71,28 +71,6 @@ class UploadController extends Controller
return $this->jsonSuccess(['data' => $data]);
}
- /**
- * @Post("/avatar/img", name="admin.upload.avatar_img")
- */
- public function uploadAvatarImageAction()
- {
- $service = new StorageService();
-
- $file = $service->uploadAvatarImage();
-
- if (!$file) {
- return $this->jsonError(['msg' => '上传文件失败']);
- }
-
- $data = [
- 'id' => $file->id,
- 'name' => $file->name,
- 'url' => $service->getImageUrl($file->path),
- ];
-
- return $this->jsonSuccess(['data' => $data]);
- }
-
/**
* @Post("/content/img", name="admin.upload.content_img")
*/
diff --git a/app/Http/Home/Views/help/show.volt b/app/Http/Home/Views/help/show.volt
index 881d0200..10ec7d97 100644
--- a/app/Http/Home/Views/help/show.volt
+++ b/app/Http/Home/Views/help/show.volt
@@ -45,17 +45,10 @@
{% endblock %}
-{% block inline_js %}
+{% block include_js %}
-
+ {{ js_include('lib/clipboard.min.js') }}
+ {{ js_include('home/js/help.show.js') }}
+ {{ js_include('home/js/copy.js') }}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/app/Http/Home/Views/page/show.volt b/app/Http/Home/Views/page/show.volt
index 47db6f58..5c8edfd4 100644
--- a/app/Http/Home/Views/page/show.volt
+++ b/app/Http/Home/Views/page/show.volt
@@ -44,17 +44,10 @@
{% endblock %}
-{% block inline_js %}
+{% block include_js %}
-
+ {{ js_include('lib/clipboard.min.js') }}
+ {{ js_include('home/js/page.show.js') }}
+ {{ js_include('home/js/copy.js') }}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/app/Http/Home/Views/user/console/profile.volt b/app/Http/Home/Views/user/console/profile.volt
index 1574d1fd..8a47b597 100644
--- a/app/Http/Home/Views/user/console/profile.volt
+++ b/app/Http/Home/Views/user/console/profile.volt
@@ -79,7 +79,6 @@
{% block include_js %}
- {{ js_include('home/js/user.avatar.upload.js') }}
{{ js_include('home/js/user.console.profile.js') }}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/db/migrations/20210403184518.php b/db/migrations/20210403184518.php
index 3186f788..b06c86bd 100644
--- a/db/migrations/20210403184518.php
+++ b/db/migrations/20210403184518.php
@@ -497,17 +497,17 @@ final class V20210403184518 extends AbstractMigration
[
'section' => 'secret',
'item_key' => 'secret_key',
- 'item_value' => '',
+ 'item_value' => 'xxx',
],
[
'section' => 'secret',
'item_key' => 'secret_id',
- 'item_value' => '',
+ 'item_value' => 'xxx',
],
[
'section' => 'secret',
'item_key' => 'app_id',
- 'item_value' => '',
+ 'item_value' => 'xxx',
],
[
'section' => 'site',
@@ -619,12 +619,12 @@ final class V20210403184518 extends AbstractMigration
[
'section' => 'cos',
'item_key' => 'bucket',
- 'item_value' => '',
+ 'item_value' => 'course-1255691183',
],
[
'section' => 'cos',
'item_key' => 'region',
- 'item_value' => '',
+ 'item_value' => 'ap-guangzhou',
],
[
'section' => 'cos',
@@ -634,7 +634,7 @@ final class V20210403184518 extends AbstractMigration
[
'section' => 'cos',
'item_key' => 'domain',
- 'item_value' => '',
+ 'item_value' => 'course-1255691183.file.myqcloud.com',
],
[
'section' => 'vod',
diff --git a/public/static/admin/js/avatar.upload.js b/public/static/admin/js/avatar.upload.js
deleted file mode 100644
index 6f235d29..00000000
--- a/public/static/admin/js/avatar.upload.js
+++ /dev/null
@@ -1,44 +0,0 @@
-layui.use(['jquery', 'layer', 'upload'], function () {
-
- var $ = layui.jquery;
- var layer = layui.layer;
- var upload = layui.upload;
-
- upload.render({
- elem: '#change-avatar',
- url: '/admin/upload/avatar/img',
- accept: 'images',
- acceptMime: 'image/*',
- size: 512,
- auto: false,
- before: function () {
- layer.load();
- },
- choose: function (obj) {
- var flag = true;
- obj.preview(function (index, file, result) {
- var img = new Image();
- img.src = result;
- img.onload = function () {
- if (img.width < 1000 && img.height < 1000) {
- obj.upload(index, file);
- } else {
- flag = false;
- layer.msg("图片尺寸必须小于 1000 * 1000");
- return false;
- }
- };
- return flag;
- });
- },
- done: function (res, index, upload) {
- $('#img-avatar').attr('src', res.data.url);
- $('input[name=avatar]').val(res.data.url);
- layer.closeAll('loading');
- },
- error: function (index, upload) {
- layer.msg('上传文件失败', {icon: 2});
- }
- });
-
-});
\ No newline at end of file
diff --git a/public/static/home/js/help.show.js b/public/static/home/js/help.show.js
new file mode 100644
index 00000000..2e9a7403
--- /dev/null
+++ b/public/static/home/js/help.show.js
@@ -0,0 +1,12 @@
+layui.use(['jquery', 'helper'], function () {
+
+ var $ = layui.jquery;
+ var helper = layui.helper;
+
+ var $courseList = $('#course-list');
+
+ if ($courseList.length > 0) {
+ helper.ajaxLoadHtml($courseList.data('url'), $courseList.attr('id'));
+ }
+
+});
diff --git a/public/static/home/js/page.show.js b/public/static/home/js/page.show.js
new file mode 100644
index 00000000..2e9a7403
--- /dev/null
+++ b/public/static/home/js/page.show.js
@@ -0,0 +1,12 @@
+layui.use(['jquery', 'helper'], function () {
+
+ var $ = layui.jquery;
+ var helper = layui.helper;
+
+ var $courseList = $('#course-list');
+
+ if ($courseList.length > 0) {
+ helper.ajaxLoadHtml($courseList.data('url'), $courseList.attr('id'));
+ }
+
+});
diff --git a/public/static/home/js/user.avatar.upload.js b/public/static/home/js/user.avatar.upload.js
deleted file mode 100644
index 2e468127..00000000
--- a/public/static/home/js/user.avatar.upload.js
+++ /dev/null
@@ -1,44 +0,0 @@
-layui.use(['jquery', 'layer', 'upload'], function () {
-
- var $ = layui.jquery;
- var layer = layui.layer;
- var upload = layui.upload;
-
- upload.render({
- elem: '#change-avatar',
- url: '/upload/avatar/img',
- accept: 'images',
- acceptMime: 'image/*',
- size: 512,
- auto: false,
- before: function () {
- layer.load();
- },
- choose: function (obj) {
- var flag = true;
- obj.preview(function (index, file, result) {
- var img = new Image();
- img.src = result;
- img.onload = function () {
- if (img.width < 1000 && img.height < 1000) {
- obj.upload(index, file);
- } else {
- flag = false;
- layer.msg("图片尺寸必须小于 1000 * 1000");
- return false;
- }
- };
- return flag;
- });
- },
- done: function (res, index, upload) {
- $('#img-avatar').attr('src', res.data.url);
- $('input[name=avatar]').val(res.data.url);
- layer.closeAll('loading');
- },
- error: function (index, upload) {
- layer.msg('上传文件失败', {icon: 2});
- }
- });
-
-});
\ No newline at end of file
diff --git a/public/static/home/js/user.console.profile.js b/public/static/home/js/user.console.profile.js
index 6aa2f380..558813e4 100644
--- a/public/static/home/js/user.console.profile.js
+++ b/public/static/home/js/user.console.profile.js
@@ -1,7 +1,47 @@
-layui.use(['layarea'], function () {
+layui.use(['jquery', 'upload', 'layer', 'layarea'], function () {
+ var $ = layui.jquery;
+ var layer = layui.layer;
+ var upload = layui.upload;
var layarea = layui.layarea;
+ upload.render({
+ elem: '#change-avatar',
+ url: '/upload/avatar/img',
+ accept: 'images',
+ acceptMime: 'image/*',
+ size: 512,
+ auto: false,
+ before: function () {
+ layer.load();
+ },
+ choose: function (obj) {
+ var flag = true;
+ obj.preview(function (index, file, result) {
+ var img = new Image();
+ img.src = result;
+ img.onload = function () {
+ if (img.width < 1000 && img.height < 1000) {
+ obj.upload(index, file);
+ } else {
+ flag = false;
+ layer.msg("图片尺寸必须小于 1000 * 1000");
+ return false;
+ }
+ };
+ return flag;
+ });
+ },
+ done: function (res) {
+ $('#img-avatar').attr('src', res.data.url);
+ $('input[name=avatar]').val(res.data.url);
+ layer.closeAll('loading');
+ },
+ error: function () {
+ layer.msg('上传文件失败', {icon: 2});
+ }
+ });
+
layarea.render({
elem: '#area-picker',
change: function (res) {
@@ -9,4 +49,4 @@ layui.use(['layarea'], function () {
}
});
-});
\ No newline at end of file
+});