提交 f866e465 作者: Vben

chore: add test server

上级 23568b31
...@@ -8,7 +8,6 @@ export function configMockPlugin(isBuild: boolean) { ...@@ -8,7 +8,6 @@ export function configMockPlugin(isBuild: boolean) {
return viteMockServe({ return viteMockServe({
ignore: /^\_/, ignore: /^\_/,
mockPath: 'mock', mockPath: 'mock',
showTime: true,
localEnabled: !isBuild, localEnabled: !isBuild,
prodEnabled: isBuild, prodEnabled: isBuild,
injectCode: ` injectCode: `
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
"prettier": "^2.2.1", "prettier": "^2.2.1",
"pretty-quick": "^3.1.0", "pretty-quick": "^3.1.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup-plugin-visualizer": "^4.2.1", "rollup-plugin-visualizer": "4.2.1",
"stylelint": "^13.12.0", "stylelint": "^13.12.0",
"stylelint-config-prettier": "^8.0.2", "stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^21.0.0", "stylelint-config-standard": "^21.0.0",
...@@ -112,20 +112,19 @@ ...@@ -112,20 +112,19 @@
"vite-plugin-compression": "^0.2.3", "vite-plugin-compression": "^0.2.3",
"vite-plugin-html": "^2.0.3", "vite-plugin-html": "^2.0.3",
"vite-plugin-imagemin": "^0.2.9", "vite-plugin-imagemin": "^0.2.9",
"vite-plugin-mock": "^2.2.4", "vite-plugin-mock": "^2.3.0",
"vite-plugin-purge-icons": "^0.7.0", "vite-plugin-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.5.6", "vite-plugin-pwa": "^0.5.6",
"vite-plugin-style-import": "^0.8.1", "vite-plugin-style-import": "^0.8.1",
"vite-plugin-svg-icons": "^0.3.5", "vite-plugin-svg-icons": "^0.3.5",
"vite-plugin-theme": "^0.5.0", "vite-plugin-theme": "^0.5.0",
"vite-plugin-windicss": "0.9.2", "vite-plugin-windicss": "0.8.3",
"vue-eslint-parser": "^7.6.0", "vue-eslint-parser": "^7.6.0",
"yargs": "^16.2.0" "yargs": "^16.2.0"
}, },
"resolutions": { "resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it", "//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it",
"bin-wrapper": "npm:bin-wrapper-china", "bin-wrapper": "npm:bin-wrapper-china",
"rollup": "2.41.5",
"vite": "2.0.5" "vite": "2.0.5"
}, },
"repository": { "repository": {
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
&-vertical &-submenu-title { &-vertical &-submenu-title {
position: relative; position: relative;
z-index: 1; z-index: 1;
padding: 12px 24px; padding: 14px 24px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
......
...@@ -116,7 +116,9 @@ class Permission extends VuexModule { ...@@ -116,7 +116,9 @@ class Permission extends VuexModule {
// !Simulate to obtain permission codes from the background, // !Simulate to obtain permission codes from the background,
// this function may only need to be executed once, and the actual project can be put at the right time by itself // this function may only need to be executed once, and the actual project can be put at the right time by itself
this.changePermissionCode('1'); try {
this.changePermissionCode('1');
} catch (error) {}
if (!paramId) { if (!paramId) {
throw new Error('paramId is undefined!'); throw new Error('paramId is undefined!');
} }
......
const Koa = require('koa');
const router = require('koa-router')();
const cors = require('koa2-cors');
const bodyParser = require('koa-bodyparser');
const app = new Koa();
app.use(cors());
app.use(bodyParser());
router.get('/getTest', (ctx) => {
ctx.body = {
name: 'test',
};
});
router.post('/login', (ctx) => {
ctx.body = {
code: 0,
success: true,
result: {
userId: '1',
username: 'vben',
realName: 'Vben Admin',
desc: 'manager',
password: '123456',
token: 'fakeToken1',
roles: [
{
roleName: 'Super Admin',
value: 'super',
},
],
},
};
});
router.get('/getUserInfoById', (ctx) => {
ctx.body = {
code: 0,
success: true,
result: {
userId: '1',
username: 'vben',
realName: 'Vben Admin',
desc: 'manager',
password: '123456',
token: 'fakeToken1',
roles: [
{
roleName: 'Super Admin',
value: 'super',
},
],
},
};
});
app.use(router.routes()).use(router.allowedMethods());
app.listen(3002, () => {
console.log('server is listen in 3002');
});
{
"name": "upload-server",
"version": "1.0.0",
"main": "app.js",
"license": "MIT",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"fs-extra": "^9.1.0",
"koa": "^2.13.1",
"koa-body": "^4.2.0",
"koa-bodyparser": "^4.3.0",
"koa-router": "^10.0.0",
"koa-static": "^5.0.0",
"koa2-cors": "^2.0.6"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论