鍍金池/ 問答/HTML/ react里使用阿里oss上傳報(bào)錯(cuò)OSS is not defined

react里使用阿里oss上傳報(bào)錯(cuò)OSS is not defined

react里使用阿里oss上傳時(shí)報(bào)的這個(gè)錯(cuò),是什么原因呢
Uncaught (in promise) ReferenceError: OSS is not defined

getClient = () => {
    const { dispatch } = this.props;
    dispatch({
      type: 'business/upPic',
      payload: {},
    }).then(()=>{
      return new OSS.Wrapper({
        accessKeyId: ossData.accessKeyId,
        accessKeySecret: ossData.accessKeySecret,
        stsToken: ossData.securityToken,
        endpoint: ossData.endpoint,
        bucket: ossData.bucket
      });
    });
};
回答
編輯回答
枕頭人

promise-6.1.0.min.js 和 aliyun-oss-sdk.min.js 全局引入的?給OSS加個(gè)window。

window.OSS
2018年1月4日 06:08