Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Aug 30, 2024
2 parents fa9ae6f + 40068d4 commit 0b6929d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions docs/resource/01-request-adapter/06-taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ const uploadFile = (name, filePath, formData) =>
name,
filePath,

// Additional data will be passed into formData of uni.uploadFile
// Additional data will be passed into formData of Taro.uploadFile
...formData
},
{
// Set the request method to upload, and the adapter will call uni.uploadFile
// Set the request method to upload, and the adapter will call Taro.uploadFile
requestType: 'upload'
}
);
Expand Down Expand Up @@ -216,11 +216,11 @@ const App = () => {
name,
filePath,
// Additional data will be passed into formData of uni.uploadFile
// Additional data will be passed into formData of Taro.uploadFile
...formData
},
{
// Set the request method to upload, and the adapter will call uni.uploadFile
// Set the request method to upload, and the adapter will call Taro.uploadFile
requestType: 'upload'
}
);
Expand Down Expand Up @@ -258,7 +258,7 @@ Similarly, it is fully compatible with `Taro.downloadFile`, you can specify [all
```jsx
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// Set the request method to download, and the adapter will call uni.downloadFile
// Set the request method to download, and the adapter will call Taro.downloadFile
requestType: 'download',
filePath
});
Expand Down Expand Up @@ -294,7 +294,7 @@ const App = () => {
<script setup>
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// Set the request method to download, and the adapter will call uni.downloadFile
// Set the request method to download, and the adapter will call Taro.downloadFile
requestType: 'download',
filePath
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ const uploadFile = (name, filePath, formData) =>
name,
filePath,

// 额外数据将传入uni.uploadFile的formData中
// 额外数据将传入Taro.uploadFile的formData中
...formData
},
{
// 设置请求方式为上传,适配器内将调用uni.uploadFile
// 设置请求方式为上传,适配器内将调用Taro.uploadFile
requestType: 'upload'
}
);
Expand Down Expand Up @@ -216,11 +216,11 @@ const App = () => {
name,
filePath,
// 额外数据将传入uni.uploadFile的formData中
// 额外数据将传入Taro.uploadFile的formData中
...formData
},
{
// 设置请求方式为上传,适配器内将调用uni.uploadFile
// 设置请求方式为上传,适配器内将调用Taro.uploadFile
requestType: 'upload'
}
);
Expand Down Expand Up @@ -258,7 +258,7 @@ const App = () => {
```jsx
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// 设置请求方式为下载,适配器内将调用uni.downloadFile
// 设置请求方式为下载,适配器内将调用Taro.downloadFile
requestType: 'download',
filePath
});
Expand Down Expand Up @@ -294,7 +294,7 @@ const App = () => {
<script setup>
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// 设置请求方式为下载,适配器内将调用uni.downloadFile
// 设置请求方式为下载,适配器内将调用Taro.downloadFile
requestType: 'download',
filePath
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ const uploadFile = (name, filePath, formData) =>
name,
filePath,

// 额外数据将传入uni.uploadFile的formData中
// 额外数据将传入Taro.uploadFile的formData中
...formData
},
{
// 设置请求方式为上传,适配器内将调用uni.uploadFile
// 设置请求方式为上传,适配器内将调用Taro.uploadFile
requestType: 'upload',

// 开启上传进度
Expand Down Expand Up @@ -219,11 +219,11 @@ const App = () => {
name,
filePath,
// 额外数据将传入uni.uploadFile的formData中
// 额外数据将传入Taro.uploadFile的formData中
...formData
},
{
// 设置请求方式为上传,适配器内将调用uni.uploadFile
// 设置请求方式为上传,适配器内将调用Taro.uploadFile
requestType: 'upload',
// 开启上传进度
Expand Down Expand Up @@ -264,7 +264,7 @@ const App = () => {
```jsx
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// 设置请求方式为下载,适配器内将调用uni.downloadFile
// 设置请求方式为下载,适配器内将调用Taro.downloadFile
requestType: 'download',
filePath,

Expand Down Expand Up @@ -303,7 +303,7 @@ const App = () => {
<script setup>
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// 设置请求方式为下载,适配器内将调用uni.downloadFile
// 设置请求方式为下载,适配器内将调用Taro.downloadFile
requestType: 'download',
filePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ const uploadFile = (name, filePath, formData) =>
name,
filePath,

// Additional data will be passed into formData of uni.uploadFile
// Additional data will be passed into formData of Taro.uploadFile
...formData
},
{
// Set the request method to upload, and the adapter will call uni.uploadFile
// Set the request method to upload, and the adapter will call Taro.uploadFile
requestType: 'upload',

// Start upload progress
Expand Down Expand Up @@ -219,11 +219,11 @@ const App = () => {
name,
filePath,
// Additional data will be passed into formData of uni.uploadFile
// Additional data will be passed into formData of Taro.uploadFile
...formData
},
{
// Set the request method to upload, and the adapter will call uni.uploadFile
// Set the request method to upload, and the adapter will call Taro.uploadFile
requestType: 'upload',
// Start upload progress
Expand Down Expand Up @@ -264,7 +264,7 @@ Similarly, it is fully compatible with `Taro.downloadFile`, you can specify [all
```jsx
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// Set the request method to download, and the adapter will call uni.downloadFile
// Set the request method to download, and the adapter will call Taro.downloadFile
requestType: 'download',
filePath,

Expand Down Expand Up @@ -303,7 +303,7 @@ const App = () => {
<script setup>
const downloadFile = filePath =>
alovaInst.Get('/bigImage.jpg', {
// Set the request method to download, and the adapter will call uni.downloadFile
// Set the request method to download, and the adapter will call Taro.downloadFile
requestType: 'download',
filePath,
Expand Down

0 comments on commit 0b6929d

Please sign in to comment.