tag:去掉了OSS中的版本参数。

This commit is contained in:
徐涛
2021-05-05 11:44:51 +08:00
parent 8e6d988376
commit 2a6fa60587
2 changed files with 17 additions and 18 deletions

View File

@@ -1,20 +1,20 @@
hexo.extend.tag.register('oss_video', function(args) {
let { config } = hexo;
let src = args[0] || '';
let versionId = args[1] || '';
if (src.length === 0 || versionId.length === 0) {
let src = args.shift() || '';
// let versionId = args[1] || '';
if (src.length === 0) {
return '';
}
let fullUrl = `${config.oss.endpoint}/${src}?versionId=${versionId}`;
let fullUrl = `${config.oss.endpoint}/${src}`;
let affix = src.substring(src.lastIndexOf('.') + 1);
let attrs = []
attrs.push('controls');
attrs.push('muted="true"');
let width = args[2] || 0;
let height = args[3] || 0;
let width = args.shift() || 0;
let height = args.shift() || 0;
if (width !== 0) {
attrs.push(`width="${width}"`);
}