<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ##### 阿里云OSS 瀏覽器直傳 [官方文檔](https://help.aliyun.com/document_detail/64047.html?spm=a2c4g.11174283.6.1236.16ea7da2xmF0Zz) ##### 首先是簽名 也是阿里推薦的 STS模式-即臨時身份令牌 > 由服務器簽發一次,然后客戶端用此實例化OSS對象進行上傳。 ``` // 獲取STS簽名 get_STS() { return new Promise(async (resolve, reject) => { let name = new Date().getTime() + Math.random(); let operate = "uploadImg"; let that = this; // 請求后端接口獲取STS簽名,此處為后端需要的參數,基本都是自定義的 也可不傳。 let res = await get_STS({ name, operate, sign: crypto.MD5(name + operate + "bayinabayin888").toString() }); if (res.data.code != 200) { that.$alert(res.data.message || res.data.msg); } else { resolve(res.data.data); } }); } ``` ``` // 上傳單圖 let OSS = require('ali-oss'); // img_blob為選擇的文件對象 async upload_img_to_oss(img_blob) { return new Promise(async (resolve, reject) => { let oss_sign = await this.get_STS(); let client = new OSS({ accessKeyId: oss_sign.AccessKeyId, accessKeySecret: oss_sign.AccessKeySecret, stsToken: oss_sign.SecurityToken, endpoint: "oss-cn-beijing.aliyuncs.com/", bucket: "xxx-test" }); let result = await client.put( "xxx/" + oss_sign.AccessKeyId, img_blob ); // console.log(result); resolve(result); }); } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看