cgserver 7.9.2113 → 7.11.2113

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.
Files changed (468) hide show
  1. package/package.json +1 -1
  2. package/dist/Framework/AI/AiObject.js +0 -11
  3. package/dist/Framework/AI/AiObject.js.map +0 -1
  4. package/dist/Framework/AI/Astar.js +0 -134
  5. package/dist/Framework/AI/Astar.js.map +0 -1
  6. package/dist/Framework/AI/BehaviorAI.js +0 -309
  7. package/dist/Framework/AI/BehaviorAI.js.map +0 -1
  8. package/dist/Framework/AI/Entity.js +0 -34
  9. package/dist/Framework/AI/Entity.js.map +0 -1
  10. package/dist/Framework/AI/Point.js +0 -69
  11. package/dist/Framework/AI/Point.js.map +0 -1
  12. package/dist/Framework/AI/TriggerMgr.js +0 -202
  13. package/dist/Framework/AI/TriggerMgr.js.map +0 -1
  14. package/dist/Framework/Config/Config.js +0 -55
  15. package/dist/Framework/Config/Config.js.map +0 -1
  16. package/dist/Framework/Config/FrameworkConfig.js +0 -241
  17. package/dist/Framework/Config/FrameworkConfig.js.map +0 -1
  18. package/dist/Framework/Config/IServerConfig.js +0 -27
  19. package/dist/Framework/Config/IServerConfig.js.map +0 -1
  20. package/dist/Framework/Config/_error_.js +0 -36
  21. package/dist/Framework/Config/_error_.js.map +0 -1
  22. package/dist/Framework/Core/Core.js +0 -641
  23. package/dist/Framework/Core/Core.js.map +0 -1
  24. package/dist/Framework/Core/Timer.js +0 -117
  25. package/dist/Framework/Core/Timer.js.map +0 -1
  26. package/dist/Framework/Database/Decorator/AutoIncrement.js +0 -12
  27. package/dist/Framework/Database/Decorator/AutoIncrement.js.map +0 -1
  28. package/dist/Framework/Database/Decorator/DBCache.js +0 -66
  29. package/dist/Framework/Database/Decorator/DBCache.js.map +0 -1
  30. package/dist/Framework/Database/Decorator/NotNull.js +0 -12
  31. package/dist/Framework/Database/Decorator/NotNull.js.map +0 -1
  32. package/dist/Framework/Database/Decorator/PrimaryKey.js +0 -12
  33. package/dist/Framework/Database/Decorator/PrimaryKey.js.map +0 -1
  34. package/dist/Framework/Database/Decorator/Property.js +0 -62
  35. package/dist/Framework/Database/Decorator/Property.js.map +0 -1
  36. package/dist/Framework/Database/Decorator/Table.js +0 -16
  37. package/dist/Framework/Database/Decorator/Table.js.map +0 -1
  38. package/dist/Framework/Database/Decorator/Type.js +0 -21
  39. package/dist/Framework/Database/Decorator/Type.js.map +0 -1
  40. package/dist/Framework/Database/MSSqlManager.js +0 -45
  41. package/dist/Framework/Database/MSSqlManager.js.map +0 -1
  42. package/dist/Framework/Database/MongoBaseService.js +0 -115
  43. package/dist/Framework/Database/MongoBaseService.js.map +0 -1
  44. package/dist/Framework/Database/MongoManager.js +0 -429
  45. package/dist/Framework/Database/MongoManager.js.map +0 -1
  46. package/dist/Framework/Database/MysqlBaseService.js +0 -282
  47. package/dist/Framework/Database/MysqlBaseService.js.map +0 -1
  48. package/dist/Framework/Database/MysqlManager.js +0 -182
  49. package/dist/Framework/Database/MysqlManager.js.map +0 -1
  50. package/dist/Framework/Database/RedisManager.js +0 -410
  51. package/dist/Framework/Database/RedisManager.js.map +0 -1
  52. package/dist/Framework/Logic/CacheTool.js +0 -75
  53. package/dist/Framework/Logic/CacheTool.js.map +0 -1
  54. package/dist/Framework/Logic/EventTool.js +0 -29
  55. package/dist/Framework/Logic/EventTool.js.map +0 -1
  56. package/dist/Framework/Logic/HttpTool.js +0 -77
  57. package/dist/Framework/Logic/HttpTool.js.map +0 -1
  58. package/dist/Framework/Logic/Log.js +0 -142
  59. package/dist/Framework/Logic/Log.js.map +0 -1
  60. package/dist/Framework/Logic/SyncQueueTool.js +0 -44
  61. package/dist/Framework/Logic/SyncQueueTool.js.map +0 -1
  62. package/dist/Framework/Service/AccountService.js +0 -482
  63. package/dist/Framework/Service/AccountService.js.map +0 -1
  64. package/dist/Framework/Service/MongoAccountService.js +0 -404
  65. package/dist/Framework/Service/MongoAccountService.js.map +0 -1
  66. package/dist/Framework/Service/MongoCacheService.js +0 -43
  67. package/dist/Framework/Service/MongoCacheService.js.map +0 -1
  68. package/dist/Framework/Service/MongoUserService.js +0 -95
  69. package/dist/Framework/Service/MongoUserService.js.map +0 -1
  70. package/dist/Framework/Service/UserService.js +0 -200
  71. package/dist/Framework/Service/UserService.js.map +0 -1
  72. package/dist/Framework/Service/ini.js +0 -37
  73. package/dist/Framework/Service/ini.js.map +0 -1
  74. package/dist/Framework/SocketServer/IClientWebSocket.js +0 -45
  75. package/dist/Framework/SocketServer/IClientWebSocket.js.map +0 -1
  76. package/dist/Framework/SocketServer/IRpc.js +0 -13
  77. package/dist/Framework/SocketServer/IRpc.js.map +0 -1
  78. package/dist/Framework/SocketServer/IRpcClientWebSocket.js +0 -64
  79. package/dist/Framework/SocketServer/IRpcClientWebSocket.js.map +0 -1
  80. package/dist/Framework/SocketServer/IRpcServerWebSocket.js +0 -64
  81. package/dist/Framework/SocketServer/IRpcServerWebSocket.js.map +0 -1
  82. package/dist/Framework/SocketServer/IServerWebSocket.js +0 -77
  83. package/dist/Framework/SocketServer/IServerWebSocket.js.map +0 -1
  84. package/dist/Framework/SocketServer/ISocketServer.js +0 -204
  85. package/dist/Framework/SocketServer/ISocketServer.js.map +0 -1
  86. package/dist/Framework/SocketServer/IWebSocket.js +0 -197
  87. package/dist/Framework/SocketServer/IWebSocket.js.map +0 -1
  88. package/dist/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js +0 -59
  89. package/dist/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js.map +0 -1
  90. package/dist/Framework/SocketServer/ProtoFilter/IProtoFilter.js +0 -9
  91. package/dist/Framework/SocketServer/ProtoFilter/IProtoFilter.js.map +0 -1
  92. package/dist/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js +0 -30
  93. package/dist/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js.map +0 -1
  94. package/dist/Framework/SocketServer/ProtoFilter/ProtoFactory.js +0 -32
  95. package/dist/Framework/SocketServer/ProtoFilter/ProtoFactory.js.map +0 -1
  96. package/dist/Framework/ThirdParty/AlipayTool.js +0 -205
  97. package/dist/Framework/ThirdParty/AlipayTool.js.map +0 -1
  98. package/dist/Framework/ThirdParty/Alisms.js +0 -47
  99. package/dist/Framework/ThirdParty/Alisms.js.map +0 -1
  100. package/dist/Framework/ThirdParty/AppleTool.js +0 -236
  101. package/dist/Framework/ThirdParty/AppleTool.js.map +0 -1
  102. package/dist/Framework/ThirdParty/CgMq.js +0 -133
  103. package/dist/Framework/ThirdParty/CgMq.js.map +0 -1
  104. package/dist/Framework/ThirdParty/EmailTool.js +0 -35
  105. package/dist/Framework/ThirdParty/EmailTool.js.map +0 -1
  106. package/dist/Framework/ThirdParty/OpenSocial.js +0 -33
  107. package/dist/Framework/ThirdParty/OpenSocial.js.map +0 -1
  108. package/dist/Framework/ThirdParty/QQTool.js +0 -117
  109. package/dist/Framework/ThirdParty/QQTool.js.map +0 -1
  110. package/dist/Framework/ThirdParty/QiniuTool.js +0 -23
  111. package/dist/Framework/ThirdParty/QiniuTool.js.map +0 -1
  112. package/dist/Framework/ThirdParty/Rpc.js +0 -64
  113. package/dist/Framework/ThirdParty/Rpc.js.map +0 -1
  114. package/dist/Framework/ThirdParty/WechatOATool.js +0 -62
  115. package/dist/Framework/ThirdParty/WechatOATool.js.map +0 -1
  116. package/dist/Framework/ThirdParty/WechatTool.js +0 -76
  117. package/dist/Framework/ThirdParty/WechatTool.js.map +0 -1
  118. package/dist/Framework/WebServer/Controller/BaseController.js +0 -113
  119. package/dist/Framework/WebServer/Controller/BaseController.js.map +0 -1
  120. package/dist/Framework/WebServer/Controller/BaseUserController.js +0 -170
  121. package/dist/Framework/WebServer/Controller/BaseUserController.js.map +0 -1
  122. package/dist/Framework/WebServer/Controller/MongoBaseUserController.js +0 -170
  123. package/dist/Framework/WebServer/Controller/MongoBaseUserController.js.map +0 -1
  124. package/dist/Framework/WebServer/Decorator/AdminValidate.js +0 -20
  125. package/dist/Framework/WebServer/Decorator/AdminValidate.js.map +0 -1
  126. package/dist/Framework/WebServer/Decorator/AuthorityValidate.js +0 -23
  127. package/dist/Framework/WebServer/Decorator/AuthorityValidate.js.map +0 -1
  128. package/dist/Framework/WebServer/Decorator/CreatorValidate.js +0 -20
  129. package/dist/Framework/WebServer/Decorator/CreatorValidate.js.map +0 -1
  130. package/dist/Framework/WebServer/Decorator/JsonAdminValidate.js +0 -16
  131. package/dist/Framework/WebServer/Decorator/JsonAdminValidate.js.map +0 -1
  132. package/dist/Framework/WebServer/Decorator/JsonAuthorityValidate.js +0 -21
  133. package/dist/Framework/WebServer/Decorator/JsonAuthorityValidate.js.map +0 -1
  134. package/dist/Framework/WebServer/Decorator/JsonCreatorValidate.js +0 -20
  135. package/dist/Framework/WebServer/Decorator/JsonCreatorValidate.js.map +0 -1
  136. package/dist/Framework/WebServer/Decorator/SyncCall.js +0 -22
  137. package/dist/Framework/WebServer/Decorator/SyncCall.js.map +0 -1
  138. package/dist/Framework/WebServer/Decorator/SyncCallServer.js +0 -42
  139. package/dist/Framework/WebServer/Decorator/SyncCallServer.js.map +0 -1
  140. package/dist/Framework/WebServer/Engine/ControllerManager.js +0 -113
  141. package/dist/Framework/WebServer/Engine/ControllerManager.js.map +0 -1
  142. package/dist/Framework/WebServer/Engine/Engine.js +0 -155
  143. package/dist/Framework/WebServer/Engine/Engine.js.map +0 -1
  144. package/dist/Framework/WebServer/Engine/RazorJs.js +0 -545
  145. package/dist/Framework/WebServer/Engine/RazorJs.js.map +0 -1
  146. package/dist/Framework/WebServer/Engine/Request.js +0 -217
  147. package/dist/Framework/WebServer/Engine/Request.js.map +0 -1
  148. package/dist/Framework/WebServer/Engine/Response.js +0 -102
  149. package/dist/Framework/WebServer/Engine/Response.js.map +0 -1
  150. package/dist/Framework/WebServer/IWebServer.js +0 -55
  151. package/dist/Framework/WebServer/IWebServer.js.map +0 -1
  152. package/dist/Framework/cgserver.js +0 -88
  153. package/dist/Framework/cgserver.js.map +0 -1
  154. package/dist/Framework/index.js +0 -184
  155. package/dist/Framework/index.js.map +0 -1
  156. package/dist/lib/AI/AiObject.js +0 -13
  157. package/dist/lib/AI/Astar.js +0 -140
  158. package/dist/lib/AI/BehaviorAI.js +0 -302
  159. package/dist/lib/AI/Entity.js +0 -48
  160. package/dist/lib/AI/Point.js +0 -71
  161. package/dist/lib/AI/TriggerMgr.js +0 -207
  162. package/dist/lib/Config/Config.js +0 -54
  163. package/dist/lib/Config/FrameworkConfig.js +0 -261
  164. package/dist/lib/Config/IServerConfig.js +0 -48
  165. package/dist/lib/Config/_error_.js +0 -37
  166. package/dist/lib/Core/Core.js +0 -710
  167. package/dist/lib/Core/Timer.js +0 -149
  168. package/dist/lib/Database/Decorator/AutoIncrement.js +0 -11
  169. package/dist/lib/Database/Decorator/DBCache.js +0 -118
  170. package/dist/lib/Database/Decorator/NotNull.js +0 -11
  171. package/dist/lib/Database/Decorator/PrimaryKey.js +0 -11
  172. package/dist/lib/Database/Decorator/Property.js +0 -70
  173. package/dist/lib/Database/Decorator/Table.js +0 -15
  174. package/dist/lib/Database/Decorator/Type.js +0 -20
  175. package/dist/lib/Database/MSSqlManager.js +0 -106
  176. package/dist/lib/Database/MongoBaseService.js +0 -293
  177. package/dist/lib/Database/MongoManager.js +0 -670
  178. package/dist/lib/Database/MysqlBaseService.js +0 -478
  179. package/dist/lib/Database/MysqlManager.js +0 -250
  180. package/dist/lib/Database/RedisManager.js +0 -475
  181. package/dist/lib/Framework/AI/AiObject.js.map +0 -1
  182. package/dist/lib/Framework/AI/Astar.js.map +0 -1
  183. package/dist/lib/Framework/AI/BehaviorAI.js.map +0 -1
  184. package/dist/lib/Framework/AI/Entity.js.map +0 -1
  185. package/dist/lib/Framework/AI/Point.js.map +0 -1
  186. package/dist/lib/Framework/AI/TriggerMgr.js.map +0 -1
  187. package/dist/lib/Framework/Config/Config.js.map +0 -1
  188. package/dist/lib/Framework/Config/FrameworkConfig.js.map +0 -1
  189. package/dist/lib/Framework/Config/IServerConfig.js.map +0 -1
  190. package/dist/lib/Framework/Config/_error_.js.map +0 -1
  191. package/dist/lib/Framework/Core/Core.js.map +0 -1
  192. package/dist/lib/Framework/Core/Timer.js.map +0 -1
  193. package/dist/lib/Framework/Database/Decorator/AutoIncrement.js.map +0 -1
  194. package/dist/lib/Framework/Database/Decorator/DBCache.js.map +0 -1
  195. package/dist/lib/Framework/Database/Decorator/NotNull.js.map +0 -1
  196. package/dist/lib/Framework/Database/Decorator/PrimaryKey.js.map +0 -1
  197. package/dist/lib/Framework/Database/Decorator/Property.js.map +0 -1
  198. package/dist/lib/Framework/Database/Decorator/Table.js.map +0 -1
  199. package/dist/lib/Framework/Database/Decorator/Type.js.map +0 -1
  200. package/dist/lib/Framework/Database/MSSqlManager.js.map +0 -1
  201. package/dist/lib/Framework/Database/MongoBaseService.js.map +0 -1
  202. package/dist/lib/Framework/Database/MongoManager.js.map +0 -1
  203. package/dist/lib/Framework/Database/MysqlBaseService.js.map +0 -1
  204. package/dist/lib/Framework/Database/MysqlManager.js.map +0 -1
  205. package/dist/lib/Framework/Database/RedisManager.js.map +0 -1
  206. package/dist/lib/Framework/Logic/CacheTool.js.map +0 -1
  207. package/dist/lib/Framework/Logic/EventTool.js.map +0 -1
  208. package/dist/lib/Framework/Logic/HttpTool.js.map +0 -1
  209. package/dist/lib/Framework/Logic/Log.js.map +0 -1
  210. package/dist/lib/Framework/Logic/SyncQueueTool.js.map +0 -1
  211. package/dist/lib/Framework/Service/AccountService.js.map +0 -1
  212. package/dist/lib/Framework/Service/MongoAccountService.js.map +0 -1
  213. package/dist/lib/Framework/Service/MongoCacheService.js.map +0 -1
  214. package/dist/lib/Framework/Service/MongoUserService.js.map +0 -1
  215. package/dist/lib/Framework/Service/UserService.js.map +0 -1
  216. package/dist/lib/Framework/Service/ini.js.map +0 -1
  217. package/dist/lib/Framework/SocketServer/IClientWebSocket.js.map +0 -1
  218. package/dist/lib/Framework/SocketServer/IRpc.js.map +0 -1
  219. package/dist/lib/Framework/SocketServer/IRpcClientWebSocket.js.map +0 -1
  220. package/dist/lib/Framework/SocketServer/IRpcServerWebSocket.js.map +0 -1
  221. package/dist/lib/Framework/SocketServer/IServerWebSocket.js.map +0 -1
  222. package/dist/lib/Framework/SocketServer/ISocketServer.js.map +0 -1
  223. package/dist/lib/Framework/SocketServer/IWebSocket.js.map +0 -1
  224. package/dist/lib/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js.map +0 -1
  225. package/dist/lib/Framework/SocketServer/ProtoFilter/IProtoFilter.js.map +0 -1
  226. package/dist/lib/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js.map +0 -1
  227. package/dist/lib/Framework/SocketServer/ProtoFilter/ProtoFactory.js.map +0 -1
  228. package/dist/lib/Framework/ThirdParty/AlipayTool.js.map +0 -1
  229. package/dist/lib/Framework/ThirdParty/Alisms.js.map +0 -1
  230. package/dist/lib/Framework/ThirdParty/AppleTool.js.map +0 -1
  231. package/dist/lib/Framework/ThirdParty/CgMq.js.map +0 -1
  232. package/dist/lib/Framework/ThirdParty/EmailTool.js.map +0 -1
  233. package/dist/lib/Framework/ThirdParty/OpenSocial.js.map +0 -1
  234. package/dist/lib/Framework/ThirdParty/QQTool.js.map +0 -1
  235. package/dist/lib/Framework/ThirdParty/QiniuTool.js.map +0 -1
  236. package/dist/lib/Framework/ThirdParty/Rpc.js.map +0 -1
  237. package/dist/lib/Framework/ThirdParty/WechatOATool.js.map +0 -1
  238. package/dist/lib/Framework/ThirdParty/WechatTool.js.map +0 -1
  239. package/dist/lib/Framework/WebServer/Controller/BaseController.js.map +0 -1
  240. package/dist/lib/Framework/WebServer/Controller/BaseUserController.js.map +0 -1
  241. package/dist/lib/Framework/WebServer/Controller/MongoBaseUserController.js.map +0 -1
  242. package/dist/lib/Framework/WebServer/Decorator/AdminValidate.js.map +0 -1
  243. package/dist/lib/Framework/WebServer/Decorator/AuthorityValidate.js.map +0 -1
  244. package/dist/lib/Framework/WebServer/Decorator/CreatorValidate.js.map +0 -1
  245. package/dist/lib/Framework/WebServer/Decorator/JsonAdminValidate.js.map +0 -1
  246. package/dist/lib/Framework/WebServer/Decorator/JsonAuthorityValidate.js.map +0 -1
  247. package/dist/lib/Framework/WebServer/Decorator/JsonCreatorValidate.js.map +0 -1
  248. package/dist/lib/Framework/WebServer/Decorator/SyncCall.js.map +0 -1
  249. package/dist/lib/Framework/WebServer/Decorator/SyncCallServer.js.map +0 -1
  250. package/dist/lib/Framework/WebServer/Engine/ControllerManager.js.map +0 -1
  251. package/dist/lib/Framework/WebServer/Engine/Engine.js.map +0 -1
  252. package/dist/lib/Framework/WebServer/Engine/RazorJs.js.map +0 -1
  253. package/dist/lib/Framework/WebServer/Engine/Request.js.map +0 -1
  254. package/dist/lib/Framework/WebServer/Engine/Response.js.map +0 -1
  255. package/dist/lib/Framework/WebServer/IWebServer.js.map +0 -1
  256. package/dist/lib/Framework/cgserver.js.map +0 -1
  257. package/dist/lib/Framework/index.js.map +0 -1
  258. package/dist/lib/Logic/CacheTool.js +0 -77
  259. package/dist/lib/Logic/EventTool.js +0 -42
  260. package/dist/lib/Logic/HttpTool.js +0 -78
  261. package/dist/lib/Logic/Log.js +0 -148
  262. package/dist/lib/Logic/SyncQueueTool.js +0 -134
  263. package/dist/lib/Service/AccountService.js +0 -665
  264. package/dist/lib/Service/MongoAccountService.js +0 -598
  265. package/dist/lib/Service/MongoCacheService.js +0 -122
  266. package/dist/lib/Service/MongoUserService.js +0 -197
  267. package/dist/lib/Service/UserService.js +0 -296
  268. package/dist/lib/Service/ini.js +0 -36
  269. package/dist/lib/SocketServer/IClientWebSocket.js +0 -76
  270. package/dist/lib/SocketServer/IRpc.js +0 -36
  271. package/dist/lib/SocketServer/IRpcClientWebSocket.js +0 -130
  272. package/dist/lib/SocketServer/IRpcServerWebSocket.js +0 -130
  273. package/dist/lib/SocketServer/IServerWebSocket.js +0 -112
  274. package/dist/lib/SocketServer/ISocketServer.js +0 -275
  275. package/dist/lib/SocketServer/IWebSocket.js +0 -288
  276. package/dist/lib/SocketServer/ProtoFilter/GoogleProtoFilter.js +0 -60
  277. package/dist/lib/SocketServer/ProtoFilter/IProtoFilter.js +0 -8
  278. package/dist/lib/SocketServer/ProtoFilter/JsonProtoFilter.js +0 -32
  279. package/dist/lib/SocketServer/ProtoFilter/ProtoFactory.js +0 -34
  280. package/dist/lib/ThirdParty/AlipayTool.js +0 -264
  281. package/dist/lib/ThirdParty/Alisms.js +0 -50
  282. package/dist/lib/ThirdParty/AppleTool.js +0 -314
  283. package/dist/lib/ThirdParty/CgMq.js +0 -282
  284. package/dist/lib/ThirdParty/EmailTool.js +0 -36
  285. package/dist/lib/ThirdParty/OpenSocial.js +0 -91
  286. package/dist/lib/ThirdParty/QQTool.js +0 -182
  287. package/dist/lib/ThirdParty/QiniuTool.js +0 -28
  288. package/dist/lib/ThirdParty/Rpc.js +0 -181
  289. package/dist/lib/ThirdParty/WechatOATool.js +0 -67
  290. package/dist/lib/ThirdParty/WechatTool.js +0 -148
  291. package/dist/lib/WebServer/Controller/BaseController.js +0 -178
  292. package/dist/lib/WebServer/Controller/BaseUserController.js +0 -303
  293. package/dist/lib/WebServer/Controller/MongoBaseUserController.js +0 -303
  294. package/dist/lib/WebServer/Decorator/AdminValidate.js +0 -19
  295. package/dist/lib/WebServer/Decorator/AuthorityValidate.js +0 -22
  296. package/dist/lib/WebServer/Decorator/CreatorValidate.js +0 -19
  297. package/dist/lib/WebServer/Decorator/JsonAdminValidate.js +0 -15
  298. package/dist/lib/WebServer/Decorator/JsonAuthorityValidate.js +0 -20
  299. package/dist/lib/WebServer/Decorator/JsonCreatorValidate.js +0 -19
  300. package/dist/lib/WebServer/Decorator/SyncCall.js +0 -63
  301. package/dist/lib/WebServer/Decorator/SyncCallServer.js +0 -110
  302. package/dist/lib/WebServer/Engine/ControllerManager.js +0 -117
  303. package/dist/lib/WebServer/Engine/Engine.js +0 -207
  304. package/dist/lib/WebServer/Engine/RazorJs.js +0 -547
  305. package/dist/lib/WebServer/Engine/Request.js +0 -274
  306. package/dist/lib/WebServer/Engine/Response.js +0 -102
  307. package/dist/lib/WebServer/IWebServer.js +0 -107
  308. package/dist/lib/cgserver.js +0 -100
  309. package/dist/lib/index.js +0 -194
  310. package/dist/lib/test/test.js.map +0 -1
  311. package/dist/test/test.js +0 -11
  312. package/dist/test/test.js.map +0 -1
  313. package/dist/types/AI/AiObject.d.ts +0 -5
  314. package/dist/types/AI/Astar.d.ts +0 -38
  315. package/dist/types/AI/BehaviorAI.d.ts +0 -24
  316. package/dist/types/AI/Entity.d.ts +0 -12
  317. package/dist/types/AI/Point.d.ts +0 -17
  318. package/dist/types/AI/TriggerMgr.d.ts +0 -52
  319. package/dist/types/Config/Config.d.ts +0 -12
  320. package/dist/types/Config/FrameworkConfig.d.ts +0 -228
  321. package/dist/types/Config/IServerConfig.d.ts +0 -9
  322. package/dist/types/Config/_error_.d.ts +0 -99
  323. package/dist/types/Core/Core.d.ts +0 -108
  324. package/dist/types/Core/Timer.d.ts +0 -16
  325. package/dist/types/Database/Decorator/AutoIncrement.d.ts +0 -1
  326. package/dist/types/Database/Decorator/DBCache.d.ts +0 -23
  327. package/dist/types/Database/Decorator/NotNull.d.ts +0 -1
  328. package/dist/types/Database/Decorator/PrimaryKey.d.ts +0 -1
  329. package/dist/types/Database/Decorator/Property.d.ts +0 -57
  330. package/dist/types/Database/Decorator/Table.d.ts +0 -1
  331. package/dist/types/Database/Decorator/Type.d.ts +0 -1
  332. package/dist/types/Database/MSSqlManager.d.ts +0 -17
  333. package/dist/types/Database/MongoBaseService.d.ts +0 -81
  334. package/dist/types/Database/MongoManager.d.ts +0 -143
  335. package/dist/types/Database/MysqlBaseService.d.ts +0 -34
  336. package/dist/types/Database/MysqlManager.d.ts +0 -41
  337. package/dist/types/Database/RedisManager.d.ts +0 -64
  338. package/dist/types/Logic/CacheTool.d.ts +0 -27
  339. package/dist/types/Logic/EventTool.d.ts +0 -13
  340. package/dist/types/Logic/HttpTool.d.ts +0 -15
  341. package/dist/types/Logic/Log.d.ts +0 -25
  342. package/dist/types/Logic/SyncQueueTool.d.ts +0 -21
  343. package/dist/types/Service/AccountService.d.ts +0 -77
  344. package/dist/types/Service/MongoAccountService.d.ts +0 -78
  345. package/dist/types/Service/MongoCacheService.d.ts +0 -14
  346. package/dist/types/Service/MongoUserService.d.ts +0 -36
  347. package/dist/types/Service/UserService.d.ts +0 -36
  348. package/dist/types/Service/ini.d.ts +0 -29
  349. package/dist/types/SocketServer/IClientWebSocket.d.ts +0 -17
  350. package/dist/types/SocketServer/IRpc.d.ts +0 -8
  351. package/dist/types/SocketServer/IRpcClientWebSocket.d.ts +0 -16
  352. package/dist/types/SocketServer/IRpcServerWebSocket.d.ts +0 -16
  353. package/dist/types/SocketServer/IServerWebSocket.d.ts +0 -28
  354. package/dist/types/SocketServer/ISocketServer.d.ts +0 -45
  355. package/dist/types/SocketServer/IWebSocket.d.ts +0 -60
  356. package/dist/types/SocketServer/ProtoFilter/GoogleProtoFilter.d.ts +0 -9
  357. package/dist/types/SocketServer/ProtoFilter/IProtoFilter.d.ts +0 -9
  358. package/dist/types/SocketServer/ProtoFilter/JsonProtoFilter.d.ts +0 -6
  359. package/dist/types/SocketServer/ProtoFilter/ProtoFactory.d.ts +0 -8
  360. package/dist/types/ThirdParty/AlipayTool.d.ts +0 -109
  361. package/dist/types/ThirdParty/Alisms.d.ts +0 -14
  362. package/dist/types/ThirdParty/AppleTool.d.ts +0 -131
  363. package/dist/types/ThirdParty/CgMq.d.ts +0 -51
  364. package/dist/types/ThirdParty/EmailTool.d.ts +0 -5
  365. package/dist/types/ThirdParty/OpenSocial.d.ts +0 -7
  366. package/dist/types/ThirdParty/QQTool.d.ts +0 -41
  367. package/dist/types/ThirdParty/QiniuTool.d.ts +0 -6
  368. package/dist/types/ThirdParty/Rpc.d.ts +0 -20
  369. package/dist/types/ThirdParty/WechatOATool.d.ts +0 -13
  370. package/dist/types/ThirdParty/WechatTool.d.ts +0 -20
  371. package/dist/types/WebServer/Controller/BaseController.d.ts +0 -33
  372. package/dist/types/WebServer/Controller/BaseUserController.d.ts +0 -27
  373. package/dist/types/WebServer/Controller/MongoBaseUserController.d.ts +0 -27
  374. package/dist/types/WebServer/Decorator/AdminValidate.d.ts +0 -1
  375. package/dist/types/WebServer/Decorator/AuthorityValidate.d.ts +0 -2
  376. package/dist/types/WebServer/Decorator/CreatorValidate.d.ts +0 -1
  377. package/dist/types/WebServer/Decorator/JsonAdminValidate.d.ts +0 -1
  378. package/dist/types/WebServer/Decorator/JsonAuthorityValidate.d.ts +0 -2
  379. package/dist/types/WebServer/Decorator/JsonCreatorValidate.d.ts +0 -1
  380. package/dist/types/WebServer/Decorator/SyncCall.d.ts +0 -7
  381. package/dist/types/WebServer/Decorator/SyncCallServer.d.ts +0 -7
  382. package/dist/types/WebServer/Engine/ControllerManager.d.ts +0 -35
  383. package/dist/types/WebServer/Engine/Engine.d.ts +0 -21
  384. package/dist/types/WebServer/Engine/RazorJs.d.ts +0 -21
  385. package/dist/types/WebServer/Engine/Request.d.ts +0 -35
  386. package/dist/types/WebServer/Engine/Response.d.ts +0 -30
  387. package/dist/types/WebServer/IWebServer.d.ts +0 -20
  388. package/dist/types/cgserver.d.ts +0 -24
  389. package/dist/types/index.d.ts +0 -85
  390. package/src/Framework/AI/AiObject.ts +0 -12
  391. package/src/Framework/AI/Astar.ts +0 -157
  392. package/src/Framework/AI/BehaviorAI.ts +0 -382
  393. package/src/Framework/AI/Entity.ts +0 -37
  394. package/src/Framework/AI/Point.ts +0 -84
  395. package/src/Framework/AI/TriggerMgr.ts +0 -280
  396. package/src/Framework/Config/Config.ts +0 -61
  397. package/src/Framework/Config/FrameworkConfig.ts +0 -286
  398. package/src/Framework/Config/IServerConfig.ts +0 -28
  399. package/src/Framework/Config/_error_.ts +0 -32
  400. package/src/Framework/Core/Core.ts +0 -810
  401. package/src/Framework/Core/Timer.ts +0 -147
  402. package/src/Framework/Database/Decorator/AutoIncrement.ts +0 -9
  403. package/src/Framework/Database/Decorator/DBCache.ts +0 -74
  404. package/src/Framework/Database/Decorator/NotNull.ts +0 -9
  405. package/src/Framework/Database/Decorator/PrimaryKey.ts +0 -9
  406. package/src/Framework/Database/Decorator/Property.ts +0 -64
  407. package/src/Framework/Database/Decorator/Table.ts +0 -13
  408. package/src/Framework/Database/Decorator/Type.ts +0 -21
  409. package/src/Framework/Database/MSSqlManager.ts +0 -52
  410. package/src/Framework/Database/MongoBaseService.ts +0 -136
  411. package/src/Framework/Database/MongoManager.ts +0 -501
  412. package/src/Framework/Database/MysqlBaseService.ts +0 -345
  413. package/src/Framework/Database/MysqlManager.ts +0 -212
  414. package/src/Framework/Database/RedisManager.ts +0 -544
  415. package/src/Framework/Logic/CacheTool.ts +0 -85
  416. package/src/Framework/Logic/EventTool.ts +0 -31
  417. package/src/Framework/Logic/HttpTool.ts +0 -82
  418. package/src/Framework/Logic/Log.ts +0 -171
  419. package/src/Framework/Logic/SyncQueueTool.ts +0 -51
  420. package/src/Framework/Service/AccountService.ts +0 -508
  421. package/src/Framework/Service/MongoAccountService.ts +0 -456
  422. package/src/Framework/Service/MongoCacheService.ts +0 -48
  423. package/src/Framework/Service/MongoUserService.ts +0 -103
  424. package/src/Framework/Service/UserService.ts +0 -168
  425. package/src/Framework/Service/ini.ts +0 -33
  426. package/src/Framework/SocketServer/IClientWebSocket.ts +0 -50
  427. package/src/Framework/SocketServer/IRpc.ts +0 -12
  428. package/src/Framework/SocketServer/IRpcClientWebSocket.ts +0 -75
  429. package/src/Framework/SocketServer/IRpcServerWebSocket.ts +0 -76
  430. package/src/Framework/SocketServer/IServerWebSocket.ts +0 -88
  431. package/src/Framework/SocketServer/ISocketServer.ts +0 -243
  432. package/src/Framework/SocketServer/IWebSocket.ts +0 -243
  433. package/src/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.ts +0 -68
  434. package/src/Framework/SocketServer/ProtoFilter/IProtoFilter.ts +0 -11
  435. package/src/Framework/SocketServer/ProtoFilter/JsonProtoFilter.ts +0 -34
  436. package/src/Framework/SocketServer/ProtoFilter/ProtoFactory.ts +0 -34
  437. package/src/Framework/ThirdParty/AlipayTool.ts +0 -224
  438. package/src/Framework/ThirdParty/Alisms.ts +0 -53
  439. package/src/Framework/ThirdParty/AppleTool.ts +0 -252
  440. package/src/Framework/ThirdParty/CgMq.ts +0 -153
  441. package/src/Framework/ThirdParty/EmailTool.ts +0 -37
  442. package/src/Framework/ThirdParty/OpenSocial.ts +0 -36
  443. package/src/Framework/ThirdParty/QQTool.ts +0 -124
  444. package/src/Framework/ThirdParty/QiniuTool.ts +0 -23
  445. package/src/Framework/ThirdParty/Rpc.ts +0 -75
  446. package/src/Framework/ThirdParty/WechatOATool.ts +0 -61
  447. package/src/Framework/ThirdParty/WechatTool.ts +0 -80
  448. package/src/Framework/WebServer/Controller/BaseController.ts +0 -140
  449. package/src/Framework/WebServer/Controller/BaseUserController.ts +0 -209
  450. package/src/Framework/WebServer/Controller/MongoBaseUserController.ts +0 -209
  451. package/src/Framework/WebServer/Decorator/AdminValidate.ts +0 -19
  452. package/src/Framework/WebServer/Decorator/AuthorityValidate.ts +0 -25
  453. package/src/Framework/WebServer/Decorator/CreatorValidate.ts +0 -19
  454. package/src/Framework/WebServer/Decorator/JsonAdminValidate.ts +0 -16
  455. package/src/Framework/WebServer/Decorator/JsonAuthorityValidate.d.ts +0 -2
  456. package/src/Framework/WebServer/Decorator/JsonAuthorityValidate.ts +0 -23
  457. package/src/Framework/WebServer/Decorator/JsonCreatorValidate.ts +0 -19
  458. package/src/Framework/WebServer/Decorator/SyncCall.ts +0 -20
  459. package/src/Framework/WebServer/Decorator/SyncCallServer.ts +0 -45
  460. package/src/Framework/WebServer/Engine/ControllerManager.ts +0 -134
  461. package/src/Framework/WebServer/Engine/Engine.ts +0 -186
  462. package/src/Framework/WebServer/Engine/RazorJs.ts +0 -720
  463. package/src/Framework/WebServer/Engine/Request.ts +0 -267
  464. package/src/Framework/WebServer/Engine/Response.ts +0 -123
  465. package/src/Framework/WebServer/IWebServer.ts +0 -61
  466. package/src/Framework/cgserver.ts +0 -112
  467. package/src/Framework/index.ts +0 -92
  468. package/src/test/test.ts +0 -12
@@ -1,209 +0,0 @@
1
- import { BaseController } from './BaseController';
2
- import { UserModel, GUserSer } from '../../Service/UserService';
3
- import { GCacheTool } from '../../Logic/CacheTool';
4
- import { ESessionType } from '../../Config/FrameworkConfig';
5
- import { GRedisMgr } from '../../Database/RedisManager';
6
- import { MongoCacheModel, GMongoCacheSer } from '../../Service/MongoCacheService';
7
- import { ERoleGroup } from '../../Service/ini';
8
- export class BaseUserController<T extends UserModel> extends BaseController
9
- {
10
- protected _user_session_id="user_session_id"
11
- protected _self_user:T=null
12
- protected _user:T=null//网页内容的所属,比如,查看别人的博客,那这个信息就是作者的
13
- protected _session_id:string=null
14
- get selfUser()
15
- {
16
- return <T>this._self_user
17
- }
18
- get isSelf()
19
- {
20
- return this._self_user && (this._self_user.id == this._user.id)
21
- }
22
- get isLogin()
23
- {
24
- return this._self_user&&true
25
- }
26
- get isCreator()
27
- {
28
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Creator)
29
- }
30
- get isAdmin()
31
- {
32
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Admin||this._self_user.role_group==ERoleGroup.Creator)
33
- }
34
- get isProxy()
35
- {
36
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Proxy)
37
- }
38
- get isCommon()
39
- {
40
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Common)
41
- }
42
- async init()
43
- {
44
- this._engine.cfg.session_type=this._engine.cfg.session_type||ESessionType.Cache
45
- this._session_id = this._request.getCookie(this._user_session_id)||this._request.params.session_id||this._request.postData.session_id
46
- let userId = -1
47
- if (this._session_id)
48
- {
49
- let user = await this._getUserBySession(this._session_id)
50
- if (!user)
51
- {
52
- this._update_session()
53
- //Session不存在清除客户端cookie
54
- this._response.clearCookie(this._user_session_id)
55
- }
56
- else
57
- {
58
- this._login(user)
59
- userId = user.id
60
- }
61
- }
62
- let params = this._request.params
63
- if (params.userId && params.userId!=userId+"")
64
- {
65
- this._user = <T>(await GUserSer.getById(params.userId))
66
- }
67
- else
68
- {
69
- //不是别人的信息就查看自己的
70
- this._user = this._self_user
71
- }
72
- }
73
- protected async _getUserBySession(session:string)
74
- {
75
- let user:T= null
76
- if(!session)
77
- {
78
- return user
79
- }
80
- //每次强制从cache中先找,提高效率
81
- //if(this._engine.cfg.session_type==ESessionType.Cache)
82
- {
83
- user= GCacheTool.get(this._session_id)
84
- }
85
- if(user)
86
- {
87
- return user
88
- }
89
- if(this._engine.cfg.session_type==ESessionType.Redis)
90
- {
91
- let user_id = parseInt((await GRedisMgr.get(this._session_id))||"-1")
92
- if(user_id>0)
93
- {
94
- user = <T>(await GUserSer.getById(user_id))
95
- }
96
- }
97
- else if(this._engine.cfg.session_type==ESessionType.Mongo)
98
- {
99
- let user_id = (await GMongoCacheSer.getData(this._session_id))||-1
100
- if(user_id>0)
101
- {
102
- user = <T>(await GUserSer.getById(user_id))
103
- }
104
- }
105
- if(user)
106
- {
107
- this._login(user)
108
- }
109
- return user
110
- }
111
- protected _logout()
112
- {
113
- if(this._session_id)
114
- {
115
- if(this._engine.cfg.session_type==ESessionType.Cache)
116
- {
117
- GCacheTool.remove(this._session_id)
118
- }
119
- else if(this._engine.cfg.session_type==ESessionType.Redis)
120
- {
121
- GRedisMgr.del(this._session_id)
122
- }
123
- else if(this._engine.cfg.session_type==ESessionType.Mongo)
124
- {
125
- GMongoCacheSer.deleteOne({key:this._session_id})
126
- }
127
- this._session_id = null
128
- }
129
- this._response.clearCookie(this._user_session_id)
130
- }
131
- protected _login(user:T)
132
- {
133
- if(!user)
134
- {
135
- return;
136
- }
137
- if(!this._session_id)
138
- {
139
- this._session_id = Math.random().toString(36).substring(2)+user.id
140
- }
141
- let time = 0
142
- if(this._request.postData.remember=="on")
143
- {
144
- time = this._engine.cfg.cookie.expires.account_remember
145
- }
146
- else
147
- {
148
- time = this._engine.cfg.cookie.expires.account
149
- }
150
- this._response.setCookie(this._user_session_id,this._session_id,time)
151
-
152
- //if(this._engine.cfg.session_type==ESessionType.Cache)
153
- {
154
- if(time>24*60*60)
155
- {
156
- GCacheTool.add(this._session_id,user,24*60*60*1000)
157
- }
158
- else
159
- {
160
- GCacheTool.add(this._session_id,user,time*1000)
161
- }
162
- }
163
- if(this._engine.cfg.session_type==ESessionType.Redis)
164
- {
165
- GRedisMgr.set(this._session_id,user.id).then(()=>
166
- {
167
- GRedisMgr.expire(this._session_id,time)
168
- })
169
- }
170
- else if(this._engine.cfg.session_type==ESessionType.Mongo)
171
- {
172
- let cm = new MongoCacheModel()
173
- cm.key=this._session_id
174
- cm.data=user.id
175
- cm.expireAt=Date.now()+time*1000
176
- GMongoCacheSer.updateOne(cm,{key:cm.key},true)
177
- }
178
- this._self_user = user
179
- }
180
- /**
181
- * 已经被启用
182
- */
183
- protected async _update_session()
184
- {
185
-
186
- }
187
- async update_user(user_id:number)
188
- {
189
- let user = <T>(await GUserSer.getById(user_id))
190
- if(this._user&&this._user.id==user.id)
191
- {
192
- this._user = user
193
- }
194
- if(this._self_user&&this._self_user.id==user.id)
195
- {
196
- this._login(user)
197
- }
198
- }
199
- //填充每个页面需要的通用数据
200
- protected _init_data(datas)
201
- {
202
- let data = super._init_data(datas)
203
- data.model.isLogin = this.isLogin
204
- data.model.user = this._user
205
- data.model.selfUser = this._self_user
206
- data.model.isSelf = this.isSelf
207
- return data
208
- }
209
- }
@@ -1,209 +0,0 @@
1
- import { BaseController } from './BaseController';
2
- import { GCacheTool } from '../../Logic/CacheTool';
3
- import { ESessionType } from '../../Config/FrameworkConfig';
4
- import { GRedisMgr } from '../../Database/RedisManager';
5
- import { MongoCacheModel, GMongoCacheSer } from '../../Service/MongoCacheService';
6
- import { ERoleGroup } from '../../Service/ini';
7
- import { GUserSer, UserModel } from '../../Service/MongoUserService';
8
- export class MongoBaseUserController<T extends UserModel> extends BaseController
9
- {
10
- protected _user_session_id="user_session_id"
11
- protected _self_user:T=null
12
- protected _user:T=null//网页内容的所属,比如,查看别人的博客,那这个信息就是作者的
13
- protected _session_id:string=null
14
- get selfUser()
15
- {
16
- return <T>this._self_user
17
- }
18
- get isSelf()
19
- {
20
- return this._self_user && (this._self_user.id == this._user.id)
21
- }
22
- get isLogin()
23
- {
24
- return this._self_user&&true
25
- }
26
- get isCreator()
27
- {
28
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Creator)
29
- }
30
- get isAdmin()
31
- {
32
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Admin||this._self_user.role_group==ERoleGroup.Creator)
33
- }
34
- get isProxy()
35
- {
36
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Proxy)
37
- }
38
- get isCommon()
39
- {
40
- return this._self_user&&(this._self_user.role_group==ERoleGroup.Common)
41
- }
42
- async init()
43
- {
44
- this._engine.cfg.session_type=this._engine.cfg.session_type||ESessionType.Cache
45
- this._session_id = this._request.getCookie(this._user_session_id)||this._request.params.session_id||this._request.postData.session_id
46
- let userId = -1
47
- if (this._session_id)
48
- {
49
- let user = await this._getUserBySession(this._session_id)
50
- if (!user)
51
- {
52
- this._update_session()
53
- //Session不存在清除客户端cookie
54
- this._response.clearCookie(this._user_session_id)
55
- }
56
- else
57
- {
58
- this._login(user)
59
- userId = user.id
60
- }
61
- }
62
- let params = this._request.params
63
- if (params.userId && params.userId!=userId+"")
64
- {
65
- this._user = <T>(await GUserSer.getById(params.userId))
66
- }
67
- else
68
- {
69
- //不是别人的信息就查看自己的
70
- this._user = this._self_user
71
- }
72
- }
73
- protected async _getUserBySession(session:string)
74
- {
75
- let user:T= null
76
- if(!session)
77
- {
78
- return user
79
- }
80
- //每次强制从cache中先找,提高效率
81
- //if(this._engine.cfg.session_type==ESessionType.Cache)
82
- {
83
- user= GCacheTool.get(this._session_id)
84
- }
85
- if(user)
86
- {
87
- return user
88
- }
89
- if(this._engine.cfg.session_type==ESessionType.Redis)
90
- {
91
- let user_id = parseInt((await GRedisMgr.get(this._session_id))||"-1")
92
- if(user_id>0)
93
- {
94
- user = <T>(await GUserSer.getById(user_id))
95
- }
96
- }
97
- else if(this._engine.cfg.session_type==ESessionType.Mongo)
98
- {
99
- let user_id = (await GMongoCacheSer.getData(this._session_id))||-1
100
- if(user_id>0)
101
- {
102
- user = <T>(await GUserSer.getById(user_id))
103
- }
104
- }
105
- if(user)
106
- {
107
- this._login(user)
108
- }
109
- return user
110
- }
111
- protected _logout()
112
- {
113
- if(this._session_id)
114
- {
115
- if(this._engine.cfg.session_type==ESessionType.Cache)
116
- {
117
- GCacheTool.remove(this._session_id)
118
- }
119
- else if(this._engine.cfg.session_type==ESessionType.Redis)
120
- {
121
- GRedisMgr.del(this._session_id)
122
- }
123
- else if(this._engine.cfg.session_type==ESessionType.Mongo)
124
- {
125
- GMongoCacheSer.deleteOne({key:this._session_id})
126
- }
127
- this._session_id = null
128
- }
129
- this._response.clearCookie(this._user_session_id)
130
- }
131
- protected _login(user:T)
132
- {
133
- if(!user)
134
- {
135
- return;
136
- }
137
- if(!this._session_id)
138
- {
139
- this._session_id = Math.random().toString(36).substring(2)+user.id
140
- }
141
- let time = 0
142
- if(this._request.postData.remember=="on")
143
- {
144
- time = this._engine.cfg.cookie.expires.account_remember
145
- }
146
- else
147
- {
148
- time = this._engine.cfg.cookie.expires.account
149
- }
150
- this._response.setCookie(this._user_session_id,this._session_id,time)
151
-
152
- //if(this._engine.cfg.session_type==ESessionType.Cache)
153
- {
154
- if(time>24*60*60)
155
- {
156
- GCacheTool.add(this._session_id,user,24*60*60*1000)
157
- }
158
- else
159
- {
160
- GCacheTool.add(this._session_id,user,time*1000)
161
- }
162
- }
163
- if(this._engine.cfg.session_type==ESessionType.Redis)
164
- {
165
- GRedisMgr.set(this._session_id,user.id).then(()=>
166
- {
167
- GRedisMgr.expire(this._session_id,time)
168
- })
169
- }
170
- else if(this._engine.cfg.session_type==ESessionType.Mongo)
171
- {
172
- let cm = new MongoCacheModel()
173
- cm.key=this._session_id
174
- cm.data=user.id
175
- cm.expireAt=Date.now()+time*1000
176
- GMongoCacheSer.updateOne(cm,{key:cm.key},true)
177
- }
178
- this._self_user = user
179
- }
180
- /**
181
- * 已经被启用
182
- */
183
- protected async _update_session()
184
- {
185
-
186
- }
187
- async update_user(user_id:number)
188
- {
189
- let user = <T>(await GUserSer.getById(user_id))
190
- if(this._user&&this._user.id==user.id)
191
- {
192
- this._user = user
193
- }
194
- if(this._self_user&&this._self_user.id==user.id)
195
- {
196
- this._login(user)
197
- }
198
- }
199
- //填充每个页面需要的通用数据
200
- protected _init_data(datas)
201
- {
202
- let data = super._init_data(datas)
203
- data.model.isLogin = this.isLogin
204
- data.model.user = this._user
205
- data.model.selfUser = this._self_user
206
- data.model.isSelf = this.isSelf
207
- return data
208
- }
209
- }
@@ -1,19 +0,0 @@
1
- export function AdminValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
2
- {
3
- let method = descriptor.value
4
- descriptor.value = function ()
5
- {
6
- let self=this
7
- if(!self.isLogin)
8
- {
9
- self.redirect(null,"Login")
10
- return
11
- }
12
- if(!self.isAdmin)
13
- {
14
- self.showText("需要管理员权限")
15
- return
16
- }
17
- return method.apply(this, arguments)
18
- }
19
- }
@@ -1,25 +0,0 @@
1
- import { ERoleGroup } from "../../Service/ini"
2
-
3
- export let AuthorityValidate=function(rg?:ERoleGroup,ctr_name?:string)
4
- {
5
- ctr_name=ctr_name||"Wechat"
6
- return function(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
7
- {
8
- let method = descriptor.value
9
- descriptor.value = function ()
10
- {
11
- let self=this
12
- if(!self.isLogin)
13
- {
14
- self.redirect(null,ctr_name)
15
- return
16
- }
17
- if(rg&&self.selfUser.role_group!=rg)
18
- {
19
- self.redirect(null,ctr_name)//权限不足
20
- return
21
- }
22
- return method.apply(this, arguments)
23
- }
24
- }
25
- }
@@ -1,19 +0,0 @@
1
- export function CreatorValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
2
- {
3
- let method = descriptor.value
4
- descriptor.value = function ()
5
- {
6
- let self=this
7
- if(!self.isLogin)
8
- {
9
- self.redirect(null,"Login")
10
- return
11
- }
12
- if(!self.isCreator)
13
- {
14
- self.showText("需要创始人权限")
15
- return
16
- }
17
- return method.apply(this, arguments)
18
- }
19
- }
@@ -1,16 +0,0 @@
1
- import { UserModel } from "../../Service/MongoUserService";
2
-
3
- export function JsonAdminValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
4
- {
5
- let method = descriptor.value
6
- descriptor.value = function ()
7
- {
8
- let self=this
9
- if(!self.isAdmin)
10
- {
11
- self.showJson({errcode:{id:1,des:"需要管理员或创始人权限"},err:"需要管理员或创始人权限"})
12
- return
13
- }
14
- return method.apply(this, arguments)
15
- }
16
- }
@@ -1,2 +0,0 @@
1
- import { ERoleGroup } from "../../Service/ini";
2
- export declare let JsonAuthorityValidate: (rg?: ERoleGroup) => (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>) => void;
@@ -1,23 +0,0 @@
1
- import { ERoleGroup } from "../../Service/ini"
2
-
3
- export let JsonAuthorityValidate=function(rg?:ERoleGroup)
4
- {
5
- return function(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
6
- {
7
- let method = descriptor.value
8
- descriptor.value = function ()
9
- {
10
- let self=this
11
- if(!self.isLogin)
12
- {
13
- self.showJson({errcode:{id:1,des:"未登陆"},err:"未登陆"})
14
- }
15
- if(rg&&self.selfUser.role_group!=rg)
16
- {
17
- self.showJson({errcode:{id:2,des:"权限不足"},err:"权限不足"})
18
- return
19
- }
20
- return method.apply(this, arguments)
21
- }
22
- }
23
- }
@@ -1,19 +0,0 @@
1
- export function JsonCreatorValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
2
- {
3
- let method = descriptor.value
4
- descriptor.value = function ()
5
- {
6
- let self=this
7
- if(!self.isLogin)
8
- {
9
- self.showJson({errcode:{id:1,des:"请登陆后尝试"},err:"请登陆后尝试"})
10
- return
11
- }
12
- if(!self.isCreator)
13
- {
14
- self.showJson({errcode:{id:1,des:"需要创始人权限"},err:"需要创始人权限"})
15
- return
16
- }
17
- return method.apply(this, arguments)
18
- }
19
- }
@@ -1,20 +0,0 @@
1
- import { GSyncQueueTool } from "../../Logic/SyncQueueTool"
2
- /**
3
- * 异步函数变为同步函数,当前进程有效
4
- * @param target
5
- * @param propertyName
6
- * @param descriptor
7
- */
8
- export function SyncCall(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
9
- {
10
- let method = descriptor.value
11
- descriptor.value = function ()
12
- {
13
- let self=this
14
- let ret = GSyncQueueTool.add(method.name,async ()=>
15
- {
16
- return await method.apply(self, arguments)
17
- })
18
- return ret
19
- }
20
- }
@@ -1,45 +0,0 @@
1
- import { core } from "../../Core/Core"
2
- import { GSyncQueueTool } from "../../Logic/SyncQueueTool"
3
- import { GMongoCacheSer } from "../../Service/MongoCacheService"
4
-
5
- /**
6
- * 异步函数变为同步函数
7
- * 服务器间的异步,效率低
8
- * 只支持mongo模式
9
- * @returns
10
- */
11
- export let SyncCallServer=function()
12
- {
13
- return function(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>)
14
- {
15
- let method = descriptor.value
16
- descriptor.value = async ()=>
17
- {
18
- let key = "sync_"+method.name
19
- let func = async ()=>
20
- {
21
- let item = await GMongoCacheSer.getData(key)
22
- let ret = null
23
- while(item)
24
- {
25
- await core.sleep(200)
26
- item = await GMongoCacheSer.getData(key)
27
- }
28
- //10秒后过期,避免卡死
29
- let mcm = await GMongoCacheSer.addData(key,true,Date.now()+10*1000)
30
- if(!mcm)
31
- {
32
- await func()
33
- }
34
- return
35
- }
36
- await func()
37
- let ret = GSyncQueueTool.add(method.name,async ()=>
38
- {
39
- return await method.apply(self, arguments)
40
- })
41
- await GMongoCacheSer.deleteOne({key})
42
- return ret
43
- }
44
- }
45
- }