提交 f866e465 编写于 作者: V Vben

chore: add test server

上级 23568b31
......@@ -8,7 +8,6 @@ export function configMockPlugin(isBuild: boolean) {
return viteMockServe({
ignore: /^\_/,
mockPath: 'mock',
showTime: true,
localEnabled: !isBuild,
prodEnabled: isBuild,
injectCode: `
......
......@@ -101,7 +101,7 @@
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"rimraf": "^3.0.2",
"rollup-plugin-visualizer": "^4.2.1",
"rollup-plugin-visualizer": "4.2.1",
"stylelint": "^13.12.0",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^21.0.0",
......@@ -112,20 +112,19 @@
"vite-plugin-compression": "^0.2.3",
"vite-plugin-html": "^2.0.3",
"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-pwa": "^0.5.6",
"vite-plugin-style-import": "^0.8.1",
"vite-plugin-svg-icons": "^0.3.5",
"vite-plugin-theme": "^0.5.0",
"vite-plugin-windicss": "0.9.2",
"vite-plugin-windicss": "0.8.3",
"vue-eslint-parser": "^7.6.0",
"yargs": "^16.2.0"
},
"resolutions": {
"//": "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",
"rollup": "2.41.5",
"vite": "2.0.5"
},
"repository": {
......
......@@ -155,7 +155,7 @@
&-vertical &-submenu-title {
position: relative;
z-index: 1;
padding: 12px 24px;
padding: 14px 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
......
......@@ -116,7 +116,9 @@ class Permission extends VuexModule {
// !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.changePermissionCode('1');
try {
this.changePermissionCode('1');
} catch (error) {}
if (!paramId) {
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"
}
}
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册