| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- import test from './test.mock'
- import { MockMethod } from 'vite-plugin-mock'
- import { RequestHttpEnum } from '@/enums/httpEnum'
- // 单个X数据
- export const chartDataUrl = '/mock/chartData'
- export const chartSingleDataUrl = '/mock/chartSingleData'
- export const numberFloatUrl = '/mock/number/float'
- export const numberIntUrl = '/mock/number/int'
- export const textUrl = '/mock/text'
- export const imageUrl = '/mock/image'
- export const rankListUrl = '/mock/rankList'
- export const scrollBoardUrl = '/mock/scrollBoard'
- export const radarUrl = '/mock/radarData'
- export const heatMapUrl = '/mock/heatMapData'
- export const scatterBasicUrl = '/mock/scatterBasic'
- export const mapUrl = '/mock/map'
- export const wordCloudUrl = '/mock/wordCloud'
- const mockObject: MockMethod[] = [
- {
- // 正则
- // url: /\/mock\/mockData(|\?\S*)$/,
- url: chartDataUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchMockData
- },
- {
- url: chartSingleDataUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchMockSingleData
- },
- {
- url: numberFloatUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchNumberFloat
- },
- {
- url: numberIntUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchNumberInt
- },
- {
- url: textUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchText
- },
- {
- url: imageUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchImage(Math.round(Math.random() * 10))
- },
- {
- url: rankListUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchRankList
- },
- {
- url: scrollBoardUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchScrollBoard
- },
- {
- url: radarUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchRadar
- },
- {
- url: heatMapUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchHeatmap
- },
- {
- url: scatterBasicUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchScatterBasic
- },
- {
- url: mapUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchMap
- },
- {
- url: wordCloudUrl,
- method: RequestHttpEnum.GET,
- response: () => test.fetchWordCloud
- }
- ]
- export default mockObject
|