租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
693 B

3 months ago
  1. const proto = exports;
  2. /*
  3. * Set object's ACL
  4. * @param {String} name the object key
  5. * @param {String} acl the object ACL
  6. * @param {Object} options
  7. */
  8. proto.putACL = async function putACL(name, acl, options) {
  9. options = options || {};
  10. options.subres = Object.assign({ acl: '' }, options.subres);
  11. if (options.versionId) {
  12. options.subres.versionId = options.versionId;
  13. }
  14. options.headers = options.headers || {};
  15. options.headers['x-oss-object-acl'] = acl;
  16. name = this._objectName(name);
  17. const params = this._objectRequestParams('PUT', name, options);
  18. params.successStatuses = [200];
  19. const result = await this.request(params);
  20. return {
  21. res: result.res
  22. };
  23. };