feat: 新增图片 mock 地址
This commit is contained in:
parent
3c65fa806e
commit
0e83597ddc
@ -8,6 +8,7 @@ export const rankListUrl = '/mock/rankList'
|
|||||||
export const numberFloatUrl = '/mock/number/float'
|
export const numberFloatUrl = '/mock/number/float'
|
||||||
export const numberIntUrl = '/mock/number/int'
|
export const numberIntUrl = '/mock/number/int'
|
||||||
export const textUrl = '/mock/text'
|
export const textUrl = '/mock/text'
|
||||||
|
export const imageUrl = '/mock/image'
|
||||||
|
|
||||||
const mockObject: MockMethod[] = [
|
const mockObject: MockMethod[] = [
|
||||||
{
|
{
|
||||||
@ -37,6 +38,11 @@ const mockObject: MockMethod[] = [
|
|||||||
method: RequestHttpEnum.GET,
|
method: RequestHttpEnum.GET,
|
||||||
response: () => test.fetchText,
|
response: () => test.fetchText,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
url: imageUrl,
|
||||||
|
method: RequestHttpEnum.GET,
|
||||||
|
response: () => test.fetchImage,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default mockObject
|
export default mockObject
|
||||||
|
@ -80,4 +80,10 @@ export default {
|
|||||||
msg: '请求成功',
|
msg: '请求成功',
|
||||||
data: '@paragraph(1, 10)',
|
data: '@paragraph(1, 10)',
|
||||||
},
|
},
|
||||||
|
fetchImage: {
|
||||||
|
code: 0,
|
||||||
|
status: 200,
|
||||||
|
msg: '请求成功',
|
||||||
|
data: `https://robohash.org/${Math.round(Math.random()*10)}`,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ import { ref, toRefs } from 'vue'
|
|||||||
import { icon } from '@/plugins'
|
import { icon } from '@/plugins'
|
||||||
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
||||||
import { RequestHttpEnum, ResultEnum } from '@/enums/httpEnum'
|
import { RequestHttpEnum, ResultEnum } from '@/enums/httpEnum'
|
||||||
import { chartDataUrl, rankListUrl, numberFloatUrl, numberIntUrl, textUrl } from '@/api/mock'
|
import { chartDataUrl, rankListUrl, numberFloatUrl, numberIntUrl, textUrl, imageUrl } from '@/api/mock'
|
||||||
import { http } from '@/api/http'
|
import { http } from '@/api/http'
|
||||||
import { SelectHttpType } from '../../index.d'
|
import { SelectHttpType } from '../../index.d'
|
||||||
import { ChartDataMatchingAndShow } from '../ChartDataMatchingAndShow'
|
import { ChartDataMatchingAndShow } from '../ChartDataMatchingAndShow'
|
||||||
@ -92,6 +92,9 @@ const apiList = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: `【0~1小数】${ numberFloatUrl }`
|
value: `【0~1小数】${ numberFloatUrl }`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: `【图片地址】${ imageUrl }`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user