提交 f6af2449 编写于 作者: VK1688's avatar VK1688

update: ext-storage\dev.md

上级 37debae6
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
```js ```js
const extStorageManager = uniCloud.getExtStorageManager({ const extStorageManager = uniCloud.getExtStorageManager({
provider: "qiniu", // 扩展存储供应商 provider: "qiniu", // 扩展存储供应商
domain: "你的扩展存储域名", // 带http协议头的域名地址 domain: "https://example.com", // 带https协议头的域名地址
}); });
``` ```
...@@ -30,7 +30,7 @@ const extStorageManager = uniCloud.getExtStorageManager({ ...@@ -30,7 +30,7 @@ const extStorageManager = uniCloud.getExtStorageManager({
|参数名 |类型 |必填 |默认值 |说明 | |参数名 |类型 |必填 |默认值 |说明 |
|:-: |:-: |:-: |:-: |:-: | |:-: |:-: |:-: |:-: |:-: |
|provider |String |是 |- |扩展存储供应商,可选<br/>qiniu: 七牛云| |provider |String |是 |- |扩展存储供应商,可选<br/>qiniu: 七牛云|
|domain |String |是 |- |你的扩展存储域名(带http协议头的域名地址) | |domain |String |是 |- |[](https://example.com)(带https协议头的域名地址) |
### 获取前端上传参数 ### 获取前端上传参数
...@@ -54,7 +54,7 @@ module.exports = { ...@@ -54,7 +54,7 @@ module.exports = {
// 然后获取 extStorageManager 对象实例 // 然后获取 extStorageManager 对象实例
const extStorageManager = uniCloud.getExtStorageManager({ const extStorageManager = uniCloud.getExtStorageManager({
provider: "qiniu", provider: "qiniu",
domain: "你的扩展存储域名", // 带http协议头的域名地址 domain: "https://example.com", // 带https协议头的域名地址
}); });
// 最后调用 extStorageManager.getUploadFileOptions // 最后调用 extStorageManager.getUploadFileOptions
let uploadFileOptionsRes = extStorageManager.getUploadFileOptions({ let uploadFileOptionsRes = extStorageManager.getUploadFileOptions({
...@@ -131,7 +131,7 @@ uni.chooseImage({ ...@@ -131,7 +131,7 @@ uni.chooseImage({
```js ```js
const extStorageManager = uniCloud.getExtStorageManager({ const extStorageManager = uniCloud.getExtStorageManager({
provider: "qiniu", provider: "qiniu",
domain: "你的扩展存储域名", // 带http协议头的域名地址 domain: "https://example.com", // 带https协议头的域名地址
}); });
// 文件的base64值 // 文件的base64值
let base64 = let base64 =
...@@ -178,7 +178,7 @@ console.log('uploadFile: ', res); ...@@ -178,7 +178,7 @@ console.log('uploadFile: ', res);
```js ```js
const extStorageManager = uniCloud.getExtStorageManager({ const extStorageManager = uniCloud.getExtStorageManager({
provider: "qiniu", provider: "qiniu",
domain: "你的扩展存储域名", // 带http协议头的域名地址 domain: "https://example.com", // 带https协议头的域名地址
}); });
let res = extStorageManager.getTempFileURL({ let res = extStorageManager.getTempFileURL({
fileList: ["qiniu://test.jpg"], // 私有文件地址列表 fileList: ["qiniu://test.jpg"], // 私有文件地址列表
...@@ -218,7 +218,7 @@ return res; ...@@ -218,7 +218,7 @@ return res;
```js ```js
const extStorageManager = uniCloud.getExtStorageManager({ const extStorageManager = uniCloud.getExtStorageManager({
provider: "qiniu", provider: "qiniu",
domain: "你的扩展存储域名", // 带http协议头的域名地址 domain: "https://example.com", // 带https协议头的域名地址
}); });
let res = await extStorageManager.deleteFile({ let res = await extStorageManager.deleteFile({
fileList: ["qiniu://test.jpg"], // 私有文件地址列表 fileList: ["qiniu://test.jpg"], // 私有文件地址列表
...@@ -252,7 +252,7 @@ return res; ...@@ -252,7 +252,7 @@ return res;
```js ```js
const extStorageManager = uniCloud.getExtStorageManager({ const extStorageManager = uniCloud.getExtStorageManager({
provider: "qiniu", provider: "qiniu",
domain: "你的扩展存储域名", // 带http协议头的域名地址 domain: "https://example.com", // 带https协议头的域名地址
}); });
let res = await extStorageManager.updateFileStatus({ let res = await extStorageManager.updateFileStatus({
fileID: "qiniu://test.jpg", // 私有文件id fileID: "qiniu://test.jpg", // 私有文件id
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册