fix bug
This commit is contained in:
		| @ -12,7 +12,7 @@ | |||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "koa": "^2.0.0", |     "koa": "^2.0.0", | ||||||
|     "koa-body": "^2.0.0", |     "koa-body": "^2.0.0", | ||||||
|     "koa-compose": "^2.5.1", |     "koa-compose": "^3.2.1", | ||||||
|     "koa-router": "^7.0.1", |     "koa-router": "^7.0.1", | ||||||
|     "koa-session2": "^1.0.8", |     "koa-session2": "^1.0.8", | ||||||
|     "koa-static2": "^0.1.8", |     "koa-static2": "^0.1.8", | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ import { | |||||||
| import path from 'path' | import path from 'path' | ||||||
| import MainRoutes from './routes/main-routes' | import MainRoutes from './routes/main-routes' | ||||||
| import ErrorRoutes from './routes/error-routes' | import ErrorRoutes from './routes/error-routes' | ||||||
| // import PluginLoader from './tool/PluginLoader' | import PluginLoader from './lib/PluginLoader' | ||||||
|  |  | ||||||
| const app = new Koa2() | const app = new Koa2() | ||||||
| const env = process.env.NODE_ENV || 'development' // Current mode | const env = process.env.NODE_ENV || 'development' // Current mode | ||||||
| @ -25,7 +25,7 @@ app | |||||||
|   .use(KoaSession({ |   .use(KoaSession({ | ||||||
|     key: SystemConfig.Session_Key |     key: SystemConfig.Session_Key | ||||||
|   })) // Set Session |   })) // Set Session | ||||||
|   // .use(PluginLoader(SystemConfig.System_plugin_path)) |   .use(PluginLoader(SystemConfig.System_plugin_path)) | ||||||
|   .use((ctx, next) => { |   .use((ctx, next) => { | ||||||
|     if (ctx.request.header.host.split(':')[0] === 'api.XXX.com' || ctx.request.header.host.split(':')[0] === '127.0.0.1') { |     if (ctx.request.header.host.split(':')[0] === 'api.XXX.com' || ctx.request.header.host.split(':')[0] === '127.0.0.1') { | ||||||
|       ctx.set('Access-Control-Allow-Origin', '*') |       ctx.set('Access-Control-Allow-Origin', '*') | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ export let SystemConfig = { | |||||||
|   HTTP_server_host: 'localhost', // HTTP服务器地址,请勿添加"http://" |   HTTP_server_host: 'localhost', // HTTP服务器地址,请勿添加"http://" | ||||||
|   HTTP_server_port: '3000', // HTTP服务器端口号 |   HTTP_server_port: '3000', // HTTP服务器端口号 | ||||||
|   System_country: 'zh-cn', // 所在国家的国家代码 |   System_country: 'zh-cn', // 所在国家的国家代码 | ||||||
|   System_plugin_path: path.join(__dirname, '../src/plugins'), // 插件路径 |   System_plugin_path: path.join(__dirname, './plugins'), // 插件路径 | ||||||
|   Session_Key: 'RESTfulAPI', // 生产环境务必随机设置一个值 |   Session_Key: 'RESTfulAPI', // 生产环境务必随机设置一个值 | ||||||
|   mysql_host: 'localhost', // MySQL服务器地址 |   mysql_host: 'localhost', // MySQL服务器地址 | ||||||
|   mysql_user: 'root', // 数据库用户名 |   mysql_user: 'root', // 数据库用户名 | ||||||
|  | |||||||
| @ -10,7 +10,6 @@ function getDirs (srcpath) { | |||||||
| 
 | 
 | ||||||
| module.exports = (srcpath, filename = 'index.js') => { | module.exports = (srcpath, filename = 'index.js') => { | ||||||
|   let plugins = {} |   let plugins = {} | ||||||
| 
 |  | ||||||
|   let dirs = getDirs(srcpath) |   let dirs = getDirs(srcpath) | ||||||
|   let list = [] |   let list = [] | ||||||
| 
 | 
 | ||||||
| @ -1,6 +1,10 @@ | |||||||
| import nodemailer from 'nodemailer' | import nodemailer from 'nodemailer' | ||||||
| import { SendEmail } from '../../config' | import { SendEmail } from '../../config' | ||||||
|  |  | ||||||
|  | export default () => { | ||||||
|  |   console.log('ok') | ||||||
|  | } | ||||||
|  |  | ||||||
| // 发送Email(目前使用的是阿里云SMTP发送邮件) | // 发送Email(目前使用的是阿里云SMTP发送邮件) | ||||||
| // receivers 目标邮箱,可以用英文逗号分隔多个。(我没试过) | // receivers 目标邮箱,可以用英文逗号分隔多个。(我没试过) | ||||||
| // subject 邮件标题 | // subject 邮件标题 | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user