|
@@ -1,9 +1,8 @@
|
|
|
import { faker } from '@faker-js/faker'
|
|
|
import { delay, http, HttpResponse } from 'msw'
|
|
|
-import { UserApi } from '@/api/services/userService'
|
|
|
import { USER_LIST } from '../assets'
|
|
|
|
|
|
-const signIn = http.post(`/api${UserApi.SignIn}`, async ({ request }) => {
|
|
|
+const signIn = http.post('/api/auth/signin', async ({ request }) => {
|
|
|
const { username, password } = await request.json()
|
|
|
|
|
|
const user = USER_LIST.find((item) => item.username === username)
|
|
@@ -41,4 +40,17 @@ const userList = http.get('/api/user', async () => {
|
|
|
)
|
|
|
})
|
|
|
|
|
|
-export default [signIn, userList]
|
|
|
+const homepageData = http.get('/api/homepage', () => {
|
|
|
+ return HttpResponse.json({
|
|
|
+ status: 0,
|
|
|
+ message: '',
|
|
|
+ data: {
|
|
|
+ title: 'Welcome to Vue3 Admin',
|
|
|
+ description:
|
|
|
+ 'Vue3 Admin is a powerful admin template built with Vue3, Vite, TypeScript, Pinia, Vue-router, Ant Design Vue, and more.',
|
|
|
+ image: 'https://vue3-admin.com/images/vue3-admin.png'
|
|
|
+ }
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+export default [signIn, userList, homepageData]
|