接口初始化 第一版

This commit is contained in:
yuping
2022-11-21 15:53:20 +08:00
parent 8fa76327be
commit 039042f607
4 changed files with 7 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite",
"serve": "vite preview",
"serve": "vite build && vite preview",
"build": "vite build"
},
"dependencies": {

View File

@@ -1,5 +1,5 @@
import './mock/index';
import { createApp } from 'vue'
import './mock/index'
import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
@@ -7,8 +7,9 @@ import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import "@/assets/scss/common.scss"
const app = createApp(App)
app.use(store).use(router).mount('#app')
app.use(ElementPlus, {
locale: zhCn,
locale: zhCn,
})

View File

@@ -8,5 +8,5 @@ const array = Object.keys(context).map(path =>
url: module[url].split(' ')[0],
method: module[url].split(' ').length > 1 ? module[url].split(' ')[1] : 'get',
response: context[path].default[url]
}))).reduce((r, m) => [...r, ...m])
createProdMockServer([...array])
}))).reduce((r, m) => [...r, ...m]);
createProdMockServer([...array])

View File

@@ -19,9 +19,6 @@ export default defineConfig(({command}) =>
}),
viteMockServe({
mockPath: './src/mock/mocks',
// injectCode: `
// console.log(111111111)
// `,
})
],
resolve: {