开服:新增版号服
This commit is contained in:
@@ -62,7 +62,7 @@ app.configure(function() {
|
||||
}
|
||||
});
|
||||
|
||||
const redisClient = connectRedis(app.get('database').redis);
|
||||
const redisClient = connectRedis(app.get('database').redis, app.get('database').redispw);
|
||||
app.set('redis', redisClient);
|
||||
redLockService.initRedlock(redisClient);
|
||||
redlockCacheService.init();
|
||||
@@ -77,7 +77,7 @@ app.configure(function() {
|
||||
});
|
||||
|
||||
// app configuration
|
||||
app.configure('production|development|alpha|dev', 'connector', function () {
|
||||
app.configure('production|development|alpha|dev|isbn', 'connector', function () {
|
||||
app.set('connectorConfig',
|
||||
{
|
||||
connector: pinus.connectors.hybridconnector,
|
||||
@@ -102,7 +102,7 @@ app.configure('production|development|alpha|dev', 'connector', function () {
|
||||
});
|
||||
});
|
||||
|
||||
app.configure('production|development|alpha|dev', 'gate', function () {
|
||||
app.configure('production|development|alpha|dev|isbn', 'gate', function () {
|
||||
app.set('connectorConfig',
|
||||
{
|
||||
connector: pinus.connectors.hybridconnector,
|
||||
@@ -110,7 +110,7 @@ app.configure('production|development|alpha|dev', 'gate', function () {
|
||||
});
|
||||
});
|
||||
|
||||
app.configure('production|development|alpha|dev', 'gm', function () {
|
||||
app.configure('production|development|alpha|dev|isbn', 'gm', function () {
|
||||
app.set('connectorConfig',
|
||||
{
|
||||
connector: pinus.connectors.hybridconnector,
|
||||
@@ -119,7 +119,7 @@ app.configure('production|development|alpha|dev', 'gm', function () {
|
||||
init();//将gm后台数据加载到gate服
|
||||
});
|
||||
|
||||
app.configure('production|development|alpha|dev', 'systimer', function () {
|
||||
app.configure('production|development|alpha|dev|isbn', 'systimer', function () {
|
||||
app.set('connectorConfig',
|
||||
{
|
||||
connector: pinus.connectors.hybridconnector,
|
||||
@@ -153,7 +153,7 @@ export function globalErrorHandler(err: Error, msg: any, resp: any,
|
||||
}
|
||||
|
||||
// app configure
|
||||
app.configure('production|development|alpha|dev', function () {
|
||||
app.configure('production|development|alpha|dev|isbn', function () {
|
||||
app.set(RESERVED.ERROR_HANDLER, errorHandler);
|
||||
app.set(RESERVED.GLOBAL_ERROR_HANDLER, globalErrorHandler);
|
||||
app.globalAfter((err: Error, routeRecord: RouteRecord, msg: any, session: FrontendOrBackendSession, resp: any, cb: HandlerCallback) => {
|
||||
|
||||
@@ -7,7 +7,7 @@ function main (){
|
||||
let env = args[0];
|
||||
if(args[0] == 'stable') {
|
||||
env = 'production';
|
||||
}
|
||||
}
|
||||
|
||||
let configObject = {
|
||||
env: env
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
module.exports = {
|
||||
'development': {
|
||||
'mongo': 'mongodb://127.0.0.1/zyz',
|
||||
'redis': '127.0.0.1'
|
||||
'redis': '127.0.0.1',
|
||||
'redispw': 'zyz_2020'
|
||||
},
|
||||
|
||||
'production': {
|
||||
'mongo': 'mongodb://dbop:zyzdbopbantu@dds-8vbdb47c6fb58a541.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vbdb47c6fb58a542.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-500808098',
|
||||
'redis': 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com'
|
||||
'redis': 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com',
|
||||
'redispw': 'zyz_2020'
|
||||
},
|
||||
'alpha': {
|
||||
'mongo': 'mongodb://dbop:zyzdbopbantu@dds-8vbdb47c6fb58a541.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vbdb47c6fb58a542.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-500808098',
|
||||
'redis': 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com'
|
||||
'redis': 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com',
|
||||
'redispw': 'zyz_2020'
|
||||
},
|
||||
'dev': {
|
||||
'mongo': 'mongodb://dbop:zyzdbopbantu@dds-8vbdb47c6fb58a541.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vbdb47c6fb58a542.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-500808098',
|
||||
'redis': 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com'
|
||||
'redis': 'r-8vb4i2kgl91886fkxd.redis.zhangbei.rds.aliyuncs.com',
|
||||
'redispw': 'zyz_2020'
|
||||
},
|
||||
'isbn': {
|
||||
'mongo': 'mongodb://root:Bantus123@dds-8vb74337eab84d641.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb74337eab84d642.mongodb.zhangbei.rds.aliyuncs.com:3717/admin?replicaSet=mgset-504694158',
|
||||
'redis': 'r-8vbekkbb3z8ru2ckuj.redis.zhangbei.rds.aliyuncs.com',
|
||||
'redispw': 'zyz_isbn_2021'
|
||||
}
|
||||
};
|
||||
170
game-server/config/isbn/log4js.pro.ts
Normal file
170
game-server/config/isbn/log4js.pro.ts
Normal file
@@ -0,0 +1,170 @@
|
||||
module.exports = {
|
||||
'appenders': {
|
||||
'console': {
|
||||
'type': 'console'
|
||||
},
|
||||
'logger': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/logger.log',
|
||||
'pattern': 'connector',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/log.log',
|
||||
'pattern': 'connector',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'con-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/con-log-${opts:serverId}.log',
|
||||
'pattern': 'connector',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'rpc-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/rpc-log-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'forward-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/forward-log-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'rpc-debug': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/rpc-debug-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'crash-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/crash.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'admin-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/admin.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'pinus': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/pinus-default.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'error': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/error.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'pinus-admin': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/pinus-admin.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'pinus-rpc': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/pinus-rpc-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
}
|
||||
},
|
||||
|
||||
'categories': {
|
||||
'default': {
|
||||
'appenders': ['console'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'pinus': {
|
||||
'appenders': ['console', 'pinus'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'con-log': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'rpc-log': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'forward-log': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'rpc-debug': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'crash-log': {
|
||||
'appenders': ['console', 'crash-log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'admin-log': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'pinus-admin': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'pinus-rpc': {
|
||||
'appenders': ['console', 'log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'logger': {
|
||||
'appenders': ['console', 'logger'],
|
||||
'level': 'error'
|
||||
}
|
||||
},
|
||||
|
||||
'prefix': '${opts:serverId} ',
|
||||
'replaceConsole': true,
|
||||
'lineDebug': false,
|
||||
'errorStack': true
|
||||
};
|
||||
134
game-server/config/isbn/log4js.ts
Normal file
134
game-server/config/isbn/log4js.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
module.exports = {
|
||||
'appenders': {
|
||||
'console': {
|
||||
'type': 'console'
|
||||
},
|
||||
'con-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/con-log-${opts:serverId}.log',
|
||||
'pattern': 'connector',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'rpc-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/rpc-log-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'forward-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/forward-log-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'rpc-debug': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/rpc-debug-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'crash-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/crash.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'admin-log': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/admin.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'pinus': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/pinus-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'pinus-admin': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/pinus-admin.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
},
|
||||
'pinus-rpc': {
|
||||
'type': 'file',
|
||||
'filename': '${opts:base}/logs/pinus-rpc-${opts:serverId}.log',
|
||||
'maxLogSize': 1048576,
|
||||
'layout': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'backups': 5
|
||||
}
|
||||
},
|
||||
|
||||
'categories': {
|
||||
'default': {
|
||||
'appenders': ['console', 'pinus'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'con-log': {
|
||||
'appenders': ['con-log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'rpc-log': {
|
||||
'appenders': ['rpc-log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'forward-log': {
|
||||
'appenders': ['forward-log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'rpc-debug': {
|
||||
'appenders': ['rpc-debug'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'crash-log': {
|
||||
'appenders': ['crash-log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'admin-log': {
|
||||
'appenders': ['admin-log'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'pinus-admin': {
|
||||
'appenders': ['pinus-admin'],
|
||||
'level': 'debug'
|
||||
},
|
||||
'pinus-rpc': {
|
||||
'appenders': ['pinus-rpc'],
|
||||
'level': 'debug'
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
'prefix': '${opts:serverId} ',
|
||||
'replaceConsole': true,
|
||||
'lineDebug': false,
|
||||
'errorStack': true
|
||||
};
|
||||
@@ -18,5 +18,10 @@ module.exports = {
|
||||
'id': 'master-server-1',
|
||||
'host': '127.0.0.1',
|
||||
'port': 3005
|
||||
},
|
||||
'isbn': {
|
||||
'id': 'master-server-1',
|
||||
'host': '127.0.0.1',
|
||||
'port': 3005
|
||||
}
|
||||
};
|
||||
@@ -63,11 +63,11 @@ declare module 'redis' {
|
||||
}
|
||||
}
|
||||
|
||||
export function connectRedis(redisArr: string) {
|
||||
export function connectRedis(redisArr: string, redisPw: string) {
|
||||
|
||||
// 创建 redis 连接
|
||||
const oldRedisClient = Redis.createClient(6379, redisArr, {detect_buffers: true});
|
||||
oldRedisClient.auth('zyz_2020', (err, reply) => {
|
||||
oldRedisClient.auth(redisPw, (err, reply) => {
|
||||
if (err) {
|
||||
console.log('redis err', err);
|
||||
} else {
|
||||
|
||||
@@ -145,5 +145,37 @@ module.exports = {
|
||||
'systimer': [
|
||||
{'id': 'systimer-server-1', 'host': '127.0.0.1', 'port': 6056, "args": " --inspect=9233"}
|
||||
]
|
||||
},
|
||||
'isbn': {
|
||||
'connector': [
|
||||
{'id': 'connector-server-1', 'port': 4050, 'clientHost': 'zyz_isbn.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3050, 'frontend': true},
|
||||
{'id': 'connector-server-2', 'port': 4051, 'clientHost': 'zyz_isbn.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3051, 'frontend': true},
|
||||
{'id': 'connector-server-3', 'port': 4052, 'clientHost': 'zyz_isbn.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3052, 'frontend': true}
|
||||
],
|
||||
'chat': [
|
||||
{'id': 'chat-server-1', 'host': '127.0.0.1', 'port': 6050},
|
||||
],
|
||||
'role': [
|
||||
{'id': 'role-server-1', 'host': '127.0.0.1', 'port': 6053}
|
||||
],
|
||||
'battle': [
|
||||
{'id': 'battle-server-1', 'host': '127.0.0.1', 'port': 6054}
|
||||
],
|
||||
'gate': [
|
||||
{'id': 'gate-server-1', 'host': '127.0.0.1', 'clientHost': 'zyz_isbn.trgame.cn', 'clientPort': 3014, 'frontend': true},
|
||||
{
|
||||
'id': 'gate-server-2',
|
||||
'host': '127.0.0.1',
|
||||
'clientHost': 'zyz_isbn.trgame.cn',
|
||||
'clientPort': 3015,
|
||||
'frontend': true
|
||||
}
|
||||
],
|
||||
'gm': [
|
||||
{'id': 'gm-server-1', 'host': '127.0.0.1', 'port': 6055}
|
||||
],
|
||||
'systimer': [
|
||||
{'id': 'systimer-server-1', 'host': '127.0.0.1', 'port': 6056}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,5 +41,20 @@ module.exports = {
|
||||
'gate': [
|
||||
{'id': 'gate-server-1', 'host': '127.0.0.1', 'clientPort': 3014, 'frontend': true}
|
||||
]
|
||||
},
|
||||
'isbn': {
|
||||
'connector': [
|
||||
{'id': 'connector-server-1', 'host': '127.0.0.1', 'port': 4050, 'clientPort': 3050, 'frontend': true},
|
||||
{'id': 'connector-server-2', 'host': '127.0.0.1', 'port': 4051, 'clientPort': 3051, 'frontend': true},
|
||||
{'id': 'connector-server-3', 'host': '127.0.0.1', 'port': 4052, 'clientPort': 3052, 'frontend': true}
|
||||
],
|
||||
'chat': [
|
||||
{'id': 'chat-server-1', 'host': '127.0.0.1', 'port': 6050},
|
||||
{'id': 'chat-server-2', 'host': '127.0.0.1', 'port': 6051},
|
||||
{'id': 'chat-server-3', 'host': '39.100.68.60', 'port': 6052}
|
||||
],
|
||||
'gate': [
|
||||
{'id': 'gate-server-1', 'host': '127.0.0.1', 'clientPort': 3014, 'frontend': true}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
@@ -539,7 +539,7 @@ export default class GMUsers extends Service {
|
||||
if (index < 0) continue;
|
||||
let args = calEquipSeids(hero);
|
||||
hero.ePlace[index].equip = null;
|
||||
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.EQUIP, roleId, hero, {}, null, args);
|
||||
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.EQUIP, roleId, hero, {}, args);
|
||||
}
|
||||
seqIds.push(seqId);
|
||||
}
|
||||
|
||||
55
gm-server/config/config.isbn.ts
Normal file
55
gm-server/config/config.isbn.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||
|
||||
export default (appInfo: EggAppInfo) => {
|
||||
const config = {} as PowerPartial<EggAppConfig>;
|
||||
|
||||
// override config from framework / plugin
|
||||
// use for cookie sign key, should change to your own and keep security
|
||||
config.keys = appInfo.name + '_1600244957952_7142';
|
||||
|
||||
// add your egg config in here
|
||||
config.middleware = [];
|
||||
|
||||
config.cluster = {
|
||||
listen: {
|
||||
port: 7500
|
||||
}
|
||||
};
|
||||
// add your special config in here
|
||||
const bizConfig = {
|
||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||
};
|
||||
|
||||
config.mongoose = {
|
||||
url: 'mongodb://root:Bantus123@dds-8vb74337eab84d641.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb74337eab84d642.mongodb.zhangbei.rds.aliyuncs.com:3717/admin?replicaSet=mgset-504694158', // 内网
|
||||
options: { useNewUrlParser: true, useUnifiedTopology: true },
|
||||
};
|
||||
|
||||
config.security = {
|
||||
csrf: {
|
||||
enable: false,
|
||||
ignoreJSON: true
|
||||
},
|
||||
domainWhiteList: ['http://localhost:9000']
|
||||
};
|
||||
|
||||
// 配置上传
|
||||
config.multipart = {
|
||||
fileSize: '50mb',
|
||||
mode: 'stream',
|
||||
fileExtensions: ['.zip', '.tar.gz'], // 扩展几种上传的文件格式
|
||||
};
|
||||
|
||||
config.alinode = {
|
||||
appid: '86043',
|
||||
secret: '54ef0364995b0c4f2ab42150e29ad30df8327a3a',
|
||||
error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
|
||||
packages: [ '/root/zyz/web-server/package.json' ],
|
||||
};
|
||||
|
||||
// the return config will combines to EggAppConfig
|
||||
return {
|
||||
...config,
|
||||
...bizConfig,
|
||||
};
|
||||
};
|
||||
@@ -13,6 +13,8 @@ elif [ ${1} == 'alpha' ] ; then
|
||||
destUrl="root@zyzalpha:/root/zyz/"
|
||||
elif [ ${1} == 'dev' ] ; then
|
||||
destUrl="root@zyzdev:/root/zyz/"
|
||||
elif [ ${1} == 'isbn' ] ; then
|
||||
destUrl="root@zyzisbn:/root/zyz/"
|
||||
else
|
||||
echo "需要一个参数指明服务器"
|
||||
exit 1;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, mongoose, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { MAIL_STATUS, MAIL_TYPE } from '../consts/constModules/mailConst';
|
||||
import { findWhere } from 'underscore';
|
||||
const { ObjectId } = mongoose.Types;
|
||||
|
||||
class RewardInter {
|
||||
@prop({ required: true })
|
||||
id: number;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, mongoose } from '@typegoose/typegoose';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { MAIL_STATUS, MAIL_TYPE } from '../consts/constModules/mailConst';
|
||||
const { ObjectId } = mongoose.Types;
|
||||
|
||||
class RewardInter {
|
||||
@prop({ required: true })
|
||||
id: number;
|
||||
|
||||
59
web-server/config/config.isbn.ts
Normal file
59
web-server/config/config.isbn.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||
const path = require('path');
|
||||
|
||||
export default (appInfo: EggAppInfo) => {
|
||||
const config = {} as PowerPartial<EggAppConfig>;
|
||||
|
||||
// override config from framework / plugin
|
||||
// use for cookie sign key, should change to your own and keep security
|
||||
config.keys = appInfo.name + '_1597499383757_3508';
|
||||
config.security = {
|
||||
csrf: {
|
||||
enable: false,
|
||||
},
|
||||
domainWhiteList: [ '*' ],
|
||||
};
|
||||
config.cors = {
|
||||
origin: '*', // 匹配规则 域名+端口 *则为全匹配
|
||||
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
|
||||
};
|
||||
// add your egg config in here
|
||||
config.middleware = [ 'parmsDecode' ];
|
||||
|
||||
config.mongoose = {
|
||||
url: 'mongodb://root:Bantus123@dds-8vb74337eab84d641.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb74337eab84d642.mongodb.zhangbei.rds.aliyuncs.com:3717/admin?replicaSet=mgset-504694158', // 内网
|
||||
options: { useNewUrlParser: true, useUnifiedTopology: true },
|
||||
};
|
||||
|
||||
config.alinode = {
|
||||
appid: '86043',
|
||||
secret: '54ef0364995b0c4f2ab42150e29ad30df8327a3a',
|
||||
error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
|
||||
packages: [ '/root/zyz/web-server/package.json' ],
|
||||
};
|
||||
|
||||
config.view = {
|
||||
root: path.join(appInfo.baseDir, '/app/public'),
|
||||
defaultViewEngine: 'nunjucks',
|
||||
mapping: {
|
||||
'.html': 'nunjucks' //左边写成.html后缀,会自动渲染.html文件
|
||||
},
|
||||
};
|
||||
|
||||
config.static = {
|
||||
prefix: '/',
|
||||
dir: path.join(appInfo.baseDir, '/app/public'),
|
||||
};
|
||||
|
||||
|
||||
// add your special config in here
|
||||
const bizConfig = {
|
||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||
};
|
||||
|
||||
// the return config will combines to EggAppConfig
|
||||
return {
|
||||
...config,
|
||||
...bizConfig,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user