feat: 新增图片 mock 地址

This commit is contained in:
奔跑的面条
2022-06-26 15:26:57 +08:00
parent bde2634ef3
commit bf1b81e554
3 changed files with 16 additions and 1 deletions
+6
View File
@@ -8,6 +8,7 @@ export const rankListUrl = '/mock/rankList'
export const numberFloatUrl = '/mock/number/float'
export const numberIntUrl = '/mock/number/int'
export const textUrl = '/mock/text'
export const imageUrl = '/mock/image'
const mockObject: MockMethod[] = [
{
@@ -37,6 +38,11 @@ const mockObject: MockMethod[] = [
method: RequestHttpEnum.GET,
response: () => test.fetchText,
},
{
url: imageUrl,
method: RequestHttpEnum.GET,
response: () => test.fetchImage,
},
]
export default mockObject
+6
View File
@@ -80,4 +80,10 @@ export default {
msg: '请求成功',
data: '@paragraph(1, 10)',
},
fetchImage: {
code: 0,
status: 200,
msg: '请求成功',
data: `https://robohash.org/${Math.round(Math.random()*10)}`,
},
}