add mock apis
parent
a7fd2b2856
commit
dd07c1da10
113
mock/api.ts
113
mock/api.ts
|
|
@ -1,8 +1,117 @@
|
|||
import userinfo from './userinfo.json';
|
||||
import lang from './lang.json';
|
||||
import report from './report.json';
|
||||
import newComment from './newComment.json';
|
||||
import ticket from './ticket.json';
|
||||
|
||||
export default {
|
||||
'GET /testdata': {
|
||||
'GET /dutyinfo': {
|
||||
success: true,
|
||||
data: {
|
||||
test: 'test',
|
||||
token: 'token_test',
|
||||
isInDuty: true,
|
||||
inDutyCnt: 3,
|
||||
currentDuty: '2',
|
||||
},
|
||||
},
|
||||
'GET /user/info': {
|
||||
success: true,
|
||||
data: {
|
||||
token: 'token_test',
|
||||
name: '马保国',
|
||||
phone: 13333333333,
|
||||
},
|
||||
},
|
||||
'POST /user/update': {
|
||||
file: userinfo,
|
||||
},
|
||||
'GET /user/locale/get': {
|
||||
success: true,
|
||||
data: {
|
||||
token: 'token_test',
|
||||
lang: 'zn_CN',
|
||||
},
|
||||
},
|
||||
'POST /user/locale/update': {
|
||||
file: lang,
|
||||
},
|
||||
'POST /report': {
|
||||
file: report,
|
||||
},
|
||||
'GET /user/mytickets': {
|
||||
success: true,
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 6830,
|
||||
type: 1,
|
||||
status: 5,
|
||||
device: '主机',
|
||||
deviceModel: '技嘉',
|
||||
owner: '武技栏',
|
||||
phone: '18888888888',
|
||||
createdTime: '2024-03-06T19:49:27.043865',
|
||||
isConfirmed: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
'GET /tickets/info/': {
|
||||
success: true,
|
||||
data: {
|
||||
id: 6847,
|
||||
type: 1,
|
||||
device: '华硕',
|
||||
deviceModel: '灵耀X14',
|
||||
owner: '唐姐姐',
|
||||
phone: '15555555555',
|
||||
description: '清灰',
|
||||
workers: [],
|
||||
createdTime: '2024-03-07T19:52:48.523303',
|
||||
status: 5,
|
||||
isConfirmed: false,
|
||||
notes: [
|
||||
{
|
||||
avatar: 'https://....jpg',
|
||||
id: 21368,
|
||||
op: '宇航员',
|
||||
type: 0,
|
||||
content: '',
|
||||
createdTime: '2024-03-07T19:52:48.523305',
|
||||
},
|
||||
{
|
||||
avatar: 'https://....jpg',
|
||||
id: 21370,
|
||||
op: '宇航员',
|
||||
type: 2,
|
||||
content: '1',
|
||||
createdTime: '2024-03-07T19:58:27.838816',
|
||||
},
|
||||
{
|
||||
avatar: 'https://....jpg',
|
||||
id: 21373,
|
||||
op: '宇航员',
|
||||
type: 2,
|
||||
content: '4',
|
||||
createdTime: '2024-03-07T20:28:12.070707',
|
||||
},
|
||||
{
|
||||
avatar: 'https://....jpg',
|
||||
id: 21374,
|
||||
op: '宇航员',
|
||||
type: 2,
|
||||
content: '5',
|
||||
createdTime: '2024-03-07T20:30:15.770486',
|
||||
},
|
||||
],
|
||||
accessories: [2],
|
||||
picked: false,
|
||||
},
|
||||
},
|
||||
'POST /tickets/newcomment': {
|
||||
file: newComment,
|
||||
},
|
||||
'POST /tickets/create': {
|
||||
file: ticket,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"token": "token_test",
|
||||
"lang": "en_US"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"token": "token_test",
|
||||
"content": "这是一条评论"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"token": "token_test",
|
||||
"content": "aaa bbbb cccc"
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"token": "token_test",
|
||||
"type": 1,
|
||||
"device": "华硕",
|
||||
"deviceModel": "天选3",
|
||||
"owner": "西西弗",
|
||||
"phone": "12333333333",
|
||||
"description": "没法用pd充电",
|
||||
"accessories": [0]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "宇航员",
|
||||
"phone": "12333332103"
|
||||
}
|
||||
Loading…
Reference in New Issue