fix mock file structure
parent
88cdb6cb92
commit
b174304d74
83
mock/api.ts
83
mock/api.ts
|
|
@ -1,8 +1,5 @@
|
||||||
import userinfo from './userinfo.json';
|
import mytickets from './mytickets.json';
|
||||||
import lang from './lang.json';
|
import ticketInfo from './ticketInfo.json';
|
||||||
import report from './report.json';
|
|
||||||
import newComment from './newComment.json';
|
|
||||||
import ticket from './ticket.json';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'GET /dutyinfo': {
|
'GET /dutyinfo': {
|
||||||
|
|
@ -23,96 +20,32 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'POST /user/update': {
|
'POST /user/update': {
|
||||||
file: userinfo,
|
data: {},
|
||||||
},
|
},
|
||||||
'GET /user/locale/get': {
|
'GET /user/locale/get': {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
token: 'token_test',
|
|
||||||
lang: 'en_US',
|
lang: 'en_US',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'POST /user/locale/update': {
|
'POST /user/locale/update': {
|
||||||
file: lang,
|
data: {},
|
||||||
},
|
},
|
||||||
'POST /report': {
|
'POST /report': {
|
||||||
success: false,
|
|
||||||
data: {},
|
data: {},
|
||||||
},
|
},
|
||||||
'GET /user/mytickets': {
|
'GET /user/mytickets': {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: mytickets,
|
||||||
list: [
|
|
||||||
{
|
|
||||||
id: 6830,
|
|
||||||
type: 1,
|
|
||||||
status: 5,
|
|
||||||
device: '主机',
|
|
||||||
deviceModel: '技嘉',
|
|
||||||
owner: '武技栏',
|
|
||||||
phone: '18888888888',
|
|
||||||
createdTime: '2024-03-06T19:49:27.043865',
|
|
||||||
isConfirmed: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
'GET /tickets/info/': {
|
'GET /tickets/info/': {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: ticketInfo,
|
||||||
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': {
|
'POST /tickets/newcomment': {
|
||||||
file: newComment,
|
data: {},
|
||||||
},
|
},
|
||||||
'POST /tickets/create': {
|
'POST /tickets/create': {
|
||||||
file: ticket,
|
data: {},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"token": "token_test",
|
|
||||||
"lang": "en_US"
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"id": 6830,
|
||||||
|
"type": 1,
|
||||||
|
"status": 5,
|
||||||
|
"device": "主机",
|
||||||
|
"deviceModel": "技嘉",
|
||||||
|
"owner": "武技栏",
|
||||||
|
"phone": "18888888888",
|
||||||
|
"createdTime": "2024-03-06T19:49:27.043865",
|
||||||
|
"isConfirmed": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"token": "token_test",
|
|
||||||
"content": "这是一条评论"
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"token": "token_test",
|
|
||||||
"content": "aaa bbbb cccc"
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"token": "token_test",
|
|
||||||
"type": 1,
|
|
||||||
"device": "华硕",
|
|
||||||
"deviceModel": "天选3",
|
|
||||||
"owner": "西西弗",
|
|
||||||
"phone": "12333333333",
|
|
||||||
"description": "没法用pd充电",
|
|
||||||
"accessories": [0]
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"name": "宇航员",
|
|
||||||
"phone": "12333332103"
|
|
||||||
}
|
|
||||||
|
|
@ -11,6 +11,9 @@ function App({ children }: PropsWithChildren<any>) {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: getUrl('/user/locale/get'),
|
url: getUrl('/user/locale/get'),
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
token: 'token_test',
|
||||||
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
pt.setLang(res.data.data.lang);
|
pt.setLang(res.data.data.lang);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue