租房小程序前端代码
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.

23 lines
666 B

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