first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import path from "path";
export const config = {
typeOrm: {
type: "mysql",
host: "localhost",
port: 3306,
username: "root",
password: "lb714500",
database: "website",
synchronize: true,
logging: "all",
logger: "advanced-console",
entities: [
path.join( __dirname, "../entity/**/*.{ts,js}")
],
}
}

View File

@@ -0,0 +1,25 @@
import {Get, JsonController,UseInterceptor} from "routing-controllers";
import {IndexServiceImpl} from "../service/impl/IndexServiceImpl";
import {Inject, Service} from "typedi";
import { ResponseData } from "../middleware/ResponseData";
import { User } from "../entity/UserEntity";
import { UserServiceImpl } from "../service/impl/UserServiceImpl";
@JsonController("/index")
@Service()
@UseInterceptor(ResponseData)
export class IndexController {
@Inject()
indexServiceImpl: IndexServiceImpl;
@Inject()
private userServiceImpl: UserServiceImpl;
@Get('/list')
public async getList ():Promise<User[]> {
return await this.userServiceImpl.getAllUser();
}
}

View File

@@ -0,0 +1,12 @@
import { Service } from "typedi";
import { User } from "../entity/UserEntity";
import { getRepository, Repository } from "typeorm";
@Service()
export class UserDao {
private userRepository:Repository<User> = getRepository(User)
public async getAllUserDao(): Promise<User[]>{
return await this.userRepository.find();
}
}

View File

@@ -0,0 +1,18 @@
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: number;
@Column("varchar", {
length: 20
})
username: string
@Column("varchar", {
length: 64
})
userpassword: string
}

View File

@@ -0,0 +1,3 @@
import { App } from "./www/App";
new App();

View File

@@ -0,0 +1,24 @@
import {Interceptor, InterceptorInterface, Action} from "routing-controllers";
import { Service, Inject } from "typedi";
import { ResultData } from "../model/ResultData";
@Service()
export class ResponseData<T> implements InterceptorInterface{
@Inject()
private resultData: ResultData<T>;
private noData: string = "没有数据";
intercept(action: Action, content: any) {
content = content.length == 0 ? [] : content;
if(!!content){
return this.resultData.success(content,action)
}else {
// @ts-ignore
return this.resultData.error(this.noData,action)
}
}
}

View File

@@ -0,0 +1,17 @@
import { IsInt, Length, IsEmail, IsFQDN, IsDate, Min, Max} from "class-validator";
import { Service, Inject } from "typedi";
export class IndexModel {
@Length(10, 20,{
message: "标题必须10~20以内"
})
title:string;
@IsInt({
message: "必须是int类型"
})
id: number
}

View File

@@ -0,0 +1,71 @@
import { Action } from "routing-controllers";
import { Service } from "typedi";
@Service()
export class ResultData<T> {
private _status: number;
private _url: string;
private _message: string;
private _data: Array<any> | Object
get status(): number {
return this._status;
}
set status(value: number) {
this._status = value;
}
get url(): string {
return this._url;
}
set url(value: string) {
this._url = value;
}
get message(): string {
return this._message;
}
set message(value: string) {
this._message = value;
}
get data(): Array<any> | Object {
return this._data;
}
set data(value: Array<any> | Object) {
this._data = value;
}
public success(params:T,action:Action): Object {
this.status = 200
this.message = "请求成功"
this.url = action.context.originalUrl
this.data = params
return {
status: this.status,
message: this.message,
url: this.url,
data: this.data
};
}
public error(params:T,action:Action): Object {
this.status = -1;
this.message = ""
this.url = action.context.originalUrl
this.data = params
return {
status: this.status,
message: this.message,
url: this.url,
data: this.data
}
}
}

View File

@@ -0,0 +1 @@
这是测试哈哈哈哈哈

View File

@@ -0,0 +1 @@
{"id":"YuMU","dependencies":[{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/tsconfig.json","includedInParent":true,"mtime":1557062170317},{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/package.json","includedInParent":true,"mtime":1557674691853},{"name":"vue","loc":{"line":6,"column":38},"parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/router/index.ts","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue/dist/vue.runtime.esm.js"},{"name":"vue-router","loc":{"line":7,"column":45},"parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/router/index.ts","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue-router/dist/vue-router.esm.js"},{"name":"../views/Home.vue","loc":{"line":8,"column":43},"parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/router/index.ts","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/views/Home.vue"}],"generated":{"js":"\"use strict\";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,\"__esModule\",{value:!0});var t=e(require(\"vue\")),u=e(require(\"vue-router\")),r=e(require(\"../views/Home.vue\"));t.default.use(u.default),exports.default=new u.default({mode:\"hash\",routes:[{path:\"/index\",name:\"home\",component:r.default}]});"},"sourceMaps":null,"error":null,"hash":"a0afa1e0e1a567ebbca87165bc71707b","cacheData":{"env":{}}}

View File

@@ -0,0 +1 @@
{"id":"views/Home.vue","dependencies":[{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/package.json","includedInParent":true,"mtime":1557674433947},{"name":"_css_loader","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/views/Home.vue","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/parcel-bundler/src/builtins/css-loader.js"},{"name":"vue-hot-reload-api","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/views/Home.vue","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue-hot-reload-api/dist/index.js"},{"name":"vue","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/views/Home.vue","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue/dist/vue.runtime.esm.js"}],"generated":{"js":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n//\n//\n//\n//\n//\n//\nvar _default = {\n name: \"Home\"\n};\nexports.default = _default;\n var $cd4886 = exports.default || module.exports;\n \n if (typeof $cd4886 === 'function') {\n $cd4886 = $cd4886.options;\n }\n \n /* template */\n Object.assign($cd4886, (function () {\n var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"home\" }, [_vm._v(\"\\n 首页\\n\")])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n return {\n render: render,\n staticRenderFns: staticRenderFns,\n _compiled: true,\n _scopeId: \"data-v-cd4886\",\n functional: undefined\n };\n })());\n \n /* hot reload */\n (function () {\n if (module.hot) {\n var api = require('vue-hot-reload-api');\n api.install(require('vue'));\n if (api.compatible) {\n module.hot.accept();\n if (!module.hot.data) {\n api.createRecord('$cd4886', $cd4886);\n } else {\n api.reload('$cd4886', $cd4886);\n }\n }\n\n \n var reloadCSS = require('_css_loader');\n module.hot.dispose(reloadCSS);\n module.hot.accept(reloadCSS);\n \n }\n })();"},"sourceMaps":{"js":{"mappings":[{"source":"views/Home.vue","name":null,"original":{"line":8,"column":0},"generated":{"line":13,"column":15}},{"source":"views/Home.vue","name":null,"original":{"line":9,"column":0},"generated":{"line":14,"column":0}},{"source":"views/Home.vue","name":null,"original":{"line":9,"column":0},"generated":{"line":14,"column":2}},{"source":"views/Home.vue","name":null,"original":{"line":9,"column":0},"generated":{"line":14,"column":6}},{"source":"views/Home.vue","name":null,"original":{"line":9,"column":0},"generated":{"line":14,"column":8}},{"source":"views/Home.vue","name":null,"original":{"line":8,"column":0},"generated":{"line":15,"column":0}}],"sources":{"views/Home.vue":"<template>\n <div class=\"home\">\n 首页\n </div>\n</template>\n\n<script>\n export default {\n name: \"Home\"\n }\n</script>\n\n<style scoped>\n\n</style>"},"lineCount":null}},"error":null,"hash":"aa5cf5f2f684af9a6ffdaf28320719c5","cacheData":{"env":{}}}

View File

@@ -0,0 +1 @@
{"id":"6s8z","dependencies":[{"name":"./main.ts","dynamic":true,"resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/main.ts","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/index.html"}],"generated":{"html":"<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>Title</title></head><body> <div id=\"app\"> </div> <script src=\"6427dc610ec40c788cba04a9c39d6dcf.js\"></script> </body></html>"},"sourceMaps":null,"error":null,"hash":"368683484303167fadd3dac1ecb13ee4","cacheData":{}}

View File

@@ -0,0 +1 @@
{"id":"Js2s","dependencies":[{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/package.json","includedInParent":true,"mtime":1557674691853}],"generated":{"js":"\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.default=void 0;var e={props:{}};exports.default=e;\n(function(){var t=exports.default||module.exports;\"function\"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e(\"div\",{staticClass:\"App\"},[e(\"h2\",[this._v(\"App.vue\")]),this._v(\" \"),e(\"router-link\",{attrs:{to:\"/\"}},[this._v(\"/\")]),this._v(\" \"),e(\"router-link\",{attrs:{to:\"/index\"}},[this._v(\"index\")]),this._v(\" \"),e(\"router-view\")],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();"},"sourceMaps":null,"error":null,"hash":"292112e9ac1e20c25a55776d93831259","cacheData":{"env":{}}}

View File

@@ -0,0 +1 @@
{"id":"ZCfc","dependencies":[{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/tsconfig.json","includedInParent":true,"mtime":1557062170317},{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/package.json","includedInParent":true,"mtime":1557674691853},{"name":"vue","loc":{"line":6,"column":38},"parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/main.ts","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue/dist/vue.runtime.esm.js"},{"name":"./App.vue","loc":{"line":7,"column":42},"parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/main.ts","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/App.vue"},{"name":"./router/index","loc":{"line":8,"column":40},"parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/main.ts","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/router/index.ts"}],"generated":{"js":"\"use strict\";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,\"__esModule\",{value:!0});var r=e(require(\"vue\")),u=e(require(\"./App.vue\")),t=e(require(\"./router/index\"));new r.default({router:t.default,render:function(e){return e(u.default)}}).$mount(\"#app\");"},"sourceMaps":null,"error":null,"hash":"79e6d97c8e4891f5d8a81de9d674f060","cacheData":{"env":{}}}

View File

@@ -0,0 +1 @@
{"id":"XQhA","dependencies":[{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/package.json","includedInParent":true,"mtime":1557674691853}],"generated":{"js":"\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.default=void 0;var e={name:\"Home\"};exports.default=e;\n(function(){var t=exports.default||module.exports;\"function\"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)(\"div\",{staticClass:\"home\"},[this._v(\" 首页\\n\")])},staticRenderFns:[],_compiled:!0,_scopeId:\"data-v-cd4886\",functional:void 0});})();"},"sourceMaps":null,"error":null,"hash":"fcd0d1f4af19b2225fc626051104626a","cacheData":{"env":{}}}

View File

@@ -0,0 +1 @@
{"id":"App.vue","dependencies":[{"name":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/package.json","includedInParent":true,"mtime":1557674691853},{"name":"vue-hot-reload-api","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/App.vue","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue-hot-reload-api/dist/index.js"},{"name":"vue","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/App.vue","resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/node_modules/vue/dist/vue.runtime.esm.js"}],"generated":{"js":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = {\n props: {}\n};\nexports.default = _default;\n var $5b71df = exports.default || module.exports;\n \n if (typeof $5b71df === 'function') {\n $5b71df = $5b71df.options;\n }\n \n /* template */\n Object.assign($5b71df, (function () {\n var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { staticClass: \"App\" },\n [\n _c(\"h2\", [_vm._v(\"App.vue\")]),\n _vm._v(\" \"),\n _c(\"router-link\", { attrs: { to: \"/\" } }, [_vm._v(\"/\")]),\n _vm._v(\" \"),\n _c(\"router-link\", { attrs: { to: \"/index\" } }, [_vm._v(\"index\")]),\n _vm._v(\" \"),\n _c(\"router-view\")\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n return {\n render: render,\n staticRenderFns: staticRenderFns,\n _compiled: true,\n _scopeId: null,\n functional: undefined\n };\n })());\n \n /* hot reload */\n (function () {\n if (module.hot) {\n var api = require('vue-hot-reload-api');\n api.install(require('vue'));\n if (api.compatible) {\n module.hot.accept();\n if (!module.hot.data) {\n api.createRecord('$5b71df', $5b71df);\n } else {\n api.reload('$5b71df', $5b71df);\n }\n }\n\n \n }\n })();"},"sourceMaps":{"js":{"mappings":[{"source":"App.vue","name":null,"original":{"line":12,"column":0},"generated":{"line":17,"column":15}},{"source":"App.vue","name":null,"original":{"line":13,"column":0},"generated":{"line":18,"column":0}},{"source":"App.vue","name":null,"original":{"line":13,"column":0},"generated":{"line":18,"column":2}},{"source":"App.vue","name":null,"original":{"line":13,"column":0},"generated":{"line":18,"column":7}},{"source":"App.vue","name":null,"original":{"line":13,"column":0},"generated":{"line":18,"column":9}},{"source":"App.vue","name":null,"original":{"line":12,"column":0},"generated":{"line":19,"column":0}}],"sources":{"App.vue":"<template>\n <div class=\"App\">\n\n <h2>App.vue</h2>\n <router-link to=\"/\">/</router-link>\n <router-link to=\"/index\">index</router-link>\n <router-view></router-view>\n </div>\n</template>\n\n<script>\n export default {\n props: {\n },\n };\n</script>\n"},"lineCount":null}},"error":null,"hash":"1fcf1d6a860967a0aeb3abddb63599b2","cacheData":{"env":{}}}

View File

@@ -0,0 +1 @@
{"id":"index.html","dependencies":[{"name":"./main.ts","dynamic":true,"resolved":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/main.ts","parent":"/Applications/desktop/授课内容/陈尧瑞/OfficialWebsite/src/resource/view/admin/index.html"}],"generated":{"html":"<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>Title</title>\n </head>\n<body>\n\n\n <div id=\"app\">\n\n </div>\n\n <script src=\"/6427dc610ec40c788cba04a9c39d6dcf.js\"></script>\n\n\n</body>\n</html>"},"sourceMaps":null,"error":null,"hash":"220da2ac78c999d6fbb2366a852c21a3","cacheData":{}}

View File

@@ -0,0 +1,16 @@
<template>
<div class="App">
<h2>App.vue</h2>
<router-link to="/">/</router-link>
<router-link to="/index">index</router-link>
<router-view></router-view>
</div>
</template>
<script>
export default {
props: {
},
};
</script>

View File

@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Title</title></head><body> <div id="app"> </div> <script src="main.463174d2.js"></script> </body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="app">
</div>
<script src="./main.ts"></script>
</body>
</html>

View File

@@ -0,0 +1,8 @@
import Vue from "vue";
import App from "./App.vue";
import router from "./router/index"
new Vue({
router: router,
render: (h) => h(App),
}).$mount('#app');

View File

@@ -0,0 +1,24 @@
{
"name": "admin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "parcel index.html -p 8080",
"build": "parcel build entry.js index.html --public-url ./ --no-source-maps"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"vue": "^2.6.10",
"vue-hot-reload-api": "^2.3.3",
"vue-router": "^3.0.6",
"vue-template-compiler": "^2.6.10"
},
"devDependencies": {
"@vue/component-compiler-utils": "^3.0.0",
"parcel-bundler": "^1.12.3",
"typescript": "^3.4.5"
}
}

View File

@@ -0,0 +1,16 @@
import Vue from 'vue';
import Router from 'vue-router';
import Home from '../views/Home.vue';
Vue.use(Router);
export default new Router({
mode: 'hash',
routes: [
{
path: '/index',
name: 'home',
component: Home,
},
],
});

View File

@@ -0,0 +1,4 @@
declare module '*.vue' {
import Vue from 'vue';
export default Vue;
}

View File

@@ -0,0 +1,15 @@
<template>
<div class="home">
首页
</div>
</template>
<script>
export default {
name: "Home"
}
</script>
<style scoped>
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
//- 网站的核心的公共父级组件
//- 一些全局公共css和js可以在这里被加载
doctype html
html
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width, initial-scale=1")
meta(name="renderer" content="webkit")
meta(http-equiv="Cache-Control" content="no-siteapp")
block title
body
//- 公共网站头部
include ./public/header
//- 网站主体内容,从 main/*.jade 被载入
block content
//- 公共网站版权
include ./public/footer

View File

@@ -0,0 +1,13 @@
extends ./../layout
//- 网站的头部信息这边拆分出来便于每个页面的SEO配置和配置页面独有的cssjs
block title
title=title
//- 网站的主体内容区域
block content
.index
h1 默认首页1

View File

@@ -0,0 +1 @@
h2 底部

View File

@@ -0,0 +1 @@
h2 头部

View File

@@ -0,0 +1,3 @@
export interface IndexService {
getList(param?:object): any;
}

View File

@@ -0,0 +1,5 @@
import { User } from "../entity/UserEntity";
export interface UserService {
getAllUser(): Promise<any>
}

View File

@@ -0,0 +1,11 @@
import { IndexService } from "../IndexService"
import { Service } from "typedi";
@Service()
export class IndexServiceImpl implements IndexService {
public getList(param?: object): string {
return "getList"
}
}

View File

@@ -0,0 +1,17 @@
import { UserService } from "../UserService";
import { User } from "../../entity/UserEntity";
import { UserDao } from "../../dao/UserDao";
import { Service,Inject } from "typedi";
@Service()
export class UserServiceImpl implements UserService{
@Inject()
private userDao: UserDao;
public async getAllUser(): Promise<any> {
return await this.userDao.getAllUserDao();
}
}

View File

@@ -0,0 +1,43 @@
/**
* 启动文件
*/
import "reflect-metadata";
import { init } from "./init";
import { createConnection } from "typeorm";
import { useKoaServer,useContainer } from "routing-controllers"
import { Container } from "typedi";
import { config } from "../config";
import path from "path"
export class App extends init {
private Apps: any;
constructor() {
super();
// 注册依赖注入
useContainer(Container);
// @ts-ignore
createConnection(config.typeOrm).then(connection => {
this.Apps = useKoaServer(this.koa2,{
cors: true,
validation: true,
controllers: [ path.join(__dirname,'../controller/*.{js,ts}') ]
});
this.start();
}).catch(error => {
console.log(`数据库连接出错:${error}`)
});
}
private start(): any {
this.Apps.listen(3000,function () {
console.log(`程序运行在: http://127.0.0.1:${3000}`)
})
}
}

View File

@@ -0,0 +1,36 @@
import koa from "koa";
import stati from "koa-static";
import path from "path";
import views from "koa-views";
/**
* 配置所有koa2的中间件
*/
export class init {
protected koa2:any = new koa();
private PluginsArray: Function[];
constructor () {
this.initPlugins();
}
private initPlugins(): any {
this.PluginsArray = [
views(path.join( __dirname, "../resource/view"),{
map: {
jade: 'jade'
},
extension: 'jade'
}),
stati(path.join( __dirname, "../resource/static") ,{
maxage: 3000
})
];
try {
this.PluginsArray.forEach( v => this.koa2.use(v));
} catch (e) {
throw new Error(`配置插件出错:${e.message}`)
}
}
}