a661e439a0
Add the current frontend codebase with a baseline .gitignore and update piano-specific UI terms to teaching-oriented terms for the current product context. Made-with: Cursor
38 lines
927 B
TypeScript
38 lines
927 B
TypeScript
// 引入mockjs
|
|
import {MockMethod} from "vite-plugin-mock";
|
|
|
|
const MockJs = require('mockjs')
|
|
const {Random} = MockJs;
|
|
|
|
interface MockMethodResOpt {
|
|
body: Record<string, any>,
|
|
query: Record<string, any>
|
|
}
|
|
|
|
export default [
|
|
{
|
|
url: '/api/v1/user/login',
|
|
method: 'post',
|
|
response: ({query}: MockMethodResOpt) => {
|
|
return {
|
|
success: true,
|
|
result: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MTIz.5frDWv6bqXyHPXl3oZYOTnALMCGwfEYjQZbke2iyR3Y"
|
|
};
|
|
}
|
|
},
|
|
{
|
|
url: '/api/v1/user/current',
|
|
method: 'get',
|
|
response: ({query}: MockMethodResOpt) => {
|
|
return {
|
|
success: true,
|
|
result: {
|
|
id: Random.guid(),
|
|
name: Random.cname(2, 4),
|
|
user_role: 1,
|
|
}
|
|
};
|
|
}
|
|
},
|
|
] as MockMethod[];
|