-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
548 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const ResultUtil = require('../_util/resultUtil'); | ||
const Mock = require('mockjs'); | ||
|
||
module.exports = { | ||
'GET /file/upload ': ({ query }) => { | ||
const key = 'items|' + query.total; | ||
const mock = {}; | ||
mock[key] = [ | ||
{ | ||
id: '@id', | ||
'url|1': [ | ||
'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', | ||
'https://picsum.photos/id/66/346/216', | ||
'https://picsum.photos/id/67/346/216', | ||
'https://picsum.photos/id/68/346/216', | ||
], | ||
name: Mock.mock('@ctitle(3,10)') + '.png', | ||
'status|1': ['success', 'error', 'success'], | ||
}, | ||
]; | ||
|
||
const todoListData = Mock.mock(mock); | ||
if (Array.isArray(todoListData.items)) { | ||
return ResultUtil.success(todoListData.items); | ||
} else { | ||
return ResultUtil.success([todoListData.items]); | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface UploadResult { | ||
id: string; | ||
name: string; | ||
status: string; | ||
url: string; | ||
} | ||
|
||
export interface UploadParams { | ||
formData: FormData; | ||
total: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.