1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-17 15:55:31 +08:00

还原几个不能为空的腾讯云配置

This commit is contained in:
xiaochong0302 2025-05-22 23:31:12 +08:00
parent 59bfe4a765
commit 12db90d9c1
10 changed files with 83 additions and 144 deletions

View File

@ -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")
*/

View File

@ -31,17 +31,10 @@
{% endblock %}
{% block inline_js %}
{% block include_js %}
<script>
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'));
}
});
</script>
{{ js_include('lib/clipboard.min.js') }}
{{ js_include('home/js/help.show.js') }}
{{ js_include('home/js/copy.js') }}
{% endblock %}
{% endblock %}

View File

@ -30,17 +30,10 @@
{% endblock %}
{% block inline_js %}
{% block include_js %}
<script>
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'));
}
});
</script>
{{ js_include('lib/clipboard.min.js') }}
{{ js_include('home/js/page.show.js') }}
{{ js_include('home/js/copy.js') }}
{% endblock %}
{% endblock %}

View File

@ -79,7 +79,6 @@
{% block include_js %}
{{ js_include('home/js/user.avatar.upload.js') }}
{{ js_include('home/js/user.console.profile.js') }}
{% endblock %}
{% endblock %}

View File

@ -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',

View File

@ -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});
}
});
});

View File

@ -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'));
}
});

View File

@ -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'));
}
});

View File

@ -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});
}
});
});

View File

@ -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 () {
}
});
});
});