mm_os 2.8.0 → 2.8.1

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 (287) hide show
  1. package/demo/app/dev/README.md +1 -0
  2. package/demo/app/dev/app.js +149 -0
  3. package/demo/app/dev/app.json +12 -0
  4. package/demo/app/dev/event_api/client/event.json +11 -0
  5. package/demo/app/dev/event_api/client/main.js +19 -0
  6. package/demo/app/dev/event_api/manage/event.json +19 -0
  7. package/demo/app/dev/event_api/manage/main.js +26 -0
  8. package/demo/app/dev/plugin/doc/static/api_list.html +144 -0
  9. package/demo/app/dev/plugin/doc/static/api_view.html +692 -0
  10. package/demo/app/dev/plugin/doc/static/index.html +138 -0
  11. package/demo/app/dev/plugin/doc/static/request_test.html +311 -0
  12. package/demo/app/dev/plugin/main/api_dev_client/api/api.json +11 -0
  13. package/demo/app/dev/plugin/main/api_dev_client/api/index.js +54 -0
  14. package/demo/app/dev/plugin/main/api_dev_client/api/param.json +31 -0
  15. package/demo/app/dev/plugin/main/api_dev_client/app/api.json +13 -0
  16. package/demo/app/dev/plugin/main/api_dev_client/app/index.js +13 -0
  17. package/demo/app/dev/plugin/main/api_dev_client/app/param.json +147 -0
  18. package/demo/app/dev/plugin/main/api_dev_client/app/sql.json +28 -0
  19. package/demo/app/dev/plugin/main/api_dev_client/auto/api.json +37 -0
  20. package/demo/app/dev/plugin/main/api_dev_client/auto/auto_db.js +70 -0
  21. package/demo/app/dev/plugin/main/api_dev_client/auto/auto_file.js +32 -0
  22. package/demo/app/dev/plugin/main/api_dev_client/auto/index.js +51 -0
  23. package/demo/app/dev/plugin/main/api_dev_client/auto/param.json +51 -0
  24. package/demo/app/dev/plugin/main/api_dev_client/com.js +349 -0
  25. package/demo/app/dev/plugin/main/api_dev_client/db/api.json +10 -0
  26. package/demo/app/dev/plugin/main/api_dev_client/db/index.js +71 -0
  27. package/demo/app/dev/plugin/main/api_dev_client/db/param.json +31 -0
  28. package/demo/app/dev/plugin/main/api_dev_client/dict/api.json +10 -0
  29. package/demo/app/dev/plugin/main/api_dev_client/dict/index.js +49 -0
  30. package/demo/app/dev/plugin/main/api_dev_client/dict/param.json +29 -0
  31. package/demo/app/dev/plugin/main/api_dev_client/event/api.json +10 -0
  32. package/demo/app/dev/plugin/main/api_dev_client/event/index.js +31 -0
  33. package/demo/app/dev/plugin/main/api_dev_client/event/param.json +31 -0
  34. package/demo/app/dev/plugin/main/api_dev_client/help/api.json +10 -0
  35. package/demo/app/dev/plugin/main/api_dev_client/help/index.js +14 -0
  36. package/demo/app/dev/plugin/main/api_dev_client/help/param.json +31 -0
  37. package/demo/app/dev/plugin/main/api_dev_client/nav/api.json +10 -0
  38. package/demo/app/dev/plugin/main/api_dev_client/nav/index.js +36 -0
  39. package/demo/app/dev/plugin/main/api_dev_client/nav/param.json +36 -0
  40. package/demo/app/dev/plugin/main/api_dev_client/plugin/api.json +10 -0
  41. package/demo/app/dev/plugin/main/api_dev_client/plugin/index.js +13 -0
  42. package/demo/app/dev/plugin/main/api_dev_client/plugin/param.json +31 -0
  43. package/demo/app/dev/plugin/main/api_dev_client/source/api.json +10 -0
  44. package/demo/app/dev/plugin/main/api_dev_client/source/index.js +14 -0
  45. package/demo/app/dev/plugin/main/api_dev_client/source/param.json +31 -0
  46. package/demo/app/dev/plugin/main/api_dev_client/sql/api.json +10 -0
  47. package/demo/app/dev/plugin/main/api_dev_client/sql/index.js +13 -0
  48. package/demo/app/dev/plugin/main/api_dev_client/sql/param.json +31 -0
  49. package/demo/app/dev/plugin/main/api_dev_client/task/api.json +16 -0
  50. package/demo/app/dev/plugin/main/api_dev_client/task/index.js +13 -0
  51. package/demo/app/dev/plugin/main/api_dev_client/task/param.json +31 -0
  52. package/demo/app/dev/plugin/main/api_dev_client/translate/api.json +39 -0
  53. package/demo/app/dev/plugin/main/api_dev_client/translate/index.js +43 -0
  54. package/demo/app/dev/plugin/main/api_dev_client/translate/param.json +130 -0
  55. package/demo/app/dev/plugin/main/api_dev_client/translate/sql.json +62 -0
  56. package/demo/app/dev/plugin/main/api_dev_client/ui/api.json +10 -0
  57. package/demo/app/dev/plugin/main/api_dev_client/ui/index.js +146 -0
  58. package/demo/app/dev/plugin/main/api_dev_client/ui/param.json +31 -0
  59. package/demo/app/dev/plugin/main/api_dev_client/view/api.json +10 -0
  60. package/demo/app/dev/plugin/main/api_dev_client/view/index.js +100 -0
  61. package/demo/app/dev/plugin/main/api_dev_client/view/param.json +29 -0
  62. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/nav.vue +12 -0
  63. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/obj.vue +12 -0
  64. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/post.vue +12 -0
  65. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/query.vue +12 -0
  66. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/edit.vue +39 -0
  67. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/list.vue +12 -0
  68. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/search.vue +12 -0
  69. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/table.vue +12 -0
  70. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/type.vue +12 -0
  71. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/view.vue +56 -0
  72. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/view.json +48 -0
  73. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/api.json +37 -0
  74. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/auto_db.js +120 -0
  75. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy.js +101 -0
  76. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_framework.js +118 -0
  77. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_template.js +78 -0
  78. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy_file.js +97 -0
  79. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/common.js +198 -0
  80. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/django_server.js +104 -0
  81. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/helper.js +161 -0
  82. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/koa_art_server.js +102 -0
  83. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/mini_app_home.js +415 -0
  84. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/razor.js +0 -0
  85. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/springboot.js +0 -0
  86. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/thinkphp.js +0 -0
  87. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/uni_app_home.js +418 -0
  88. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_admin.js +78 -0
  89. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_home.js +112 -0
  90. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create_file.js +97 -0
  91. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/add_data.js +221 -0
  92. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/create_table.js +162 -0
  93. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/set_auth_table.js +86 -0
  94. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/index.js +524 -0
  95. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/param.json +37 -0
  96. package/demo/app/proxy/event_api/all/event.json +20 -0
  97. package/demo/app/proxy/event_api/all/main.js +50 -0
  98. package/demo/app/route/app.js +131 -0
  99. package/demo/app/route/app.json +11 -0
  100. package/demo/app/route/event_api/client/event.json +10 -0
  101. package/demo/app/route/event_api/client/main.js +19 -0
  102. package/demo/app/route/event_api/manage/event.json +18 -0
  103. package/demo/app/route/event_api/manage/main.js +70 -0
  104. package/demo/app/route/plugin/main/api_route_client/pass/api.json +37 -0
  105. package/demo/app/route/plugin/main/api_route_client/pass/index.js +33 -0
  106. package/demo/app/route/plugin/main/api_route_client/pass/param.json +50 -0
  107. package/demo/app/route/plugin/main/index.js +144 -0
  108. package/demo/app/route/plugin/main/plugin.json +20 -0
  109. package/demo/app/sys/app.js +169 -0
  110. package/demo/app/sys/app.json +11 -0
  111. package/demo/app/sys/event_api/api/before.js +80 -0
  112. package/demo/app/sys/event_api/api/check.js +103 -0
  113. package/demo/app/sys/event_api/api/event.json +31 -0
  114. package/demo/app/sys/event_api/api/main.js +19 -0
  115. package/demo/app/sys/event_api/apis/before.js +80 -0
  116. package/demo/app/sys/event_api/apis/event.json +21 -0
  117. package/demo/app/sys/event_api/apis/main.js +19 -0
  118. package/demo/app/sys/event_api/client/event.json +10 -0
  119. package/demo/app/sys/event_api/client/main.js +17 -0
  120. package/demo/app/sys/event_api/doc/event.json +18 -0
  121. package/demo/app/sys/event_api/doc/main.js +67 -0
  122. package/demo/app/sys/event_api/img/event.json +11 -0
  123. package/demo/app/sys/event_api/img/main.js +90 -0
  124. package/demo/app/sys/event_api/manage/event.json +10 -0
  125. package/demo/app/sys/event_api/manage/main.js +19 -0
  126. package/demo/app/sys/event_api/upload/event.json +10 -0
  127. package/demo/app/sys/event_api/upload/main.js +17 -0
  128. package/demo/app/sys/plugin/app_admin/index.js +127 -0
  129. package/demo/app/sys/plugin/app_admin/plugin.json +20 -0
  130. package/demo/app/sys/plugin/main/api_client/config/api.json +39 -0
  131. package/demo/app/sys/plugin/main/api_client/config/index.js +37 -0
  132. package/demo/app/sys/plugin/main/api_client/config/param.json +27 -0
  133. package/demo/app/sys/plugin/main/api_client/config/sql.json +70 -0
  134. package/demo/app/sys/plugin/main/api_client/lang/api.json +37 -0
  135. package/demo/app/sys/plugin/main/api_client/lang/index.js +27 -0
  136. package/demo/app/sys/plugin/main/api_client/lang/param.json +22 -0
  137. package/demo/app/sys/plugin/main/api_client/nav/api.json +15 -0
  138. package/demo/app/sys/plugin/main/api_client/nav/index.js +39 -0
  139. package/demo/app/sys/plugin/main/api_client/nav/param.json +87 -0
  140. package/demo/app/sys/plugin/main/api_client/query/api.json +35 -0
  141. package/demo/app/sys/plugin/main/api_client/query/index.js +48 -0
  142. package/demo/app/sys/plugin/main/api_client/theme/api.json +37 -0
  143. package/demo/app/sys/plugin/main/api_client/theme/index.js +30 -0
  144. package/demo/app/sys/plugin/main/api_client/theme/param.json +31 -0
  145. package/demo/app/sys/plugin/main/api_client/translate/api.json +39 -0
  146. package/demo/app/sys/plugin/main/api_client/translate/index.js +21 -0
  147. package/demo/app/sys/plugin/main/api_client/translate/param.json +130 -0
  148. package/demo/app/sys/plugin/main/api_client/translate/sql.json +62 -0
  149. package/demo/app/sys/plugin/main/api_upload/image/api.json +15 -0
  150. package/demo/app/sys/plugin/main/api_upload/image/index.js +62 -0
  151. package/demo/app/sys/plugin/main/api_upload/image/param.json +9 -0
  152. package/demo/app/sys/plugin/main/task/task_demo/index.js +37 -0
  153. package/demo/app/sys/plugin/main/task/task_demo/task.json +24 -0
  154. package/demo/app/sys/plugin/user/index.js +127 -0
  155. package/demo/app/sys/plugin/user/plugin.json +20 -0
  156. package/demo/app/sys/plugin/user/static/img/logo.png +0 -0
  157. package/demo/app/sys/static/img/avatar_1674484608066.png +0 -0
  158. package/demo/app/sys/static/img/avatar_1674633778171.jpeg +0 -0
  159. package/demo/app/sys/static/img/avatar_1674962702334.jpeg +0 -0
  160. package/demo/app/sys/static/img/avatar_1675075431736.jpeg +0 -0
  161. package/demo/app/sys/static/img/avatar_1675497065533.jpeg +0 -0
  162. package/demo/app/sys/static/img/avatar_1685352550990.jpeg +0 -0
  163. package/demo/app/sys/static/img/avatar_1685353685992.jpeg +0 -0
  164. package/demo/app/sys/static/img/avatar_1685353956587.jpeg +0 -0
  165. package/demo/app/sys/static/img/avatar_1685353971148.jpeg +0 -0
  166. package/demo/app/sys/static/img/avatar_1685353983723.jpeg +0 -0
  167. package/demo/app/sys/static/img/avatar_1685354014745.jpeg +0 -0
  168. package/demo/app/sys/static/img/avatar_1685354122355.jpeg +0 -0
  169. package/demo/app/sys/static/img/avatar_1685357983520.jpeg +0 -0
  170. package/demo/app/sys/static/img/avatar_1685358453383.jpeg +0 -0
  171. package/demo/app/sys/static/img/avatar_1685416570438.jpeg +0 -0
  172. package/demo/app/sys/static/img/avatar_1685512675830.png +0 -0
  173. package/demo/app/sys/static/img/avatar_1685939425608.jpeg +0 -0
  174. package/demo/app/sys/static/img/avatar_1685939886560.jpeg +0 -0
  175. package/demo/app/sys/static/img/avatar_1686106313194.png +0 -0
  176. package/demo/app/sys/static/img/avatar_1686371876175.png +0 -0
  177. package/demo/app/sys/static/img/avatar_1686372033596.png +0 -0
  178. package/demo/app/sys/static/img/avatar_1688215220669.png +0 -0
  179. package/demo/app/sys/static/img/avatar_1688531184690.png +0 -0
  180. package/demo/app/sys/static/img/avatar_1688531233080.png +0 -0
  181. package/demo/app/sys/static/img/avatar_1688548526909.png +0 -0
  182. package/demo/app/sys/static/img/avatar_1688549213411.png +0 -0
  183. package/demo/app/sys/static/img/avatar_1688549511977.png +0 -0
  184. package/demo/app/sys/static/img/avatar_1688549685464.png +0 -0
  185. package/demo/app/sys/static/img/avatar_1688608623049.png +0 -0
  186. package/demo/app/sys/static/img/avatar_1688638500476.png +0 -0
  187. package/demo/app/sys/static/img/avatar_1688638515195.png +0 -0
  188. package/demo/app/sys/static/img/avatar_1688638539928.png +0 -0
  189. package/demo/app/sys/static/img/avatar_1688638557960.png +0 -0
  190. package/demo/app/sys/static/img/avatar_1688638761798.png +0 -0
  191. package/demo/app/sys/static/img/avatar_1688638943140.png +0 -0
  192. package/demo/app/sys/static/img/avatar_1688639068330.png +0 -0
  193. package/demo/app/sys/static/img/image_1685357101273.jpeg +0 -0
  194. package/demo/app/sys/static/img/logo.png +0 -0
  195. package/demo/app/user/app.js +148 -0
  196. package/demo/app/user/app.json +11 -0
  197. package/demo/app/user/event_api/client/event.json +10 -0
  198. package/demo/app/user/event_api/client/main.js +18 -0
  199. package/demo/app/user/event_api/manage/event.json +10 -0
  200. package/demo/app/user/event_api/manage/main.js +19 -0
  201. package/demo/app/user/plugin/main/api_user_client/account/api.json +39 -0
  202. package/demo/app/user/plugin/main/api_user_client/account/index.js +53 -0
  203. package/demo/app/user/plugin/main/api_user_client/account/param.json +130 -0
  204. package/demo/app/user/plugin/main/api_user_client/base/api.json +27 -0
  205. package/demo/app/user/plugin/main/api_user_client/base/index.js +84 -0
  206. package/demo/app/user/plugin/main/api_user_client/base/param.json +130 -0
  207. package/demo/app/user/plugin/main/api_user_client/core/api.json +20 -0
  208. package/demo/app/user/plugin/main/api_user_client/core/forgot.js +14 -0
  209. package/demo/app/user/plugin/main/api_user_client/core/password.js +14 -0
  210. package/demo/app/user/plugin/main/api_user_client/core/sign_out.js +26 -0
  211. package/demo/app/user/plugin/main/api_user_client/core/state.js +21 -0
  212. package/demo/app/user/plugin/main/api_user_client/count/api.json +27 -0
  213. package/demo/app/user/plugin/main/api_user_client/count/chongzhi.js +103 -0
  214. package/demo/app/user/plugin/main/api_user_client/count/index.js +40 -0
  215. package/demo/app/user/plugin/main/api_user_client/count/param.json +40 -0
  216. package/demo/app/user/plugin/main/api_user_client/forgot/api.json +37 -0
  217. package/demo/app/user/plugin/main/api_user_client/forgot/index - /345/211/257/346/234/254.jsbat" +41 -0
  218. package/demo/app/user/plugin/main/api_user_client/forgot/index.js +36 -0
  219. package/demo/app/user/plugin/main/api_user_client/forgot/param.json +56 -0
  220. package/demo/app/user/plugin/main/api_user_client/oauth/WXBizDataCrypt.js +33 -0
  221. package/demo/app/user/plugin/main/api_user_client/oauth/api.json +31 -0
  222. package/demo/app/user/plugin/main/api_user_client/oauth/index.js +16 -0
  223. package/demo/app/user/plugin/main/api_user_client/oauth/oauth.js +270 -0
  224. package/demo/app/user/plugin/main/api_user_client/oauth/oauth.json +88 -0
  225. package/demo/app/user/plugin/main/api_user_client/oauth/param.json +111 -0
  226. package/demo/app/user/plugin/main/api_user_client/password/api.json +21 -0
  227. package/demo/app/user/plugin/main/api_user_client/password/index.js +56 -0
  228. package/demo/app/user/plugin/main/api_user_client/password/param.json +44 -0
  229. package/demo/app/user/plugin/main/api_user_client/phone_code/aliyun.js +230 -0
  230. package/demo/app/user/plugin/main/api_user_client/phone_code/api.json +37 -0
  231. package/demo/app/user/plugin/main/api_user_client/phone_code/index.js +18 -0
  232. package/demo/app/user/plugin/main/api_user_client/phone_code/index.js_ +230 -0
  233. package/demo/app/user/plugin/main/api_user_client/phone_code/param.json +58 -0
  234. package/demo/app/user/plugin/main/api_user_client/phone_code/phone_code.js +278 -0
  235. package/demo/app/user/plugin/main/api_user_client/realname/api.json +21 -0
  236. package/demo/app/user/plugin/main/api_user_client/realname/index.js +48 -0
  237. package/demo/app/user/plugin/main/api_user_client/realname/param.json +74 -0
  238. package/demo/app/user/plugin/main/api_user_client/servicer/api.json +29 -0
  239. package/demo/app/user/plugin/main/api_user_client/servicer/index.js +19 -0
  240. package/demo/app/user/plugin/main/api_user_client/servicer/param.json +41 -0
  241. package/demo/app/user/plugin/main/api_user_client/servicer/sql.json +113 -0
  242. package/demo/app/user/plugin/main/api_user_client/set_address/api.json +37 -0
  243. package/demo/app/user/plugin/main/api_user_client/set_address/index.js +101 -0
  244. package/demo/app/user/plugin/main/api_user_client/set_address/param.json +165 -0
  245. package/demo/app/user/plugin/main/api_user_client/set_avatar/api.json +35 -0
  246. package/demo/app/user/plugin/main/api_user_client/set_avatar/index.js +77 -0
  247. package/demo/app/user/plugin/main/api_user_client/set_info/api.json +35 -0
  248. package/demo/app/user/plugin/main/api_user_client/set_info/index.js +47 -0
  249. package/demo/app/user/plugin/main/api_user_client/set_nickname/api.json +35 -0
  250. package/demo/app/user/plugin/main/api_user_client/set_nickname/index.js +49 -0
  251. package/demo/app/user/plugin/main/api_user_client/set_pay_password/api.json +21 -0
  252. package/demo/app/user/plugin/main/api_user_client/set_pay_password/index.js +67 -0
  253. package/demo/app/user/plugin/main/api_user_client/sign_in/api.json +11 -0
  254. package/demo/app/user/plugin/main/api_user_client/sign_in/index.js +275 -0
  255. package/demo/app/user/plugin/main/api_user_client/sign_in/param.json +125 -0
  256. package/demo/app/user/plugin/main/api_user_client/sign_in/state.js +37 -0
  257. package/demo/app/user/plugin/main/api_user_client/sign_up/api.json +12 -0
  258. package/demo/app/user/plugin/main/api_user_client/sign_up/index.js +110 -0
  259. package/demo/app/user/plugin/main/api_user_client/sign_up/param.json +65 -0
  260. package/demo/app/user/plugin/main/api_user_client/sign_up_in/api.json +37 -0
  261. package/demo/app/user/plugin/main/api_user_client/sign_up_in/index.js +110 -0
  262. package/demo/app/user/plugin/main/api_user_client/sign_up_in/param.json +34 -0
  263. package/demo/app/user/plugin/main/api_user_client/token/api.json +25 -0
  264. package/demo/app/user/plugin/main/api_user_client/token/index.js +20 -0
  265. package/demo/app/user/plugin/main/api_user_client/token/param.json +16 -0
  266. package/demo/app/user/plugin/main/api_user_manage/account_base/api.json +37 -0
  267. package/demo/app/user/plugin/main/api_user_manage/account_base/index.js +40 -0
  268. package/demo/app/user/plugin/main/api_user_manage/account_base/param.json +130 -0
  269. package/demo/app/user/plugin/main/api_user_manage/invitation_code/api.json +37 -0
  270. package/demo/app/user/plugin/main/api_user_manage/invitation_code/index.js +106 -0
  271. package/demo/app/user/plugin/main/api_user_manage/invitation_code/param.json +130 -0
  272. package/demo/app/user/plugin/main/api_user_manage/update_team/api.json +35 -0
  273. package/demo/app/user/plugin/main/api_user_manage/update_team/index.js +218 -0
  274. package/demo/app/user/plugin/main/api_user_manage/update_team/param.json +130 -0
  275. package/demo/app/user/static/img/logo.png +0 -0
  276. package/demo/app/ws/app.js +122 -0
  277. package/demo/app/ws/app.json +11 -0
  278. package/demo/app/ws/event_api/client/event.json +10 -0
  279. package/demo/app/ws/event_api/client/main.js +17 -0
  280. package/demo/app/ws/socket/ws/index.js +43 -0
  281. package/demo/app/ws/socket/ws/socket.json +14 -0
  282. package/demo/config/development.json +95 -0
  283. package/demo/config/face.sql +3824 -0
  284. package/demo/config/local.json +80 -0
  285. package/demo/index.js +19 -0
  286. package/package.json +59 -58
  287. package/cache/test/main/config.json +0 -7
@@ -0,0 +1,230 @@
1
+ class Phone_code {
2
+ /**
3
+ * 构造函数
4
+ * @param {Object} config 配置参数
5
+ */
6
+ constructor(config) {
7
+ // http://api.smsbao.com/sms?u=USERNAME&p=PASSWORD&m=PHONE&c=CONTENT
8
+ this.config = {
9
+ // 短信发送地址
10
+ url: "https://gyytz.market.alicloudapi.com/sms/smsSend?",
11
+ // 阿里云appcode
12
+ appcode: "51126b682bdb4d12bcb1eb0909fd5ec0",
13
+ // 验证码有效时长
14
+ expires: 15,
15
+ // 修改密码
16
+ model_password: {
17
+ mobile: "18813868813",
18
+ param: "123456",
19
+ smsSignId: "2e65b1bb3d054466b82f0c9d125465e2",
20
+ templateId: "8166a0ae27b7499fa8bdda1ed12a07bd"
21
+ },
22
+ // 重置密码
23
+ model_forgot: {
24
+ mobile: "18813868813",
25
+ param: "123456,15",
26
+ smsSignId: "2e65b1bb3d054466b82f0c9d125465e2",
27
+ templateId: "29833afb9ae94f21a3f66af908d54627"
28
+ },
29
+ // 注册账号
30
+ model_sign_up: {
31
+ mobile: "18813868813",
32
+ param: "123456,15",
33
+ smsSignId: "2e65b1bb3d054466b82f0c9d125465e2",
34
+ templateId: "a09602b817fd47e59e7c6e603d3f088d"
35
+ },
36
+ // 绑定手机
37
+ model_bind: {
38
+ mobile: "18813868813",
39
+ param: "123456,15",
40
+ smsSignId: "2e65b1bb3d054466b82f0c9d125465e2",
41
+ templateId: "ea66d14c664649a69a19a6b47ba028db"
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ /**
48
+ * 新建验证码
49
+ * @param {String} method 请求方法
50
+ * @param {String} phone 手机号码
51
+ * @return {String} 返回验证码
52
+ */
53
+ Phone_code.prototype.new_code = async function(key) {
54
+ var code;
55
+ var num = Math.ceil(Math.random() * 1000);
56
+ if (num < 10) {
57
+ code = "0" + num + "0" + num;
58
+ } else if (num < 100) {
59
+ code = "00" + num;
60
+ } else if (num < 1000) {
61
+ code = "0" + num;
62
+ }
63
+ var obj = {
64
+ time: new Date(),
65
+ code
66
+ };
67
+
68
+ var bl = await $.cache.set(key, JSON.stringify(obj), this.config.expires * 60);
69
+ if (bl) {
70
+ return code;
71
+ } else {
72
+ return null;
73
+ }
74
+ };
75
+
76
+ /**
77
+ * 发送验证码
78
+ * @param {String} method 请求方法
79
+ * @param {String} phone 手机号码
80
+ * @return {Object} 返回发送结果
81
+ */
82
+ Phone_code.prototype.send = async function(method, phone) {
83
+ var config = this.config;
84
+ var model = config["model_" + method];
85
+ var http = new $.Http();
86
+ var key = "code_" + method + "_" + phone;
87
+ var value = await $.cache.get(key);
88
+ var code;
89
+ if (value) {
90
+ var obj = JSON.parse(value);
91
+ if (obj.time.toTime().addSeconds(config.expires * 60) < new Date()) {
92
+ return $.ret.bl(false, "验证码已过期!");
93
+ } else {
94
+ code = obj.code;
95
+ }
96
+ } else {
97
+ code = await this.new_code(key);
98
+ }
99
+ if (code) {
100
+ var param = "**code**:" + code + ",**minute**:" + config.expires;
101
+ var query = Object.assign({}, model, {
102
+ param,
103
+ mobile: phone
104
+ });
105
+ var url = $.toUrl(query, config.url);
106
+ // console.log(url);
107
+ var web = await http.post(url, {}, {
108
+ Authorization: "APPCODE " + config.appcode
109
+ }, "json");
110
+ // console.log(web);
111
+ if (web.body) {
112
+ console.log(web.body);
113
+ var json = web.body.toJson();
114
+ if (json.msg === "成功") {
115
+ return $.ret.bl(true, "发送成功!");
116
+ } else {
117
+ return $.ret.error(Number(json.code), json.msg);
118
+ }
119
+ } else {
120
+ return $.ret.error(10000, "请求短信服务端失败!");
121
+ }
122
+ } else {
123
+ return $.ret.error(10000, "缓存验证码失败!");
124
+ }
125
+ };
126
+
127
+ /**
128
+ * 注册
129
+ * @param {String} phone 手机号码
130
+ * @param {Object} db 数据库管理器
131
+ * @return {Object} 执行结果
132
+ */
133
+ Phone_code.prototype.sign_up = async function(phone, db, username) {
134
+ var user = await db.getObj({
135
+ username
136
+ });
137
+ if (user) {
138
+ return $.ret.bl(false, "用户已存在!");
139
+ } else {
140
+ user = await db.getObj({
141
+ phone
142
+ });
143
+ if (user) {
144
+ return $.ret.bl(false, "该手机号码已绑定其他账户!");
145
+ }
146
+ }
147
+ return await this.send("sign_up", phone);
148
+ };
149
+
150
+ /**
151
+ * 重置密码
152
+ * @param {String} phone 手机号码
153
+ * @param {Object} db 数据库管理器
154
+ * @return {Object} 执行结果
155
+ */
156
+ Phone_code.prototype.forgot = async function(phone, db, username) {
157
+ var user = await db.getObj({
158
+ username
159
+ });
160
+ if (!user) {
161
+ return $.ret.error(10000, "用户不存在!");
162
+ } else {
163
+ if(user.phone !== phone){
164
+ return $.ret.error(10000, "用户所绑定的手机号不一致!");
165
+ }
166
+ phone = user.phone;
167
+ }
168
+ return await this.send("forgot", phone);
169
+ };
170
+
171
+ /**
172
+ * 修改密码
173
+ * @param {String} phone 手机号码
174
+ * @param {Object} db 数据库管理器
175
+ * @return {Object} 执行结果
176
+ */
177
+ Phone_code.prototype.password = async function(phone, db, username) {
178
+ return $.ret.bl(true, "修改密码发送验证码成功!");
179
+ };
180
+
181
+
182
+ /**
183
+ * 绑定手机
184
+ * @param {String} phone 手机号码
185
+ * @param {Object} db 数据库管理器
186
+ * @return {Object} 执行结果
187
+ */
188
+ Phone_code.prototype.bind = async function(phone, db, username) {
189
+ var user = await db.getObj({
190
+ username
191
+ });
192
+ if (!user) {
193
+ return $.ret.error(10000, "用户不存在!");
194
+ } else {
195
+ phone = user.phone;
196
+ }
197
+ return await this.send("bind", phone);
198
+ };
199
+
200
+ /**
201
+ * 执行
202
+ * @param {Object} query
203
+ * @param {Object} db
204
+ */
205
+ Phone_code.prototype.run = async function(query, db) {
206
+ var method = query.method;
207
+ if (this[method]) {
208
+ return await this[method](query.phone, db, query.username);
209
+ } else {
210
+ return $.ret.error(10000, "错误的请求!");
211
+ }
212
+ };
213
+
214
+ var phone_code = new Phone_code();
215
+
216
+ /**
217
+ * 接口主函数
218
+ * @param {Object} ctx HTTP上下文
219
+ * @param {Object} db 数据管理器,如: { next: async function{}, ret: {} }
220
+ * @return {Object} 执行结果
221
+ */
222
+ async function main(ctx, db) {
223
+ // 获取请求参数
224
+ var req = ctx.request;
225
+ db.table = "user_account";
226
+ var param = Object.assign({}, req.query, req.body);
227
+ return await phone_code.run(param, db);
228
+ };
229
+
230
+ exports.main = main;
@@ -0,0 +1,58 @@
1
+ {
2
+ // 是否启用过滤, 启用过滤后, 不符合的参数会被过滤掉
3
+ "filter": true,
4
+ // 校验脚本文件, 可以使用脚本的方式加一步进行校验, 让传参更加安全
5
+ "func_file": "",
6
+ // get请求
7
+ "get": {
8
+ // 查询参数校验项
9
+ "query": [],
10
+ // 查询必填参数
11
+ "query_required": []
12
+ },
13
+ // post请求
14
+ "post": {
15
+ // 查询参数校验项
16
+ "query": [],
17
+ // 查询必填参数
18
+ "query_required": ["method"],
19
+ // 正文参数校验项
20
+ "body": ["username","phone"],
21
+ // 正文必填参数
22
+ "body_required": []
23
+ },
24
+ // 校验列表
25
+ "list": [{
26
+ "name": "method",
27
+ "title": "方法",
28
+ "type": "string",
29
+ // 字符串类型时设置
30
+ "string": {
31
+ // 传值范围,字符串时为限制字符长度
32
+ "range": [3, 32]
33
+ }
34
+ },
35
+ {
36
+ "name": "username",
37
+ "title": "用户名",
38
+ "type": "string",
39
+ // 字符串类型时设置
40
+ "string": {
41
+ "format": "username",
42
+ // 传值范围,字符串时为限制字符长度
43
+ "range": [5, 24]
44
+ }
45
+ },
46
+ {
47
+ "name": "phone",
48
+ "title": "手机号码",
49
+ "type": "string",
50
+ // 字符串类型时设置
51
+ "string": {
52
+ "format": "phone",
53
+ // 传值范围,字符串时为限制字符长度
54
+ "range": [11, 11]
55
+ }
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,278 @@
1
+ class Phone_code {
2
+ /**
3
+ * 构造函数
4
+ * @param {Object} config 配置参数
5
+ */
6
+ constructor(config) {
7
+ this.config = {
8
+ // 验证码有效时长
9
+ expires: 15,
10
+ // 短信发送地址
11
+ url: "http://api.smsbao.com/sms?u=${username}&p=${password}&m=${phone}&c=${content}",
12
+ // 用户名
13
+ username: "31772309",
14
+ // 密码
15
+ password: "asd159357"
16
+ }
17
+ }
18
+ }
19
+
20
+ /**
21
+ * 新建验证码
22
+ * @param {String} method 请求方法
23
+ * @param {String} phone 手机号码
24
+ * @return {String} 返回验证码
25
+ */
26
+ Phone_code.prototype.new_code = async function(key) {
27
+ var code;
28
+ var num = Math.ceil(Math.random() * 1000);
29
+ if (num < 10) {
30
+ code = "0" + num + "0" + num;
31
+ } else if (num < 100) {
32
+ code = "00" + num;
33
+ } else if (num < 1000) {
34
+ code = "0" + num;
35
+ }
36
+ await $.cache.set(key + "_click", code, 60);
37
+ var bl = await $.cache.set(key, code, this.config.expires * 60);
38
+ if (bl) {
39
+ return code;
40
+ } else {
41
+ return null;
42
+ }
43
+ };
44
+
45
+ $.getCode = async function(method, phone) {
46
+ var key = "code_" + method + "_" + phone;
47
+ return await $.cache.get(key);
48
+ }
49
+
50
+ /**
51
+ * 发送验证码
52
+ * @param {String} method 请求方法
53
+ * @param {String} phone 手机号码
54
+ * @return {Object} 返回发送结果
55
+ */
56
+ Phone_code.prototype.send = async function(method, phone) {
57
+ var {
58
+ username,
59
+ password,
60
+ expires,
61
+ url
62
+ } = this.config;
63
+ var key = "code_" + method + "_" + phone;
64
+ var value = await $.cache.get(key + "_click");
65
+ var code;
66
+ if (value) {
67
+ return $.ret.bl(true, "已发送验证码,请注意查收!");
68
+ } else {
69
+ code = await this.new_code(key);
70
+ }
71
+ if (code) {
72
+ password = password.md5();
73
+
74
+ // 发送验证码
75
+ var content = encodeURIComponent(`【e脸通】欢迎来到文字修仙游戏世界!您的验证码为${code},在${expires}分钟内有效。`);
76
+ var u = eval("`" + url + "`");
77
+ var http = new $.Http();
78
+ var web = await http.get(u);
79
+ var errno = web.body;
80
+ if (errno) {
81
+ errno = Number(errno);
82
+ if (errno == 0) {
83
+ return $.ret.bl(true, "发送成功!");
84
+ } else {
85
+ var meaage = "";
86
+ switch (errno) {
87
+ case -1:
88
+ meaage = "参数不全"
89
+ break
90
+ case -2:
91
+ meaage = "服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!"
92
+ break
93
+ case 30:
94
+ meaage = "密码错误";
95
+ break;
96
+ case 40:
97
+ meaage = "账号不存在";
98
+ break;
99
+ case 41:
100
+ meaage = "余额不足";
101
+ break;
102
+ case 43:
103
+ meaage = "IP地址受限";
104
+ break;
105
+ case 50:
106
+ meaage = "内容含有敏感词";
107
+ break;
108
+ case 51:
109
+ meaage = "手机号码不正确";
110
+ break;
111
+ }
112
+ return $.ret.error(11000 + errno, meaage);
113
+ }
114
+ } else {
115
+ return $.ret.error(10000, "请求短信服务端失败!");
116
+ }
117
+ } else {
118
+ return $.ret.error(10000, "缓存验证码失败!");
119
+ }
120
+ };
121
+
122
+ /**
123
+ * 发送验证码
124
+ * @param {String} query 查询参
125
+ * @param {Object} db 数据库管理器
126
+ * @return {Object} 执行结果
127
+ */
128
+ Phone_code.prototype.set_delivery_address = async function(query, db, ctx) {
129
+ var {
130
+ username,
131
+ phone
132
+ } = query;
133
+ var user = await db.getObj({
134
+ username
135
+ });
136
+ if (user) {
137
+ return $.ret.bl(false, "用户已存在!");
138
+ }
139
+ return await this.send("set_delivery_address", phone);
140
+ };
141
+
142
+ /**
143
+ * 注册、登录
144
+ * @param {String} query 查询参
145
+ * @param {Object} db 数据库管理器
146
+ * @return {Object} 执行结果
147
+ */
148
+ Phone_code.prototype.sign_up = async function(query, db, ctx) {
149
+ var {
150
+ phone
151
+ } = query;
152
+ var user = await db.getObj({
153
+ phone
154
+ });
155
+ if (user) {
156
+ return $.ret.error(10001, '账号已被使用,请换一个!');
157
+ }
158
+ return await this.send("sign_up", phone);
159
+ };
160
+
161
+ /**
162
+ * 登录
163
+ * @param {String} query 查询参
164
+ * @param {Object} db 数据库管理器
165
+ * @return {Object} 执行结果
166
+ */
167
+ Phone_code.prototype.sign_in = async function(query, db, ctx) {
168
+ var {
169
+ phone
170
+ } = query;
171
+ var user = await db.getObj({
172
+ phone
173
+ });
174
+ if (!user) {
175
+ return $.ret.error(10000, '用户不存在!');
176
+ }
177
+ return await this.send("sign_in", phone);
178
+ };
179
+
180
+ /**
181
+ * 忘记密码
182
+ * @param {String} query 查询参
183
+ * @param {Object} db 数据库管理器
184
+ * @return {Object} 执行结果
185
+ */
186
+ Phone_code.prototype.forgot = async function(query, db, ctx) {
187
+ var {
188
+ username,
189
+ phone
190
+ } = query;
191
+ var user = await db.getObj({
192
+ phone
193
+ });
194
+ if (!user) {
195
+ return $.ret.error(10000, "用户不存在!");
196
+ }
197
+ return await this.send("forgot", phone);
198
+ };
199
+
200
+ /**
201
+ * 修改密码
202
+ * @param {String} query 查询参
203
+ * @param {Object} db 数据库管理器
204
+ * @return {Object} 执行结果
205
+ */
206
+ Phone_code.prototype.password = async function(query, db, ctx) {
207
+ var {
208
+ username,
209
+ phone
210
+ } = query;
211
+ var user = ctx.session.user
212
+ if (!user) {
213
+ return $.ret.error(10000, "账号未登录!");
214
+ }
215
+ var phone = user.phone
216
+ return await this.send("password", phone);
217
+ };
218
+
219
+
220
+ /**
221
+ * 发送验证码 - 设置支付密码
222
+ * @param {String} query 查询参
223
+ * @param {Object} db 数据库管理器
224
+ * @return {Object} 执行结果
225
+ */
226
+ Phone_code.prototype.pay_password = async function(query, db, ctx) {
227
+ var {
228
+ phone
229
+ } = query;
230
+ var user = ctx.session.user;
231
+ if (!user) {
232
+ return $.ret.error(6000, "账户未登录!");
233
+ }
234
+
235
+ if (user.phone !== phone) {
236
+ return $.ret.error(10000, "输入的号码与绑定的手机号码不同!");
237
+ }
238
+ return await this.send("pay_password", phone);
239
+ };
240
+
241
+ /**
242
+ * 绑定手机
243
+ * @param {String} query 查询参
244
+ * @param {Object} db 数据库管理器
245
+ * @return {Object} 执行结果
246
+ */
247
+ Phone_code.prototype.bind = async function(query, db, ctx) {
248
+ var {
249
+ username,
250
+ phone
251
+ } = query;
252
+ var user = await db.getObj({
253
+ username
254
+ });
255
+ if (!user) {
256
+ return $.ret.error(10000, "用户不存在!");
257
+ } else {
258
+ phone = user.phone;
259
+ }
260
+ return await this.send("bind", phone);
261
+ };
262
+
263
+ /**
264
+ * 执行
265
+ * @param {Object} query
266
+ * @param {Object} db
267
+ */
268
+ Phone_code.prototype.run = async function(query, db, ctx) {
269
+ var method = query.method;
270
+ var param = Object.assign({}, query, ctx.request.body);
271
+ if (this[method]) {
272
+ return await this[method](param, db, ctx);
273
+ } else {
274
+ return $.ret.error(10000, "错误的请求!");
275
+ }
276
+ };
277
+
278
+ module.exports = Phone_code;
@@ -0,0 +1,21 @@
1
+ {
2
+ // 路由路径
3
+ "path": "/api/user/realname",
4
+ // 名称, 用于动态增删改API配置
5
+ "name": "user_realname",
6
+ // 标题, 用于开发文档显示
7
+ "title": "实名认证",
8
+ // 描述, 用于介绍该路由的作用
9
+ "description": "这是用户提交实名认证信息的接口",
10
+ // 函数文件, 用于驱动脚本, 实现业务
11
+ "func_file": "./index.js",
12
+ // 请求方法, 选填 GET, POST, ALL。 ALL指同时支持GET/POST
13
+ "method": "POST",
14
+ // 参数配置路径, 用于校验API请求参数是否正确, 同时显示在API文档中
15
+ "param_path": "./param.json",
16
+ /* 授权协议 */
17
+ "oauth": {
18
+ // 是否需要登录, true表示需要登录才能访问该接口
19
+ "signIn": true
20
+ }
21
+ }
@@ -0,0 +1,48 @@
1
+ // 集合路由、导航,不开发前端的情况下可以将以下2行注释掉
2
+ // const nav = $.nav_admin('{0}');
3
+ // nav.update();
4
+
5
+ /**
6
+ * 接口主函数
7
+ * @param {Object} ctx HTTP上下文
8
+ * @param {Object} db 数据管理器,如: { next: async function{}, ret: {} }
9
+ * @return {Object} 执行结果
10
+ */
11
+ async function main(ctx, db) {
12
+ // 获取请求参数
13
+ var req = ctx.request;
14
+ var {
15
+ query,
16
+ body
17
+ } = req;
18
+ // return "hello world" + JSON.stringify(body);
19
+
20
+ console.log(body)
21
+ const login_user = ctx.session.user
22
+ const qy = {
23
+ user_id: login_user.user_id
24
+ };
25
+ if (!login_user) {
26
+ return $.ret.error(10000, '获取登录用户失败');
27
+ }
28
+ db.table = "user_info";
29
+ let user_info = await db.getObj(qy);
30
+ var obj = {
31
+ //设置图片
32
+ img_idcard_front: body.img_idcard_front,
33
+ img_idcard_back: body.img_idcard_back,
34
+ img_hand_held: body.img_hand_held,
35
+ name: body.name,
36
+ idcard: body.idcard,
37
+ idcard_state: 2
38
+ };
39
+ var bl;
40
+ if (user_info) {
41
+ bl = await db.set(qy, obj);
42
+ } else {
43
+ bl = await db.add(Object.assign({}, qy, obj));
44
+ }
45
+ return bl > 0 ? $.ret.bl(true, "提交成功,请耐心等待审核") : $.ret.error(10000, "提交失败!" + JSON.stringify(db.error))
46
+ };
47
+
48
+ exports.main = main;
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "user_realname",
3
+ "title": "实名认证",
4
+ "post": {
5
+ "body": [
6
+ "name",
7
+ "idcard",
8
+ "img_idcard_front",
9
+ "img_idcard_back",
10
+ "img_hand_held"
11
+ ]
12
+ },
13
+ "list": [{
14
+ "name": "user_id",
15
+ "title": "用户ID",
16
+ "description": "",
17
+ "type": "number",
18
+ "dataType": "mediumint",
19
+ "number": {
20
+ "max": 8388607
21
+ }
22
+ },
23
+ {
24
+ "name": "name",
25
+ "title": "姓名",
26
+ "description": "",
27
+ "type": "string",
28
+ "dataType": "varchar",
29
+ "number": {
30
+ "max": 32
31
+ }
32
+ },
33
+ {
34
+ "name": "idcard",
35
+ "title": "身份证号",
36
+ "description": "",
37
+ "type": "string",
38
+ "dataType": "varchar",
39
+ "string": {
40
+ "max": 64
41
+ }
42
+ },
43
+ {
44
+ "name": "img_idcard_front",
45
+ "title": "身份证正面",
46
+ "description": "",
47
+ "type": "string",
48
+ "dataType": "varchar",
49
+ "string": {
50
+ "max": 255
51
+ }
52
+ },
53
+ {
54
+ "name": "img_idcard_back",
55
+ "title": "身份证反面",
56
+ "description": "",
57
+ "type": "string",
58
+ "dataType": "varchar",
59
+ "string": {
60
+ "max": 255
61
+ }
62
+ },
63
+ {
64
+ "name": "img_hand_held",
65
+ "title": "手持身份证",
66
+ "description": "",
67
+ "type": "string",
68
+ "dataType": "varchar",
69
+ "string": {
70
+ "max": 255
71
+ }
72
+ }
73
+ ]
74
+ }