cgserver 5.4.12 → 5.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Framework/AI/AiObject.d.ts +5 -0
- package/lib/Framework/AI/AiObject.js +11 -0
- package/lib/Framework/AI/AiObject.js.map +1 -0
- package/lib/Framework/AI/Astar.d.ts +38 -0
- package/lib/Framework/AI/Astar.js +134 -0
- package/lib/Framework/AI/Astar.js.map +1 -0
- package/lib/Framework/AI/BehaviorAI.d.ts +24 -0
- package/lib/Framework/AI/BehaviorAI.js +308 -0
- package/lib/Framework/AI/BehaviorAI.js.map +1 -0
- package/lib/Framework/AI/Entity.d.ts +12 -0
- package/lib/Framework/AI/Entity.js +34 -0
- package/lib/Framework/AI/Entity.js.map +1 -0
- package/lib/Framework/AI/Point.d.ts +17 -0
- package/lib/Framework/AI/Point.js +69 -0
- package/lib/Framework/AI/Point.js.map +1 -0
- package/lib/Framework/AI/TriggerMgr.d.ts +52 -0
- package/lib/Framework/AI/TriggerMgr.js +202 -0
- package/lib/Framework/AI/TriggerMgr.js.map +1 -0
- package/lib/Framework/Config/Config.d.ts +7 -0
- package/lib/Framework/Config/Config.js +38 -0
- package/lib/Framework/Config/Config.js.map +1 -0
- package/lib/Framework/Config/FrameworkConfig.d.ts +219 -0
- package/lib/Framework/Config/FrameworkConfig.js +225 -0
- package/lib/Framework/Config/FrameworkConfig.js.map +1 -0
- package/lib/Framework/Config/ServerConfig.d.ts +9 -0
- package/lib/Framework/Config/ServerConfig.js +19 -0
- package/lib/Framework/Config/ServerConfig.js.map +1 -0
- package/lib/Framework/Config/_error_.d.ts +95 -0
- package/lib/Framework/Config/_error_.js +35 -0
- package/lib/Framework/Config/_error_.js.map +1 -0
- package/lib/Framework/Core/Core.d.ts +101 -0
- package/lib/Framework/Core/Core.js +562 -0
- package/lib/Framework/Core/Core.js.map +1 -0
- package/lib/Framework/Core/Timer.d.ts +16 -0
- package/lib/Framework/Core/Timer.js +117 -0
- package/lib/Framework/Core/Timer.js.map +1 -0
- package/lib/Framework/Database/BaseMongoService.d.ts +67 -0
- package/lib/Framework/Database/BaseMongoService.js +80 -0
- package/lib/Framework/Database/BaseMongoService.js.map +1 -0
- package/lib/Framework/Database/BaseService.d.ts +34 -0
- package/lib/Framework/Database/BaseService.js +282 -0
- package/lib/Framework/Database/BaseService.js.map +1 -0
- package/lib/Framework/Database/Decorator/AutoIncrement.d.ts +1 -0
- package/lib/Framework/Database/Decorator/AutoIncrement.js +12 -0
- package/lib/Framework/Database/Decorator/AutoIncrement.js.map +1 -0
- package/lib/Framework/Database/Decorator/DBCache.d.ts +21 -0
- package/lib/Framework/Database/Decorator/DBCache.js +65 -0
- package/lib/Framework/Database/Decorator/DBCache.js.map +1 -0
- package/lib/Framework/Database/Decorator/NotNull.d.ts +1 -0
- package/lib/Framework/Database/Decorator/NotNull.js +12 -0
- package/lib/Framework/Database/Decorator/NotNull.js.map +1 -0
- package/lib/Framework/Database/Decorator/PrimaryKey.d.ts +1 -0
- package/lib/Framework/Database/Decorator/PrimaryKey.js +12 -0
- package/lib/Framework/Database/Decorator/PrimaryKey.js.map +1 -0
- package/lib/Framework/Database/Decorator/Property.d.ts +55 -0
- package/lib/Framework/Database/Decorator/Property.js +62 -0
- package/lib/Framework/Database/Decorator/Property.js.map +1 -0
- package/lib/Framework/Database/Decorator/Table.d.ts +1 -0
- package/lib/Framework/Database/Decorator/Table.js +16 -0
- package/lib/Framework/Database/Decorator/Table.js.map +1 -0
- package/lib/Framework/Database/Decorator/Type.d.ts +1 -0
- package/lib/Framework/Database/Decorator/Type.js +21 -0
- package/lib/Framework/Database/Decorator/Type.js.map +1 -0
- package/lib/Framework/Database/MongoManager.d.ts +135 -0
- package/lib/Framework/Database/MongoManager.js +407 -0
- package/lib/Framework/Database/MongoManager.js.map +1 -0
- package/lib/Framework/Database/MysqlManager.d.ts +41 -0
- package/lib/Framework/Database/MysqlManager.js +181 -0
- package/lib/Framework/Database/MysqlManager.js.map +1 -0
- package/lib/Framework/Database/RedisManager.d.ts +64 -0
- package/lib/Framework/Database/RedisManager.js +409 -0
- package/lib/Framework/Database/RedisManager.js.map +1 -0
- package/lib/Framework/Logic/CacheTool.d.ts +25 -0
- package/lib/Framework/Logic/CacheTool.js +74 -0
- package/lib/Framework/Logic/CacheTool.js.map +1 -0
- package/lib/Framework/Logic/HttpTool.d.ts +14 -0
- package/lib/Framework/Logic/HttpTool.js +59 -0
- package/lib/Framework/Logic/HttpTool.js.map +1 -0
- package/lib/Framework/Logic/Log.d.ts +15 -0
- package/lib/Framework/Logic/Log.js +78 -0
- package/lib/Framework/Logic/Log.js.map +1 -0
- package/lib/Framework/Service/AccountService.d.ts +77 -0
- package/lib/Framework/Service/AccountService.js +474 -0
- package/lib/Framework/Service/AccountService.js.map +1 -0
- package/lib/Framework/Service/MongoAccountService.d.ts +78 -0
- package/lib/Framework/Service/MongoAccountService.js +397 -0
- package/lib/Framework/Service/MongoAccountService.js.map +1 -0
- package/lib/Framework/Service/MongoCacheService.d.ts +13 -0
- package/lib/Framework/Service/MongoCacheService.js +28 -0
- package/lib/Framework/Service/MongoCacheService.js.map +1 -0
- package/lib/Framework/Service/MongoUserService.d.ts +36 -0
- package/lib/Framework/Service/MongoUserService.js +94 -0
- package/lib/Framework/Service/MongoUserService.js.map +1 -0
- package/lib/Framework/Service/UserService.d.ts +36 -0
- package/lib/Framework/Service/UserService.js +185 -0
- package/lib/Framework/Service/UserService.js.map +1 -0
- package/lib/Framework/Service/ini.d.ts +28 -0
- package/lib/Framework/Service/ini.js +36 -0
- package/lib/Framework/Service/ini.js.map +1 -0
- package/lib/Framework/SocketServer/IClientWebSocket.d.ts +24 -0
- package/lib/Framework/SocketServer/IClientWebSocket.js +72 -0
- package/lib/Framework/SocketServer/IClientWebSocket.js.map +1 -0
- package/lib/Framework/SocketServer/IServerWebSocket.d.ts +13 -0
- package/lib/Framework/SocketServer/IServerWebSocket.js +42 -0
- package/lib/Framework/SocketServer/IServerWebSocket.js.map +1 -0
- package/lib/Framework/SocketServer/ISocket.d.ts +44 -0
- package/lib/Framework/SocketServer/ISocket.js +224 -0
- package/lib/Framework/SocketServer/ISocket.js.map +1 -0
- package/lib/Framework/SocketServer/ISocketServer.d.ts +36 -0
- package/lib/Framework/SocketServer/ISocketServer.js +189 -0
- package/lib/Framework/SocketServer/ISocketServer.js.map +1 -0
- package/lib/Framework/SocketServer/IWebSocket copy.d.ts +44 -0
- package/lib/Framework/SocketServer/IWebSocket copy.js +224 -0
- package/lib/Framework/SocketServer/IWebSocket copy.js.map +1 -0
- package/lib/Framework/SocketServer/IWebSocket.d.ts +44 -0
- package/lib/Framework/SocketServer/IWebSocket.js +224 -0
- package/lib/Framework/SocketServer/IWebSocket.js.map +1 -0
- package/lib/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.d.ts +9 -0
- package/lib/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js +58 -0
- package/lib/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js.map +1 -0
- package/lib/Framework/SocketServer/ProtoFilter/IProtoFilter.d.ts +9 -0
- package/lib/Framework/SocketServer/ProtoFilter/IProtoFilter.js +9 -0
- package/lib/Framework/SocketServer/ProtoFilter/IProtoFilter.js.map +1 -0
- package/lib/Framework/SocketServer/ProtoFilter/JsonProtoFilter.d.ts +6 -0
- package/lib/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js +30 -0
- package/lib/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js.map +1 -0
- package/lib/Framework/SocketServer/ProtoFilter/ProtoFactory.d.ts +8 -0
- package/lib/Framework/SocketServer/ProtoFilter/ProtoFactory.js +32 -0
- package/lib/Framework/SocketServer/ProtoFilter/ProtoFactory.js.map +1 -0
- package/lib/Framework/ThirdParty/AlipayTool.d.ts +40 -0
- package/lib/Framework/ThirdParty/AlipayTool.js +123 -0
- package/lib/Framework/ThirdParty/AlipayTool.js.map +1 -0
- package/lib/Framework/ThirdParty/Alisms.d.ts +14 -0
- package/lib/Framework/ThirdParty/Alisms.js +47 -0
- package/lib/Framework/ThirdParty/Alisms.js.map +1 -0
- package/lib/Framework/ThirdParty/AppleTool.d.ts +131 -0
- package/lib/Framework/ThirdParty/AppleTool.js +235 -0
- package/lib/Framework/ThirdParty/AppleTool.js.map +1 -0
- package/lib/Framework/ThirdParty/EmailTool.d.ts +5 -0
- package/lib/Framework/ThirdParty/EmailTool.js +34 -0
- package/lib/Framework/ThirdParty/EmailTool.js.map +1 -0
- package/lib/Framework/ThirdParty/OpenSocial.d.ts +7 -0
- package/lib/Framework/ThirdParty/OpenSocial.js +33 -0
- package/lib/Framework/ThirdParty/OpenSocial.js.map +1 -0
- package/lib/Framework/ThirdParty/QQTool.d.ts +41 -0
- package/lib/Framework/ThirdParty/QQTool.js +116 -0
- package/lib/Framework/ThirdParty/QQTool.js.map +1 -0
- package/lib/Framework/ThirdParty/QiniuTool.d.ts +6 -0
- package/lib/Framework/ThirdParty/QiniuTool.js +22 -0
- package/lib/Framework/ThirdParty/QiniuTool.js.map +1 -0
- package/lib/Framework/ThirdParty/WechatOATool.d.ts +13 -0
- package/lib/Framework/ThirdParty/WechatOATool.js +62 -0
- package/lib/Framework/ThirdParty/WechatOATool.js.map +1 -0
- package/lib/Framework/ThirdParty/WechatTool.d.ts +20 -0
- package/lib/Framework/ThirdParty/WechatTool.js +75 -0
- package/lib/Framework/ThirdParty/WechatTool.js.map +1 -0
- package/lib/Framework/WebServer/Controller/BaseController.d.ts +33 -0
- package/lib/Framework/WebServer/Controller/BaseController.js +113 -0
- package/lib/Framework/WebServer/Controller/BaseController.js.map +1 -0
- package/lib/Framework/WebServer/Controller/BaseUserController.d.ts +26 -0
- package/lib/Framework/WebServer/Controller/BaseUserController.js +169 -0
- package/lib/Framework/WebServer/Controller/BaseUserController.js.map +1 -0
- package/lib/Framework/WebServer/Controller/MongoBaseUserController.d.ts +26 -0
- package/lib/Framework/WebServer/Controller/MongoBaseUserController.js +169 -0
- package/lib/Framework/WebServer/Controller/MongoBaseUserController.js.map +1 -0
- package/lib/Framework/WebServer/Decorator/AdminValidate.d.ts +1 -0
- package/lib/Framework/WebServer/Decorator/AdminValidate.js +20 -0
- package/lib/Framework/WebServer/Decorator/AdminValidate.js.map +1 -0
- package/lib/Framework/WebServer/Decorator/AuthorityValidate.d.ts +2 -0
- package/lib/Framework/WebServer/Decorator/AuthorityValidate.js +23 -0
- package/lib/Framework/WebServer/Decorator/AuthorityValidate.js.map +1 -0
- package/lib/Framework/WebServer/Decorator/CreatorValidate.d.ts +1 -0
- package/lib/Framework/WebServer/Decorator/CreatorValidate.js +20 -0
- package/lib/Framework/WebServer/Decorator/CreatorValidate.js.map +1 -0
- package/lib/Framework/WebServer/Decorator/JsonAdminValidate.d.ts +1 -0
- package/lib/Framework/WebServer/Decorator/JsonAdminValidate.js +16 -0
- package/lib/Framework/WebServer/Decorator/JsonAdminValidate.js.map +1 -0
- package/lib/Framework/WebServer/Decorator/JsonAuthorityValidate.d.ts +2 -0
- package/lib/Framework/WebServer/Decorator/JsonAuthorityValidate.js +21 -0
- package/lib/Framework/WebServer/Decorator/JsonAuthorityValidate.js.map +1 -0
- package/lib/Framework/WebServer/Decorator/JsonCreatorValidate.d.ts +1 -0
- package/lib/Framework/WebServer/Decorator/JsonCreatorValidate.js +20 -0
- package/lib/Framework/WebServer/Decorator/JsonCreatorValidate.js.map +1 -0
- package/lib/Framework/WebServer/Engine/ControllerManager.d.ts +21 -0
- package/lib/Framework/WebServer/Engine/ControllerManager.js +113 -0
- package/lib/Framework/WebServer/Engine/ControllerManager.js.map +1 -0
- package/lib/Framework/WebServer/Engine/Engine.d.ts +21 -0
- package/lib/Framework/WebServer/Engine/Engine.js +135 -0
- package/lib/Framework/WebServer/Engine/Engine.js.map +1 -0
- package/lib/Framework/WebServer/Engine/RazorJs.d.ts +21 -0
- package/lib/Framework/WebServer/Engine/RazorJs.js +545 -0
- package/lib/Framework/WebServer/Engine/RazorJs.js.map +1 -0
- package/lib/Framework/WebServer/Engine/Request.d.ts +35 -0
- package/lib/Framework/WebServer/Engine/Request.js +215 -0
- package/lib/Framework/WebServer/Engine/Request.js.map +1 -0
- package/lib/Framework/WebServer/Engine/Response.d.ts +28 -0
- package/lib/Framework/WebServer/Engine/Response.js +95 -0
- package/lib/Framework/WebServer/Engine/Response.js.map +1 -0
- package/lib/Framework/WebServer/IWebServer.d.ts +20 -0
- package/lib/Framework/WebServer/IWebServer.js +50 -0
- package/lib/Framework/WebServer/IWebServer.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FrameworkConfig = exports.GFCfg = exports.WebServerConfig = exports.ESessionType = void 0;
|
|
4
|
+
const Log_1 = require("../Logic/Log");
|
|
5
|
+
const ServerConfig_1 = require("./ServerConfig");
|
|
6
|
+
var ESessionType;
|
|
7
|
+
(function (ESessionType) {
|
|
8
|
+
ESessionType[ESessionType["Cache"] = 0] = "Cache";
|
|
9
|
+
ESessionType[ESessionType["Redis"] = 1] = "Redis";
|
|
10
|
+
ESessionType[ESessionType["Mongo"] = 2] = "Mongo";
|
|
11
|
+
})(ESessionType = exports.ESessionType || (exports.ESessionType = {}));
|
|
12
|
+
class WebServerConfig {
|
|
13
|
+
cache = {};
|
|
14
|
+
session_type = ESessionType.Cache;
|
|
15
|
+
debug = false;
|
|
16
|
+
web_name = "web";
|
|
17
|
+
port = 0;
|
|
18
|
+
cookie = {
|
|
19
|
+
prefix: "tiny_cookie_",
|
|
20
|
+
expires: {
|
|
21
|
+
account_remember: 7 * 24 * 60 * 60,
|
|
22
|
+
account: 10 * 60
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
routs = {
|
|
26
|
+
/**
|
|
27
|
+
* 如果设置了这一项,那网址里面就不用带模块名称,是不回解析的
|
|
28
|
+
*/
|
|
29
|
+
onlyModule: "Web",
|
|
30
|
+
defaults: { module: "Web", controller: "Index", action: "Index" }
|
|
31
|
+
};
|
|
32
|
+
ssl = null;
|
|
33
|
+
//默认不跨域
|
|
34
|
+
cors = null;
|
|
35
|
+
}
|
|
36
|
+
exports.WebServerConfig = WebServerConfig;
|
|
37
|
+
exports.GFCfg = null;
|
|
38
|
+
class FrameworkConfig extends ServerConfig_1.ServerConfig {
|
|
39
|
+
log = {
|
|
40
|
+
appenders: {
|
|
41
|
+
console: {
|
|
42
|
+
"type": "console",
|
|
43
|
+
"category": "console"
|
|
44
|
+
},
|
|
45
|
+
log_file: {
|
|
46
|
+
category: "log_file",
|
|
47
|
+
type: "file",
|
|
48
|
+
filename: "./logs/log_file/file.log",
|
|
49
|
+
maxLogSize: 10 * 1024 * 1024,
|
|
50
|
+
backups: 100,
|
|
51
|
+
},
|
|
52
|
+
log_date: {
|
|
53
|
+
category: "log_date",
|
|
54
|
+
type: "dateFile",
|
|
55
|
+
filename: "./logs/log_date/date",
|
|
56
|
+
alwaysIncludePattern: true,
|
|
57
|
+
pattern: "yyyy-MM-dd-hh.log"
|
|
58
|
+
},
|
|
59
|
+
client_log_file: {
|
|
60
|
+
category: "log_file",
|
|
61
|
+
type: "file",
|
|
62
|
+
filename: "./logs/client_log_file/file.log",
|
|
63
|
+
maxLogSize: 10 * 1024 * 1024,
|
|
64
|
+
backups: 100,
|
|
65
|
+
},
|
|
66
|
+
client_log_date: {
|
|
67
|
+
category: "log_date",
|
|
68
|
+
type: "dateFile",
|
|
69
|
+
filename: "./logs/client_log_date/date",
|
|
70
|
+
alwaysIncludePattern: true,
|
|
71
|
+
pattern: "yyyy-MM-dd.log"
|
|
72
|
+
},
|
|
73
|
+
error_log_file: {
|
|
74
|
+
category: "error_log_file",
|
|
75
|
+
type: "file",
|
|
76
|
+
filename: "./logs/error_log_file/file.log",
|
|
77
|
+
maxLogSize: 5 * 1024 * 1024,
|
|
78
|
+
backups: 100,
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
categories: {
|
|
82
|
+
default: {
|
|
83
|
+
appenders: ['log_date'],
|
|
84
|
+
level: 'ALL'
|
|
85
|
+
},
|
|
86
|
+
console: {
|
|
87
|
+
appenders: ['console'],
|
|
88
|
+
level: 'ALL'
|
|
89
|
+
},
|
|
90
|
+
log_file: {
|
|
91
|
+
appenders: ['log_file'],
|
|
92
|
+
level: 'ALL'
|
|
93
|
+
},
|
|
94
|
+
log_date: {
|
|
95
|
+
appenders: ['log_date'],
|
|
96
|
+
level: 'ALL'
|
|
97
|
+
},
|
|
98
|
+
client_log_file: {
|
|
99
|
+
appenders: ['client_log_file'],
|
|
100
|
+
level: 'ALL'
|
|
101
|
+
},
|
|
102
|
+
client_log_date: {
|
|
103
|
+
appenders: ['client_log_date'],
|
|
104
|
+
level: 'ALL'
|
|
105
|
+
},
|
|
106
|
+
error_log_file: {
|
|
107
|
+
appenders: ['error_log_file'],
|
|
108
|
+
level: 'ALL'
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
debug_msg = false;
|
|
113
|
+
local_host = "127.0.0.1";
|
|
114
|
+
internet_host = "127.0.0.1";
|
|
115
|
+
db = {
|
|
116
|
+
redis: {
|
|
117
|
+
open: false,
|
|
118
|
+
host: "127.0.0.1",
|
|
119
|
+
port: 6379,
|
|
120
|
+
database: 0,
|
|
121
|
+
password: null
|
|
122
|
+
},
|
|
123
|
+
mongo: {
|
|
124
|
+
open: false,
|
|
125
|
+
host: "www.eryinet.com",
|
|
126
|
+
port: 27017,
|
|
127
|
+
options: null,
|
|
128
|
+
database: 'achat'
|
|
129
|
+
},
|
|
130
|
+
mysql: {
|
|
131
|
+
open: true,
|
|
132
|
+
auto: false,
|
|
133
|
+
host: '127.0.0.1',
|
|
134
|
+
port: 3306,
|
|
135
|
+
user: 'root',
|
|
136
|
+
password: 'root',
|
|
137
|
+
database: 'gameall',
|
|
138
|
+
charset: 'utf8mb4'
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
third_cfg = {
|
|
142
|
+
open_social: {
|
|
143
|
+
app_id: "appid_42313131",
|
|
144
|
+
app_secret: "apps_FDS4342J34JL432",
|
|
145
|
+
auth_url: "http://47.99.195.103:6666/auth/account/",
|
|
146
|
+
user_url: "http://47.99.195.103:6666/auth/userinfo/",
|
|
147
|
+
update_pwd_url: "http://47.99.195.103:6666/auth/updatepwd/"
|
|
148
|
+
},
|
|
149
|
+
aliSms: {
|
|
150
|
+
signName: "而已网络",
|
|
151
|
+
accessKeyId: "LTAIeqjiZ5OCev0B",
|
|
152
|
+
secretAccessKey: "0w1fmDEORshI94QqtampBaAPQDqUAj",
|
|
153
|
+
templateCode: "SMS_154589473"
|
|
154
|
+
},
|
|
155
|
+
qiniu: {
|
|
156
|
+
host: "p0bj0dycx.bkt.clouddn.com",
|
|
157
|
+
bucket: "eryiniuniu",
|
|
158
|
+
accessKey: "OETxflxP9V5ZzPcjE30asCv-YxWBvDpmMPJegtI4",
|
|
159
|
+
secretKey: "kZWsom120P0-cfQt_9_1-wR_X8RwuLeMXKbU_uc4"
|
|
160
|
+
},
|
|
161
|
+
email: {
|
|
162
|
+
host: "smtp.live.com",
|
|
163
|
+
port: 587,
|
|
164
|
+
secure: false,
|
|
165
|
+
auth: {
|
|
166
|
+
user: "chengang01@live.com",
|
|
167
|
+
pass: "cg123!@#" // generated ethereal password
|
|
168
|
+
},
|
|
169
|
+
from: "OpenSocial <chengang01@live.com>"
|
|
170
|
+
},
|
|
171
|
+
qq: {
|
|
172
|
+
app_id: "101775753",
|
|
173
|
+
app_key: "753d0f02f3c4093062e7b2f56c7fcb0c",
|
|
174
|
+
redirect_uri: "http://www.eryinet.com/qq/callback"
|
|
175
|
+
},
|
|
176
|
+
wechat: {
|
|
177
|
+
app_id: "wx80f0f10fe1304e9d",
|
|
178
|
+
app_key: "a76fc337c49b309886a6538d31c344e2",
|
|
179
|
+
redirect_uri: "http://www.eryinet.com/wechat/callback"
|
|
180
|
+
},
|
|
181
|
+
alipay: {
|
|
182
|
+
open: false,
|
|
183
|
+
dev: false,
|
|
184
|
+
app_id: "",
|
|
185
|
+
app_key: "",
|
|
186
|
+
gateway: "",
|
|
187
|
+
//RSA1 RSA2
|
|
188
|
+
signType: 'RSA2',
|
|
189
|
+
/** 指定private key类型, 默认: PKCS1, PKCS8: PRIVATE KEY, PKCS1: RSA PRIVATE KEY */
|
|
190
|
+
keyType: 'PKCS1',
|
|
191
|
+
alipay_root_cert_sn: "",
|
|
192
|
+
alipay_cert_sn: "",
|
|
193
|
+
app_cert_sn: "",
|
|
194
|
+
notify_url: "",
|
|
195
|
+
app_id_dev: "",
|
|
196
|
+
app_key_dev: "",
|
|
197
|
+
gateway_dev: "",
|
|
198
|
+
//RSA1 RSA2
|
|
199
|
+
signType_dev: 'RSA2',
|
|
200
|
+
/** 指定private key类型, 默认: PKCS1, PKCS8: PRIVATE KEY, PKCS1: RSA PRIVATE KEY */
|
|
201
|
+
keyType_dev: 'PKCS1',
|
|
202
|
+
alipay_root_cert_sn_dev: "",
|
|
203
|
+
alipay_cert_sn_dev: "",
|
|
204
|
+
app_cert_sn_dev: "",
|
|
205
|
+
notify_url_dev: ""
|
|
206
|
+
},
|
|
207
|
+
apple: {
|
|
208
|
+
keyIds: {}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
//key是ip,value是domain
|
|
212
|
+
ip_to_domain = {};
|
|
213
|
+
root_path = process.cwd();
|
|
214
|
+
constructor(server_name) {
|
|
215
|
+
super(server_name);
|
|
216
|
+
}
|
|
217
|
+
init() {
|
|
218
|
+
let ret = super.init();
|
|
219
|
+
Log_1.GLog.init(this.log);
|
|
220
|
+
exports.GFCfg = this;
|
|
221
|
+
return ret;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
exports.FrameworkConfig = FrameworkConfig;
|
|
225
|
+
//# sourceMappingURL=FrameworkConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameworkConfig.js","sourceRoot":"","sources":["../../../Framework/Config/FrameworkConfig.ts"],"names":[],"mappings":";;;AACA,sCAAoC;AACpC,iDAA8C;AAC9C,IAAY,YAKX;AALD,WAAY,YAAY;IAEpB,iDAAK,CAAA;IACL,iDAAK,CAAA;IACL,iDAAK,CAAA;AACT,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AACD,MAAa,eAAe;IAExB,KAAK,GAAC,EAAE,CAAA;IACR,YAAY,GAAC,YAAY,CAAC,KAAK,CAAA;IAC/B,KAAK,GAAC,KAAK,CAAA;IACX,QAAQ,GAAC,KAAK,CAAA;IACd,IAAI,GAAC,CAAC,CAAA;IACN,MAAM,GACN;QACI,MAAM,EAAC,cAAc;QACrB,OAAO,EACP;YACI,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;YAClC,OAAO,EAAE,EAAE,GAAG,EAAE;SACnB;KACJ,CAAA;IACD,KAAK,GACL;QACI;;WAEG;QACH,UAAU,EAAC,KAAK;QAChB,QAAQ,EAAE,EAAE,MAAM,EAAC,KAAK,EAAC,UAAU,EAAG,OAAO,EAAE,MAAM,EAAG,OAAO,EAAC;KACnE,CAAA;IACD,GAAG,GAID,IAAI,CAAA;IACN,OAAO;IACP,IAAI,GAMF,IAAI,CAAA;CACT;AArCD,0CAqCC;AACU,QAAA,KAAK,GAAiB,IAAI,CAAA;AACrC,MAAa,eAAgB,SAAQ,2BAAY;IAE7C,GAAG,GACH;QACI,SAAS,EACT;YACI,OAAO,EACP;gBACI,MAAM,EAAC,SAAS;gBAChB,UAAU,EAAC,SAAS;aACvB;YACD,QAAQ,EACR;gBACI,QAAQ,EAAC,UAAU;gBACnB,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,EAAE,GAAC,IAAI,GAAC,IAAI;gBACxB,OAAO,EAAE,GAAG;aACf;YACD,QAAQ,EACR;gBACI,QAAQ,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
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WebServerConfig } from './FrameworkConfig';
|
|
2
|
+
import { Config } from "./Config";
|
|
3
|
+
export declare class ServerConfig extends Config {
|
|
4
|
+
port: number;
|
|
5
|
+
protected _server_name: string;
|
|
6
|
+
webserver: WebServerConfig;
|
|
7
|
+
get serverName(): string;
|
|
8
|
+
constructor(server_name: any);
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerConfig = void 0;
|
|
4
|
+
const Config_1 = require("./Config");
|
|
5
|
+
class ServerConfig extends Config_1.Config {
|
|
6
|
+
port = -1;
|
|
7
|
+
_server_name = "";
|
|
8
|
+
webserver = null;
|
|
9
|
+
get serverName() {
|
|
10
|
+
return this._server_name;
|
|
11
|
+
}
|
|
12
|
+
constructor(server_name) {
|
|
13
|
+
super("FrameworkConfig");
|
|
14
|
+
this._suffix = server_name;
|
|
15
|
+
this._server_name = server_name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ServerConfig = ServerConfig;
|
|
19
|
+
//# sourceMappingURL=ServerConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerConfig.js","sourceRoot":"","sources":["../../../Framework/Config/ServerConfig.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC,MAAa,YAAa,SAAQ,eAAM;IAEpC,IAAI,GAAC,CAAC,CAAC,CAAA;IACG,YAAY,GAAC,EAAE,CAAA;IACzB,SAAS,GAAiB,IAAI,CAAA;IAC9B,IAAI,UAAU;QAEV,OAAO,IAAI,CAAC,YAAY,CAAA;IAC5B,CAAC;IACD,YAAY,WAAW;QAEnB,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACxB,IAAI,CAAC,OAAO,GAAC,WAAW,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;IACnC,CAAC;CACJ;AAfD,oCAeC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export declare let EErrorCode: FrameworkErrorCode;
|
|
2
|
+
/**
|
|
3
|
+
* 1-100
|
|
4
|
+
*/
|
|
5
|
+
export declare class FrameworkErrorCode {
|
|
6
|
+
Wrong_Params: {
|
|
7
|
+
id: number;
|
|
8
|
+
des: string;
|
|
9
|
+
};
|
|
10
|
+
Verify_failed: {
|
|
11
|
+
id: number;
|
|
12
|
+
des: string;
|
|
13
|
+
};
|
|
14
|
+
Account_Create_Failed: {
|
|
15
|
+
id: number;
|
|
16
|
+
des: string;
|
|
17
|
+
};
|
|
18
|
+
User_Create_Failed: {
|
|
19
|
+
id: number;
|
|
20
|
+
des: string;
|
|
21
|
+
};
|
|
22
|
+
Server_Error: {
|
|
23
|
+
id: number;
|
|
24
|
+
des: string;
|
|
25
|
+
};
|
|
26
|
+
No_Account: {
|
|
27
|
+
id: number;
|
|
28
|
+
des: string;
|
|
29
|
+
};
|
|
30
|
+
Mysql_Error: {
|
|
31
|
+
id: number;
|
|
32
|
+
des: string;
|
|
33
|
+
};
|
|
34
|
+
No_Mysql: {
|
|
35
|
+
id: number;
|
|
36
|
+
des: string;
|
|
37
|
+
};
|
|
38
|
+
No_User: {
|
|
39
|
+
id: number;
|
|
40
|
+
des: string;
|
|
41
|
+
};
|
|
42
|
+
Account_Phone_Exist: {
|
|
43
|
+
id: number;
|
|
44
|
+
des: string;
|
|
45
|
+
};
|
|
46
|
+
Account_Email_Exist: {
|
|
47
|
+
id: number;
|
|
48
|
+
des: string;
|
|
49
|
+
};
|
|
50
|
+
Account_Name_Exist: {
|
|
51
|
+
id: number;
|
|
52
|
+
des: string;
|
|
53
|
+
};
|
|
54
|
+
Account_Type_Error: {
|
|
55
|
+
id: number;
|
|
56
|
+
des: string;
|
|
57
|
+
};
|
|
58
|
+
Email_Send_Failed: {
|
|
59
|
+
id: number;
|
|
60
|
+
des: string;
|
|
61
|
+
};
|
|
62
|
+
Login_Failed: {
|
|
63
|
+
id: number;
|
|
64
|
+
des: string;
|
|
65
|
+
};
|
|
66
|
+
Password_Too_Short: {
|
|
67
|
+
id: number;
|
|
68
|
+
des: string;
|
|
69
|
+
};
|
|
70
|
+
Wrong_Phone: {
|
|
71
|
+
id: number;
|
|
72
|
+
des: string;
|
|
73
|
+
};
|
|
74
|
+
PhoneCode_Too_Quick: {
|
|
75
|
+
id: number;
|
|
76
|
+
des: string;
|
|
77
|
+
};
|
|
78
|
+
PhoneCode_GetFailed: {
|
|
79
|
+
id: number;
|
|
80
|
+
des: string;
|
|
81
|
+
};
|
|
82
|
+
Wrong_Phone_Code: {
|
|
83
|
+
id: number;
|
|
84
|
+
des: string;
|
|
85
|
+
};
|
|
86
|
+
No_Mongo: {
|
|
87
|
+
id: number;
|
|
88
|
+
des: string;
|
|
89
|
+
};
|
|
90
|
+
Mongo_Error: {
|
|
91
|
+
id: number;
|
|
92
|
+
des: string;
|
|
93
|
+
};
|
|
94
|
+
constructor();
|
|
95
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FrameworkErrorCode = exports.EErrorCode = void 0;
|
|
4
|
+
exports.EErrorCode = null;
|
|
5
|
+
/**
|
|
6
|
+
* 1-100
|
|
7
|
+
*/
|
|
8
|
+
class FrameworkErrorCode {
|
|
9
|
+
Wrong_Params = { id: 1, des: "参数错误" };
|
|
10
|
+
Verify_failed = { id: 2, des: "验证失败" };
|
|
11
|
+
Account_Create_Failed = { id: 3, des: "账号创建失败" };
|
|
12
|
+
User_Create_Failed = { id: 4, des: "角色创建失败" };
|
|
13
|
+
Server_Error = { id: 5, des: "服务器内部错误" };
|
|
14
|
+
No_Account = { id: 6, des: "账户不存在" };
|
|
15
|
+
Mysql_Error = { id: 7, des: "数据库异常" };
|
|
16
|
+
No_Mysql = { id: 8, des: "未开通数据库" };
|
|
17
|
+
No_User = { id: 9, des: "用户不存在" };
|
|
18
|
+
Account_Phone_Exist = { id: 10, des: "电话已存在" };
|
|
19
|
+
Account_Email_Exist = { id: 11, des: "邮箱已存在" };
|
|
20
|
+
Account_Name_Exist = { id: 12, des: "账户名已存在" };
|
|
21
|
+
Account_Type_Error = { id: 13, des: "账户类型错误" };
|
|
22
|
+
Email_Send_Failed = { id: 14, des: "邮件发送失败" };
|
|
23
|
+
Login_Failed = { id: 15, des: "登陆验证失败" };
|
|
24
|
+
Password_Too_Short = { id: 16, des: "密码太短" };
|
|
25
|
+
Wrong_Phone = { id: 17, des: "电话号码不正确" };
|
|
26
|
+
PhoneCode_Too_Quick = { id: 18, des: "验证码获取过快,请稍后再试" };
|
|
27
|
+
PhoneCode_GetFailed = { id: 19, des: "验证码获取失败" };
|
|
28
|
+
Wrong_Phone_Code = { id: 20, des: "验证码不正确" };
|
|
29
|
+
No_Mongo = { id: 21, des: "未开通Mongo数据库" };
|
|
30
|
+
Mongo_Error = { id: 22, des: "Mongo数据库异常" };
|
|
31
|
+
constructor() { }
|
|
32
|
+
}
|
|
33
|
+
exports.FrameworkErrorCode = FrameworkErrorCode;
|
|
34
|
+
exports.EErrorCode = new FrameworkErrorCode();
|
|
35
|
+
//# sourceMappingURL=_error_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_error_.js","sourceRoot":"","sources":["../../../Framework/Config/_error_.ts"],"names":[],"mappings":";;;AAAW,QAAA,UAAU,GAAqB,IAAI,CAAA;AAC9C;;GAEG;AACH,MAAa,kBAAkB;IAE3B,YAAY,GAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;IACpC,aAAa,GAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;IACrC,qBAAqB,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,QAAQ,EAAC,CAAA;IAC3C,kBAAkB,GAAG,EAAC,EAAE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AC,SAAS,EAAC,CAAA;IAC3C,gBAAgB,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,QAAQ,EAAC,CAAA;IACvC,QAAQ,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,aAAa,EAAC,CAAA;IACpC,WAAW,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,YAAY,EAAC,CAAA;IACtC,gBAAc,CAAC;CAClB;AAzBD,gDAyBC;AACD,kBAAU,GAAC,IAAI,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 常用的工具函数类
|
|
3
|
+
*/
|
|
4
|
+
export declare class core {
|
|
5
|
+
/**
|
|
6
|
+
* 判断变量是不是对象
|
|
7
|
+
* @param param 需要检查的变量
|
|
8
|
+
* @returns true为对象
|
|
9
|
+
*/
|
|
10
|
+
static isObject(param: any): boolean;
|
|
11
|
+
static isArray(param: any): boolean;
|
|
12
|
+
static isNumber(param: any): boolean;
|
|
13
|
+
static isNaN(param: any): boolean;
|
|
14
|
+
static isFunction(param: any): boolean;
|
|
15
|
+
static isString(param: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 深度拷贝
|
|
18
|
+
* @param obj
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
static clone(obj: any): any;
|
|
22
|
+
static merge(dest: any, src: any): any;
|
|
23
|
+
static getExit(template: any, src: any): {};
|
|
24
|
+
static toArray(table: any): any[];
|
|
25
|
+
static foreach(items: any, callback: any): void;
|
|
26
|
+
static getLength(items: any): number;
|
|
27
|
+
static char2buf(str: any): ArrayBuffer;
|
|
28
|
+
static array2arraybuffer(array: any): ArrayBuffer;
|
|
29
|
+
static arraybuffer2array(buffer: ArrayBufferLike): Uint8Array;
|
|
30
|
+
static firstCharUpCase(str: any): any;
|
|
31
|
+
static convertIntToUInt8Array(num: any): Uint8Array;
|
|
32
|
+
static convertUInt8ArrayToInt(array: any): number;
|
|
33
|
+
static getArrayFromArray(data: any, start: any, l?: any): Uint8Array;
|
|
34
|
+
static blobToArrayBuffer(data: any, callback: any): void;
|
|
35
|
+
static format: (src: any, formatStr: any) => any;
|
|
36
|
+
/**
|
|
37
|
+
* 字符串中间保密
|
|
38
|
+
* @param str
|
|
39
|
+
*/
|
|
40
|
+
static fuzzy(str: string): string;
|
|
41
|
+
static md5: (data: any) => any;
|
|
42
|
+
static getLocalIP: () => any;
|
|
43
|
+
static getIP: () => Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* 判断是否是手机号
|
|
46
|
+
* @param phone 手机号
|
|
47
|
+
*/
|
|
48
|
+
static isPhoneNo(phone: any): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 判断是否是email
|
|
51
|
+
* @param email
|
|
52
|
+
*/
|
|
53
|
+
static isEmail(email: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* 根据概率分布获取概率分布的下标
|
|
56
|
+
* @param probabilitys 概率分布列表
|
|
57
|
+
* @param totalProbability 总概率
|
|
58
|
+
*/
|
|
59
|
+
static getRandomIndex(probabilitys: Array<number>, totalProbability?: number): number;
|
|
60
|
+
/**
|
|
61
|
+
* 检查是否是闰年
|
|
62
|
+
* @param year
|
|
63
|
+
*/
|
|
64
|
+
static checkLeap(year: any): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 获取几月一共有多少天
|
|
67
|
+
* @param year
|
|
68
|
+
* @param month
|
|
69
|
+
*/
|
|
70
|
+
static getMonthDays(year: any, month: any): number;
|
|
71
|
+
/**
|
|
72
|
+
* 获取今日开始的时间
|
|
73
|
+
*/
|
|
74
|
+
static getTodayStartTime(): number;
|
|
75
|
+
/**
|
|
76
|
+
* 获取某个时间的开始时间
|
|
77
|
+
* @param time 时间戳
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
80
|
+
static getStartTime(time?: number): number;
|
|
81
|
+
static getLastMonthStartTime(): number;
|
|
82
|
+
static getCurMonthStartTime(): number;
|
|
83
|
+
static getLastWeekStartTime(): number;
|
|
84
|
+
static getCurWeekStartTime(): number;
|
|
85
|
+
static isSameMonth(src_time: number, target_time: number): boolean;
|
|
86
|
+
static isSameDay(src_time: number, target_time: number): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* 两个日期是否是同一周
|
|
89
|
+
* 思路: 因为1970年1月1 是周4 所以(天数+4)/7 取整 就是周数 如果相同就是同一周反之就不是
|
|
90
|
+
* @param old
|
|
91
|
+
* @param now
|
|
92
|
+
*/
|
|
93
|
+
static isSameWeek(src_time: number, target_time: number): boolean;
|
|
94
|
+
static sum(datas: Array<number>): number;
|
|
95
|
+
/**
|
|
96
|
+
* 转球为全球数字格式,三位数一个逗号
|
|
97
|
+
* @param num
|
|
98
|
+
*/
|
|
99
|
+
static convertToGlobalStr(num: number): string;
|
|
100
|
+
static sleep(milliseconds: any): Promise<unknown>;
|
|
101
|
+
}
|