cgserver 6.2.7 → 6.2.10
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.
|
@@ -157,12 +157,12 @@ class IWebSocket {
|
|
|
157
157
|
try {
|
|
158
158
|
if (Core_1.core.isAsyncFunc(otherfunc)) {
|
|
159
159
|
//默认支持其他所有处理消息
|
|
160
|
-
await otherfunc(jsonData).catch((reason) => {
|
|
160
|
+
await otherfunc.call(this, jsonData).catch((reason) => {
|
|
161
161
|
Log_1.GLog.error(reason);
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
otherfunc(jsonData);
|
|
165
|
+
otherfunc.call(this, jsonData);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
catch (e) {
|
|
@@ -177,12 +177,12 @@ class IWebSocket {
|
|
|
177
177
|
try {
|
|
178
178
|
if (Core_1.core.isAsyncFunc(func)) {
|
|
179
179
|
//默认支持其他所有处理消息
|
|
180
|
-
await func(jsonData).catch((reason) => {
|
|
180
|
+
await func.call(this, jsonData).catch((reason) => {
|
|
181
181
|
Log_1.GLog.error(reason);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
|
-
func(jsonData);
|
|
185
|
+
func.call(this, jsonData);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
catch (e) {
|
|
@@ -94,7 +94,7 @@ class BaseUserController extends BaseController_1.BaseController {
|
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
if (!this._session_id) {
|
|
97
|
-
this._session_id = Math.random().toString(36).
|
|
97
|
+
this._session_id = Math.random().toString(36).substring(2) + user.id;
|
|
98
98
|
}
|
|
99
99
|
let time = 0;
|
|
100
100
|
if (this._request.postData.remember == "on") {
|
package/dist/lib/cgserver.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.JsonProtoFilter = exports.GoogleProtoFilter = exports.MongoCacheModel = exports.GMongoCacheSer = exports.MongoUserModel = exports.MysqlUserModel = exports.MongoUserService = exports.MysqlUserService = exports.GMongoAccountSer = exports.MongoAccountService = exports.GMysqlAccountSer = exports.MysqlAccountService = exports.EAccountFrom = exports.EUserState = exports.ERoleGroup = exports.GLog = exports.GHttpTool = exports.GCacheTool = exports.RedisManager = exports.GRedisMgr = exports.GMysqlMgr = exports.MysqlBaseService = exports.GMSSqlMgr = exports.GMongoMgr = exports.MongoBaseModel = exports.MysqlBaseModel = exports.MongoBaseService = exports.EPropertyType = exports.Type = exports.Table = exports.Property = exports.PrimaryKey = exports.NotNull = exports.AutoIncrement = exports.Timer = exports.core = exports.ServerConfig = exports.GFCfg = exports.FrameworkConfig = exports.Config = exports.FrameworkErrorCode = exports.GTriggerMgr = exports.Trigger = exports.Point = exports.Entity = exports.BehaviorAI = exports.AStar = exports.AiObject = exports.GDBCache = exports.GProtoFactory = void 0;
|
|
4
|
-
exports.WebServerConfig = exports.Response = exports.Request = exports.RazorJs = exports.Engine = exports.GCtrMgr = exports.JsonCreatorValidate = exports.JsonAuthorityValidate = exports.JsonAdminValidate = exports.CreatorValidate = exports.AuthorityValidate = exports.AdminValidate = exports.MongoAccountModel = exports.MysqlAccountModel = exports.MongoBaseUserController = exports.BaseUserController = exports.BaseController = exports.IWebServer = exports.GWechatTool = exports.GWechatOATool = exports.GQQTool = exports.GQiniuTool = exports.GOpenSocial = exports.GEmailTool = exports.GAppleTool = exports.GSmsTool = exports.GAlipayTool = exports.IWebSocket = exports.ISocketServer = exports.IServerWebSocket = exports.IClientWebSocket = void 0;
|
|
4
|
+
exports.GCgServer = exports.WebServerConfig = exports.Response = exports.Request = exports.RazorJs = exports.Engine = exports.GCtrMgr = exports.JsonCreatorValidate = exports.JsonAuthorityValidate = exports.JsonAdminValidate = exports.CreatorValidate = exports.AuthorityValidate = exports.AdminValidate = exports.MongoAccountModel = exports.MysqlAccountModel = exports.MongoBaseUserController = exports.BaseUserController = exports.BaseController = exports.IWebServer = exports.GWechatTool = exports.GWechatOATool = exports.GQQTool = exports.GQiniuTool = exports.GOpenSocial = exports.GEmailTool = exports.GAppleTool = exports.GSmsTool = exports.GAlipayTool = exports.IWebSocket = exports.ISocketServer = exports.IServerWebSocket = exports.IClientWebSocket = void 0;
|
|
5
5
|
var ProtoFactory_1 = require("./SocketServer/ProtoFilter/ProtoFactory");
|
|
6
6
|
Object.defineProperty(exports, "GProtoFactory", { enumerable: true, get: function () { return ProtoFactory_1.GProtoFactory; } });
|
|
7
7
|
var DBCache_1 = require("./Database/Decorator/DBCache");
|
|
@@ -157,4 +157,17 @@ var Response_1 = require("./WebServer/Engine/Response");
|
|
|
157
157
|
Object.defineProperty(exports, "Response", { enumerable: true, get: function () { return Response_1.Response; } });
|
|
158
158
|
var FrameworkConfig_2 = require("./Config/FrameworkConfig");
|
|
159
159
|
Object.defineProperty(exports, "WebServerConfig", { enumerable: true, get: function () { return FrameworkConfig_2.WebServerConfig; } });
|
|
160
|
-
|
|
160
|
+
const Log_2 = require("./Logic/Log");
|
|
161
|
+
class CgServer {
|
|
162
|
+
constructor() {
|
|
163
|
+
this.init();
|
|
164
|
+
}
|
|
165
|
+
init() {
|
|
166
|
+
process.on("uncaughtException", this.onUnCaughtException.bind(this));
|
|
167
|
+
process.env.TZ = "Asia/Shanghai";
|
|
168
|
+
}
|
|
169
|
+
onUnCaughtException(e) {
|
|
170
|
+
Log_2.GLog.error(e.stack);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.GCgServer = new CgServer();
|
package/dist/types/cgserver.d.ts
CHANGED
|
@@ -72,3 +72,9 @@ export { RazorJs } from './WebServer/Engine/RazorJs';
|
|
|
72
72
|
export { Request } from './WebServer/Engine/Request';
|
|
73
73
|
export { Response } from './WebServer/Engine/Response';
|
|
74
74
|
export { WebServerConfig } from './Config/FrameworkConfig';
|
|
75
|
+
declare class CgServer {
|
|
76
|
+
constructor();
|
|
77
|
+
init(): void;
|
|
78
|
+
onUnCaughtException(e: any): void;
|
|
79
|
+
}
|
|
80
|
+
export declare let GCgServer: CgServer;
|