mirror of https://github.com/halo-dev/halo-admin
feat: 附件上传增加华为云OBS支持 (#126)
parent
2fd8d14371
commit
aeccc396b2
|
@ -113,6 +113,10 @@ attachmentApi.type = {
|
||||||
TENCENTCOS: {
|
TENCENTCOS: {
|
||||||
type: 'TENCENTCOS',
|
type: 'TENCENTCOS',
|
||||||
text: '腾讯云'
|
text: '腾讯云'
|
||||||
|
},
|
||||||
|
HUAWEIOBS: {
|
||||||
|
type: 'HUAWEIOBS',
|
||||||
|
text: '华为云'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,65 @@
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
id="huaweiObsForm"
|
||||||
|
v-show="options.attachment_type === 'HUAWEIOBS'"
|
||||||
|
>
|
||||||
|
<a-form-item label="绑定域名协议:">
|
||||||
|
<a-select v-model="options.obs_huawei_domain_protocol">
|
||||||
|
<a-select-option value="https://">HTTPS</a-select-option>
|
||||||
|
<a-select-option value="http://">HTTP</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="绑定域名:">
|
||||||
|
<a-input
|
||||||
|
v-model="options.obs_huawei_domain"
|
||||||
|
placeholder="如不填写,路径根域名将为 Bucket + EndPoint"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="Bucket(桶名称):">
|
||||||
|
<a-input
|
||||||
|
v-model="options.obs_huawei_bucket_name"
|
||||||
|
placeholder="桶名称"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="EndPoint(终端节点):">
|
||||||
|
<a-input
|
||||||
|
v-model="options.obs_huawei_endpoint"
|
||||||
|
placeholder="Endpoint"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="Access Key:">
|
||||||
|
<a-input-password
|
||||||
|
v-model="options.obs_huawei_access_key"
|
||||||
|
autocomplete="new-password"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="Access Secret:">
|
||||||
|
<a-input-password
|
||||||
|
v-model="options.obs_huawei_access_secret"
|
||||||
|
autocomplete="new-password"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="文件目录:">
|
||||||
|
<a-input
|
||||||
|
v-model="options.obs_huawei_source"
|
||||||
|
placeholder="不填写则上传到根目录"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="图片处理策略:">
|
||||||
|
<a-input
|
||||||
|
v-model="options.obs_huawei_style_rule"
|
||||||
|
placeholder="请到华为云控制台的图片处理创建"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="缩略图处理策略:">
|
||||||
|
<a-input
|
||||||
|
v-model="options.obs_huawei_thumbnail_style_rule"
|
||||||
|
placeholder="请到华为云控制台的图片处理获取,一般为后台展示所用"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</div>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -569,6 +628,36 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case 'HUAWEIOBS':
|
||||||
|
if (!this.options.obs_huawei_bucket_name) {
|
||||||
|
this.$notification['error']({
|
||||||
|
message: '提示',
|
||||||
|
description: 'Bucket 不能为空!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.options.obs_huawei_endpoint) {
|
||||||
|
this.$notification['error']({
|
||||||
|
message: '提示',
|
||||||
|
description: 'EndPoint(终端节点) 不能为空!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.options.obs_huawei_access_key) {
|
||||||
|
this.$notification['error']({
|
||||||
|
message: '提示',
|
||||||
|
description: 'Access Key 不能为空!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.options.obs_huawei_access_secret) {
|
||||||
|
this.$notification['error']({
|
||||||
|
message: '提示',
|
||||||
|
description: 'Access Secret 不能为空!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
this.$emit('onSave')
|
this.$emit('onSave')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue