mm_os 2.8.0 → 2.8.2

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 (286) hide show
  1. package/core/com/param/drive.js +5 -4
  2. package/demo/app/dev/README.md +1 -0
  3. package/demo/app/dev/app.js +149 -0
  4. package/demo/app/dev/app.json +12 -0
  5. package/demo/app/dev/event_api/client/event.json +11 -0
  6. package/demo/app/dev/event_api/client/main.js +19 -0
  7. package/demo/app/dev/event_api/manage/event.json +19 -0
  8. package/demo/app/dev/event_api/manage/main.js +26 -0
  9. package/demo/app/dev/plugin/doc/static/api_list.html +144 -0
  10. package/demo/app/dev/plugin/doc/static/api_view.html +692 -0
  11. package/demo/app/dev/plugin/doc/static/index.html +138 -0
  12. package/demo/app/dev/plugin/doc/static/request_test.html +311 -0
  13. package/demo/app/dev/plugin/main/api_dev_client/api/api.json +11 -0
  14. package/demo/app/dev/plugin/main/api_dev_client/api/index.js +54 -0
  15. package/demo/app/dev/plugin/main/api_dev_client/api/param.json +31 -0
  16. package/demo/app/dev/plugin/main/api_dev_client/app/api.json +13 -0
  17. package/demo/app/dev/plugin/main/api_dev_client/app/index.js +13 -0
  18. package/demo/app/dev/plugin/main/api_dev_client/app/param.json +147 -0
  19. package/demo/app/dev/plugin/main/api_dev_client/app/sql.json +28 -0
  20. package/demo/app/dev/plugin/main/api_dev_client/auto/api.json +37 -0
  21. package/demo/app/dev/plugin/main/api_dev_client/auto/auto_db.js +70 -0
  22. package/demo/app/dev/plugin/main/api_dev_client/auto/auto_file.js +32 -0
  23. package/demo/app/dev/plugin/main/api_dev_client/auto/index.js +51 -0
  24. package/demo/app/dev/plugin/main/api_dev_client/auto/param.json +51 -0
  25. package/demo/app/dev/plugin/main/api_dev_client/com.js +349 -0
  26. package/demo/app/dev/plugin/main/api_dev_client/db/api.json +10 -0
  27. package/demo/app/dev/plugin/main/api_dev_client/db/index.js +71 -0
  28. package/demo/app/dev/plugin/main/api_dev_client/db/param.json +31 -0
  29. package/demo/app/dev/plugin/main/api_dev_client/dict/api.json +10 -0
  30. package/demo/app/dev/plugin/main/api_dev_client/dict/index.js +49 -0
  31. package/demo/app/dev/plugin/main/api_dev_client/dict/param.json +29 -0
  32. package/demo/app/dev/plugin/main/api_dev_client/event/api.json +10 -0
  33. package/demo/app/dev/plugin/main/api_dev_client/event/index.js +31 -0
  34. package/demo/app/dev/plugin/main/api_dev_client/event/param.json +31 -0
  35. package/demo/app/dev/plugin/main/api_dev_client/help/api.json +10 -0
  36. package/demo/app/dev/plugin/main/api_dev_client/help/index.js +14 -0
  37. package/demo/app/dev/plugin/main/api_dev_client/help/param.json +31 -0
  38. package/demo/app/dev/plugin/main/api_dev_client/nav/api.json +10 -0
  39. package/demo/app/dev/plugin/main/api_dev_client/nav/index.js +36 -0
  40. package/demo/app/dev/plugin/main/api_dev_client/nav/param.json +36 -0
  41. package/demo/app/dev/plugin/main/api_dev_client/plugin/api.json +10 -0
  42. package/demo/app/dev/plugin/main/api_dev_client/plugin/index.js +13 -0
  43. package/demo/app/dev/plugin/main/api_dev_client/plugin/param.json +31 -0
  44. package/demo/app/dev/plugin/main/api_dev_client/source/api.json +10 -0
  45. package/demo/app/dev/plugin/main/api_dev_client/source/index.js +14 -0
  46. package/demo/app/dev/plugin/main/api_dev_client/source/param.json +31 -0
  47. package/demo/app/dev/plugin/main/api_dev_client/sql/api.json +10 -0
  48. package/demo/app/dev/plugin/main/api_dev_client/sql/index.js +13 -0
  49. package/demo/app/dev/plugin/main/api_dev_client/sql/param.json +31 -0
  50. package/demo/app/dev/plugin/main/api_dev_client/task/api.json +16 -0
  51. package/demo/app/dev/plugin/main/api_dev_client/task/index.js +13 -0
  52. package/demo/app/dev/plugin/main/api_dev_client/task/param.json +31 -0
  53. package/demo/app/dev/plugin/main/api_dev_client/translate/api.json +39 -0
  54. package/demo/app/dev/plugin/main/api_dev_client/translate/index.js +43 -0
  55. package/demo/app/dev/plugin/main/api_dev_client/translate/param.json +130 -0
  56. package/demo/app/dev/plugin/main/api_dev_client/translate/sql.json +62 -0
  57. package/demo/app/dev/plugin/main/api_dev_client/ui/api.json +10 -0
  58. package/demo/app/dev/plugin/main/api_dev_client/ui/index.js +146 -0
  59. package/demo/app/dev/plugin/main/api_dev_client/ui/param.json +31 -0
  60. package/demo/app/dev/plugin/main/api_dev_client/view/api.json +10 -0
  61. package/demo/app/dev/plugin/main/api_dev_client/view/index.js +100 -0
  62. package/demo/app/dev/plugin/main/api_dev_client/view/param.json +29 -0
  63. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/nav.vue +12 -0
  64. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/obj.vue +12 -0
  65. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/post.vue +12 -0
  66. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/query.vue +12 -0
  67. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/edit.vue +39 -0
  68. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/list.vue +12 -0
  69. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/search.vue +12 -0
  70. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/table.vue +12 -0
  71. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/type.vue +12 -0
  72. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/view.vue +56 -0
  73. package/demo/app/dev/plugin/main/api_dev_client/view/tpl/view.json +48 -0
  74. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/api.json +37 -0
  75. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/auto_db.js +120 -0
  76. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy.js +101 -0
  77. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_framework.js +118 -0
  78. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_template.js +78 -0
  79. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy_file.js +97 -0
  80. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/common.js +198 -0
  81. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/django_server.js +104 -0
  82. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/helper.js +161 -0
  83. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/koa_art_server.js +102 -0
  84. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/mini_app_home.js +415 -0
  85. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/razor.js +0 -0
  86. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/springboot.js +0 -0
  87. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/thinkphp.js +0 -0
  88. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/uni_app_home.js +418 -0
  89. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_admin.js +78 -0
  90. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_home.js +112 -0
  91. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create_file.js +97 -0
  92. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/add_data.js +221 -0
  93. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/create_table.js +162 -0
  94. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/set_auth_table.js +86 -0
  95. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/index.js +524 -0
  96. package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/param.json +37 -0
  97. package/demo/app/route/app.js +131 -0
  98. package/demo/app/route/app.json +11 -0
  99. package/demo/app/route/event_api/client/event.json +10 -0
  100. package/demo/app/route/event_api/client/main.js +19 -0
  101. package/demo/app/route/event_api/manage/event.json +18 -0
  102. package/demo/app/route/event_api/manage/main.js +70 -0
  103. package/demo/app/route/plugin/main/api_route_client/pass/api.json +37 -0
  104. package/demo/app/route/plugin/main/api_route_client/pass/index.js +33 -0
  105. package/demo/app/route/plugin/main/api_route_client/pass/param.json +50 -0
  106. package/demo/app/route/plugin/main/index.js +144 -0
  107. package/demo/app/route/plugin/main/plugin.json +20 -0
  108. package/demo/app/sys/app.js +169 -0
  109. package/demo/app/sys/app.json +11 -0
  110. package/demo/app/sys/event_api/api/before.js +80 -0
  111. package/demo/app/sys/event_api/api/check.js +103 -0
  112. package/demo/app/sys/event_api/api/event.json +31 -0
  113. package/demo/app/sys/event_api/api/main.js +19 -0
  114. package/demo/app/sys/event_api/apis/before.js +80 -0
  115. package/demo/app/sys/event_api/apis/event.json +21 -0
  116. package/demo/app/sys/event_api/apis/main.js +19 -0
  117. package/demo/app/sys/event_api/client/event.json +10 -0
  118. package/demo/app/sys/event_api/client/main.js +17 -0
  119. package/demo/app/sys/event_api/doc/event.json +18 -0
  120. package/demo/app/sys/event_api/doc/main.js +67 -0
  121. package/demo/app/sys/event_api/img/event.json +11 -0
  122. package/demo/app/sys/event_api/img/main.js +90 -0
  123. package/demo/app/sys/event_api/manage/event.json +10 -0
  124. package/demo/app/sys/event_api/manage/main.js +19 -0
  125. package/demo/app/sys/event_api/upload/event.json +10 -0
  126. package/demo/app/sys/event_api/upload/main.js +17 -0
  127. package/demo/app/sys/plugin/app_admin/index.js +127 -0
  128. package/demo/app/sys/plugin/app_admin/plugin.json +20 -0
  129. package/demo/app/sys/plugin/main/api_client/config/api.json +39 -0
  130. package/demo/app/sys/plugin/main/api_client/config/index.js +37 -0
  131. package/demo/app/sys/plugin/main/api_client/config/param.json +27 -0
  132. package/demo/app/sys/plugin/main/api_client/config/sql.json +70 -0
  133. package/demo/app/sys/plugin/main/api_client/lang/api.json +37 -0
  134. package/demo/app/sys/plugin/main/api_client/lang/index.js +27 -0
  135. package/demo/app/sys/plugin/main/api_client/lang/param.json +22 -0
  136. package/demo/app/sys/plugin/main/api_client/nav/api.json +15 -0
  137. package/demo/app/sys/plugin/main/api_client/nav/index.js +39 -0
  138. package/demo/app/sys/plugin/main/api_client/nav/param.json +87 -0
  139. package/demo/app/sys/plugin/main/api_client/query/api.json +35 -0
  140. package/demo/app/sys/plugin/main/api_client/query/index.js +48 -0
  141. package/demo/app/sys/plugin/main/api_client/theme/api.json +37 -0
  142. package/demo/app/sys/plugin/main/api_client/theme/index.js +30 -0
  143. package/demo/app/sys/plugin/main/api_client/theme/param.json +31 -0
  144. package/demo/app/sys/plugin/main/api_client/translate/api.json +39 -0
  145. package/demo/app/sys/plugin/main/api_client/translate/index.js +21 -0
  146. package/demo/app/sys/plugin/main/api_client/translate/param.json +130 -0
  147. package/demo/app/sys/plugin/main/api_client/translate/sql.json +62 -0
  148. package/demo/app/sys/plugin/main/api_upload/image/api.json +15 -0
  149. package/demo/app/sys/plugin/main/api_upload/image/index.js +62 -0
  150. package/demo/app/sys/plugin/main/api_upload/image/param.json +9 -0
  151. package/demo/app/sys/plugin/main/task/task_demo/index.js +37 -0
  152. package/demo/app/sys/plugin/main/task/task_demo/task.json +24 -0
  153. package/demo/app/sys/plugin/user/index.js +127 -0
  154. package/demo/app/sys/plugin/user/plugin.json +20 -0
  155. package/demo/app/sys/plugin/user/static/img/logo.png +0 -0
  156. package/demo/app/sys/static/img/avatar_1674484608066.png +0 -0
  157. package/demo/app/sys/static/img/avatar_1674633778171.jpeg +0 -0
  158. package/demo/app/sys/static/img/avatar_1674962702334.jpeg +0 -0
  159. package/demo/app/sys/static/img/avatar_1675075431736.jpeg +0 -0
  160. package/demo/app/sys/static/img/avatar_1675497065533.jpeg +0 -0
  161. package/demo/app/sys/static/img/avatar_1685352550990.jpeg +0 -0
  162. package/demo/app/sys/static/img/avatar_1685353685992.jpeg +0 -0
  163. package/demo/app/sys/static/img/avatar_1685353956587.jpeg +0 -0
  164. package/demo/app/sys/static/img/avatar_1685353971148.jpeg +0 -0
  165. package/demo/app/sys/static/img/avatar_1685353983723.jpeg +0 -0
  166. package/demo/app/sys/static/img/avatar_1685354014745.jpeg +0 -0
  167. package/demo/app/sys/static/img/avatar_1685354122355.jpeg +0 -0
  168. package/demo/app/sys/static/img/avatar_1685357983520.jpeg +0 -0
  169. package/demo/app/sys/static/img/avatar_1685358453383.jpeg +0 -0
  170. package/demo/app/sys/static/img/avatar_1685416570438.jpeg +0 -0
  171. package/demo/app/sys/static/img/avatar_1685512675830.png +0 -0
  172. package/demo/app/sys/static/img/avatar_1685939425608.jpeg +0 -0
  173. package/demo/app/sys/static/img/avatar_1685939886560.jpeg +0 -0
  174. package/demo/app/sys/static/img/avatar_1686106313194.png +0 -0
  175. package/demo/app/sys/static/img/avatar_1686371876175.png +0 -0
  176. package/demo/app/sys/static/img/avatar_1686372033596.png +0 -0
  177. package/demo/app/sys/static/img/avatar_1688215220669.png +0 -0
  178. package/demo/app/sys/static/img/avatar_1688531184690.png +0 -0
  179. package/demo/app/sys/static/img/avatar_1688531233080.png +0 -0
  180. package/demo/app/sys/static/img/avatar_1688548526909.png +0 -0
  181. package/demo/app/sys/static/img/avatar_1688549213411.png +0 -0
  182. package/demo/app/sys/static/img/avatar_1688549511977.png +0 -0
  183. package/demo/app/sys/static/img/avatar_1688549685464.png +0 -0
  184. package/demo/app/sys/static/img/avatar_1688608623049.png +0 -0
  185. package/demo/app/sys/static/img/avatar_1688638500476.png +0 -0
  186. package/demo/app/sys/static/img/avatar_1688638515195.png +0 -0
  187. package/demo/app/sys/static/img/avatar_1688638539928.png +0 -0
  188. package/demo/app/sys/static/img/avatar_1688638557960.png +0 -0
  189. package/demo/app/sys/static/img/avatar_1688638761798.png +0 -0
  190. package/demo/app/sys/static/img/avatar_1688638943140.png +0 -0
  191. package/demo/app/sys/static/img/avatar_1688639068330.png +0 -0
  192. package/demo/app/sys/static/img/image_1685357101273.jpeg +0 -0
  193. package/demo/app/sys/static/img/logo.png +0 -0
  194. package/demo/app/user/app.js +148 -0
  195. package/demo/app/user/app.json +11 -0
  196. package/demo/app/user/event_api/client/event.json +10 -0
  197. package/demo/app/user/event_api/client/main.js +18 -0
  198. package/demo/app/user/event_api/manage/event.json +10 -0
  199. package/demo/app/user/event_api/manage/main.js +19 -0
  200. package/demo/app/user/plugin/main/api_user_client/account/api.json +39 -0
  201. package/demo/app/user/plugin/main/api_user_client/account/index.js +53 -0
  202. package/demo/app/user/plugin/main/api_user_client/account/param.json +130 -0
  203. package/demo/app/user/plugin/main/api_user_client/base/api.json +27 -0
  204. package/demo/app/user/plugin/main/api_user_client/base/index.js +84 -0
  205. package/demo/app/user/plugin/main/api_user_client/base/param.json +130 -0
  206. package/demo/app/user/plugin/main/api_user_client/core/api.json +20 -0
  207. package/demo/app/user/plugin/main/api_user_client/core/forgot.js +14 -0
  208. package/demo/app/user/plugin/main/api_user_client/core/password.js +14 -0
  209. package/demo/app/user/plugin/main/api_user_client/core/sign_out.js +26 -0
  210. package/demo/app/user/plugin/main/api_user_client/core/state.js +21 -0
  211. package/demo/app/user/plugin/main/api_user_client/count/api.json +27 -0
  212. package/demo/app/user/plugin/main/api_user_client/count/chongzhi.js +103 -0
  213. package/demo/app/user/plugin/main/api_user_client/count/index.js +40 -0
  214. package/demo/app/user/plugin/main/api_user_client/count/param.json +40 -0
  215. package/demo/app/user/plugin/main/api_user_client/forgot/api.json +37 -0
  216. package/demo/app/user/plugin/main/api_user_client/forgot/index - /345/211/257/346/234/254.jsbat" +41 -0
  217. package/demo/app/user/plugin/main/api_user_client/forgot/index.js +36 -0
  218. package/demo/app/user/plugin/main/api_user_client/forgot/param.json +56 -0
  219. package/demo/app/user/plugin/main/api_user_client/oauth/WXBizDataCrypt.js +33 -0
  220. package/demo/app/user/plugin/main/api_user_client/oauth/api.json +31 -0
  221. package/demo/app/user/plugin/main/api_user_client/oauth/index.js +16 -0
  222. package/demo/app/user/plugin/main/api_user_client/oauth/oauth.js +270 -0
  223. package/demo/app/user/plugin/main/api_user_client/oauth/oauth.json +88 -0
  224. package/demo/app/user/plugin/main/api_user_client/oauth/param.json +111 -0
  225. package/demo/app/user/plugin/main/api_user_client/password/api.json +21 -0
  226. package/demo/app/user/plugin/main/api_user_client/password/index.js +56 -0
  227. package/demo/app/user/plugin/main/api_user_client/password/param.json +44 -0
  228. package/demo/app/user/plugin/main/api_user_client/phone_code/aliyun.js +230 -0
  229. package/demo/app/user/plugin/main/api_user_client/phone_code/api.json +37 -0
  230. package/demo/app/user/plugin/main/api_user_client/phone_code/index.js +18 -0
  231. package/demo/app/user/plugin/main/api_user_client/phone_code/index.js_ +230 -0
  232. package/demo/app/user/plugin/main/api_user_client/phone_code/param.json +58 -0
  233. package/demo/app/user/plugin/main/api_user_client/phone_code/phone_code.js +278 -0
  234. package/demo/app/user/plugin/main/api_user_client/realname/api.json +21 -0
  235. package/demo/app/user/plugin/main/api_user_client/realname/index.js +48 -0
  236. package/demo/app/user/plugin/main/api_user_client/realname/param.json +74 -0
  237. package/demo/app/user/plugin/main/api_user_client/servicer/api.json +29 -0
  238. package/demo/app/user/plugin/main/api_user_client/servicer/index.js +19 -0
  239. package/demo/app/user/plugin/main/api_user_client/servicer/param.json +41 -0
  240. package/demo/app/user/plugin/main/api_user_client/servicer/sql.json +113 -0
  241. package/demo/app/user/plugin/main/api_user_client/set_address/api.json +37 -0
  242. package/demo/app/user/plugin/main/api_user_client/set_address/index.js +101 -0
  243. package/demo/app/user/plugin/main/api_user_client/set_address/param.json +165 -0
  244. package/demo/app/user/plugin/main/api_user_client/set_avatar/api.json +35 -0
  245. package/demo/app/user/plugin/main/api_user_client/set_avatar/index.js +77 -0
  246. package/demo/app/user/plugin/main/api_user_client/set_info/api.json +35 -0
  247. package/demo/app/user/plugin/main/api_user_client/set_info/index.js +47 -0
  248. package/demo/app/user/plugin/main/api_user_client/set_nickname/api.json +35 -0
  249. package/demo/app/user/plugin/main/api_user_client/set_nickname/index.js +49 -0
  250. package/demo/app/user/plugin/main/api_user_client/set_pay_password/api.json +21 -0
  251. package/demo/app/user/plugin/main/api_user_client/set_pay_password/index.js +67 -0
  252. package/demo/app/user/plugin/main/api_user_client/sign_in/api.json +11 -0
  253. package/demo/app/user/plugin/main/api_user_client/sign_in/index.js +275 -0
  254. package/demo/app/user/plugin/main/api_user_client/sign_in/param.json +125 -0
  255. package/demo/app/user/plugin/main/api_user_client/sign_in/state.js +37 -0
  256. package/demo/app/user/plugin/main/api_user_client/sign_up/api.json +12 -0
  257. package/demo/app/user/plugin/main/api_user_client/sign_up/index.js +110 -0
  258. package/demo/app/user/plugin/main/api_user_client/sign_up/param.json +65 -0
  259. package/demo/app/user/plugin/main/api_user_client/sign_up_in/api.json +37 -0
  260. package/demo/app/user/plugin/main/api_user_client/sign_up_in/index.js +110 -0
  261. package/demo/app/user/plugin/main/api_user_client/sign_up_in/param.json +34 -0
  262. package/demo/app/user/plugin/main/api_user_client/token/api.json +25 -0
  263. package/demo/app/user/plugin/main/api_user_client/token/index.js +20 -0
  264. package/demo/app/user/plugin/main/api_user_client/token/param.json +16 -0
  265. package/demo/app/user/plugin/main/api_user_manage/account_base/api.json +37 -0
  266. package/demo/app/user/plugin/main/api_user_manage/account_base/index.js +40 -0
  267. package/demo/app/user/plugin/main/api_user_manage/account_base/param.json +130 -0
  268. package/demo/app/user/plugin/main/api_user_manage/invitation_code/api.json +37 -0
  269. package/demo/app/user/plugin/main/api_user_manage/invitation_code/index.js +106 -0
  270. package/demo/app/user/plugin/main/api_user_manage/invitation_code/param.json +130 -0
  271. package/demo/app/user/plugin/main/api_user_manage/update_team/api.json +35 -0
  272. package/demo/app/user/plugin/main/api_user_manage/update_team/index.js +218 -0
  273. package/demo/app/user/plugin/main/api_user_manage/update_team/param.json +130 -0
  274. package/demo/app/user/static/img/logo.png +0 -0
  275. package/demo/app/ws/app.js +122 -0
  276. package/demo/app/ws/app.json +11 -0
  277. package/demo/app/ws/event_api/client/event.json +10 -0
  278. package/demo/app/ws/event_api/client/main.js +17 -0
  279. package/demo/app/ws/socket/ws/index.js +43 -0
  280. package/demo/app/ws/socket/ws/socket.json +14 -0
  281. package/demo/config/development.json +95 -0
  282. package/demo/config/face.sql +3824 -0
  283. package/demo/config/local.json +80 -0
  284. package/demo/index.js +19 -0
  285. package/package.json +59 -58
  286. package/cache/test/main/config.json +0 -7
@@ -0,0 +1,101 @@
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
+
19
+ var user = ctx.session.user;
20
+ if (!user) {
21
+ return $.ret.error(10000, "用户未登录!");
22
+ }
23
+
24
+ var user_id = user.user_id;
25
+ body.user_id = user_id;
26
+
27
+ db.table = 'user_address';
28
+ var db1 = db.new('user_address', 'address_id');
29
+ // if (body.default > 0) {
30
+ // var bl = await db1.set({
31
+ // user_id
32
+ // }, {
33
+ // default: 0
34
+ // });
35
+ // if (!bl) {
36
+ // return $.ret.error(10000, '提交地址失败!');
37
+ // }
38
+ // }
39
+
40
+ var m = query.method;
41
+ var address_id = body.address_id;
42
+ delete query.method;
43
+ delete body.address_id;
44
+
45
+ console.log("query", query, "body", body);
46
+
47
+ console.log("执行类型: " + m);
48
+ // 添加事件
49
+ if (m === "add") {
50
+ var bl = await db1.add(body);
51
+ return bl > 0 ? $.ret.bl(true, '添加成功!') : $.ret.error(10000, '添加失败!');
52
+ }
53
+ // 删除事件
54
+ else if (m === "del") {
55
+ if (!address_id) {
56
+ return $.ret.error(10000, '地址ID是必填字段!');
57
+ }
58
+
59
+ var obj = await db1.getObj({
60
+ address_id,
61
+ user_id
62
+ });
63
+ if (!obj) {
64
+ return $.ret.error(10000, "对象不存在或不属于你");
65
+ }
66
+
67
+ var bl = await db1.del({
68
+ address_id,
69
+ user_id
70
+ });
71
+ console.log(bl);
72
+ return bl > 0 ? $.ret.bl(true, '删除成功!') : $.ret.error(10000, '删除失败!');
73
+ }
74
+ // 修改事件
75
+ else if (m === "set") {
76
+ if (!address_id) {
77
+ return $.ret.error(10000, '地址ID是必填字段!');
78
+ }
79
+
80
+ delete body.address_id;
81
+ var obj = await db1.getObj({
82
+ address_id,
83
+ user_id
84
+ });
85
+ if (!obj) {
86
+ return $.ret.error(10000, "对象不存在或不属于你");
87
+ }
88
+
89
+ var bl = await db1.set({
90
+ address_id,
91
+ user_id
92
+ }, body);
93
+ return bl > 0 ? $.ret.bl(true, '修改成功!') : $.ret.error(10000, '修改失败!');
94
+ }
95
+ // 错误返回
96
+ else {
97
+ return $.ret.error(10000, '错误的方法(method)!');
98
+ }
99
+ };
100
+
101
+ exports.main = main;
@@ -0,0 +1,165 @@
1
+ {
2
+ "name": "user_address",
3
+ "title": "收货地址",
4
+ "add": {
5
+ "query_required": [
6
+ "method"
7
+ ],
8
+ "body": [
9
+ "sex",
10
+ "house_number",
11
+ "tag"
12
+ ],
13
+ "body_required": [
14
+ "province",
15
+ "city",
16
+ "area",
17
+ "name",
18
+ "phone",
19
+ "address",
20
+ "state_default"
21
+ ]
22
+ },
23
+ "set": {
24
+ "query_required": [
25
+ "method"
26
+ ],
27
+ "body": [
28
+ "sex",
29
+ "house_number",
30
+ "tag",
31
+ "province",
32
+ "city",
33
+ "area",
34
+ "name",
35
+ "phone",
36
+ "address",
37
+ "state_default"
38
+ ],
39
+ "body_required": [
40
+ "address_id"
41
+ ]
42
+ },
43
+ "del": {
44
+ "query_required": [
45
+ "method"
46
+ ],
47
+ "body": [],
48
+ "body_required": [
49
+ "address_id"
50
+ ]
51
+ },
52
+ "list": [{
53
+ "name": "address_id",
54
+ "title": "地址ID",
55
+ "description": "",
56
+ "type": "number",
57
+ "dataType": "mediumint",
58
+ "number": {
59
+ "max": 8388607
60
+ }
61
+ },
62
+ {
63
+ "name": "user_id",
64
+ "title": "用户ID",
65
+ "description": "表示该地址是哪个用户的(user_account.phone)",
66
+ "type": "number",
67
+ "dataType": "mediumint",
68
+ "number": {
69
+ "max": 8388607
70
+ }
71
+ },
72
+ {
73
+ "name": "province",
74
+ "title": "省",
75
+ "description": "",
76
+ "type": "string",
77
+ "dataType": "varchar",
78
+ "string": {
79
+ "max": 9,
80
+ "notEmpty": true
81
+ }
82
+ },
83
+ {
84
+ "name": "city",
85
+ "title": "市",
86
+ "description": "",
87
+ "type": "string",
88
+ "dataType": "varchar",
89
+ "string": {
90
+ "max": 9,
91
+ "notEmpty": true
92
+ }
93
+ },
94
+ {
95
+ "name": "area",
96
+ "title": "区",
97
+ "description": "",
98
+ "type": "string",
99
+ "dataType": "varchar",
100
+ "string": {
101
+ "max": 9,
102
+ "notEmpty": true
103
+ }
104
+ },
105
+ {
106
+ "name": "state_default",
107
+ "title": "设置默认",
108
+ "description": "(0非默认|1默认)",
109
+ "type": "number",
110
+ "dataType": "tinyint",
111
+ "number": {
112
+ "max": 1
113
+ }
114
+ },
115
+ {
116
+ "name": "tag",
117
+ "title": "标签",
118
+ "description": "(0无标签|1家|2学校|3公司)",
119
+ "type": "number",
120
+ "dataType": "smallint",
121
+ "string": {
122
+ "max": 125
123
+ }
124
+ },
125
+ {
126
+ "name": "name",
127
+ "title": "收件人姓名",
128
+ "description": "",
129
+ "type": "string",
130
+ "dataType": "varchar",
131
+ "string": {
132
+ "max": 32
133
+ }
134
+ },
135
+ {
136
+ "name": "phone",
137
+ "title": "收件人电话",
138
+ "description": "",
139
+ "type": "string",
140
+ "dataType": "varchar",
141
+ "string": {
142
+ "max": 11,
143
+ "format": "phone"
144
+ }
145
+ },
146
+ {
147
+ "name": "address",
148
+ "title": "收件地址",
149
+ "description": "",
150
+ "type": "string",
151
+ "dataType": "varchar",
152
+ "string": {
153
+ "max": 255
154
+ }
155
+ },
156
+ {
157
+ "name": "keyword",
158
+ "title": "关键词",
159
+ "description": "用于搜索收件人姓名(name)",
160
+ "type": "string",
161
+ "dataType": "varchar",
162
+ "string": {}
163
+ }
164
+ ]
165
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ // 路由路径
3
+ "path": "/api/user/set_avatar",
4
+ // 名称, 用于动态增删改API配置
5
+ "name": "user_set_avatar",
6
+ // 标题, 用于开发文档显示
7
+ "title": "修改头像",
8
+ // 描述, 用于介绍该路由的作用
9
+ "description": "描述接口使用方法",
10
+ // 函数文件, 用于驱动脚本, 实现业务
11
+ "func_file": "./index.js",
12
+ // 请求方法, 选填 GET, POST, ALL。 ALL指同时支持GET/POST
13
+ "method": "ALL",
14
+ // 开放域, 如果域未开放, 则只有特定的协议头才能访问该API, 同时API文档不接见
15
+ "scope": true,
16
+ // 缓存时长, 单位: 分钟。使用缓存后, 二次访问API直接从缓存读取, 不重复执行业务脚本
17
+ "cache": 0,
18
+ // 是否客户端缓存, 使用客户端则不再访问服务器, 直接从浏览器中拿; 使用服务端缓存则会访问服务器
19
+ "client_cache": false,
20
+ /* 授权协议 */
21
+ "oauth": {
22
+ // 是否需要登录, true表示需要登录才能访问该接口
23
+ "signIn": true,
24
+ // 会员权限级别, 如果小于该值, 则无法访问, 0为不限制
25
+ "vip": 0,
26
+ // 管理员权限级别, 如果小于该值, 则无法访问, 0为不限制
27
+ "gm": 0,
28
+ // 商户/第三方权限级别, 如果小于该值, 则无法访问, 0为不限制
29
+ "mc": 0,
30
+ // 用户组, 允许访问该接口的普通用户群体, 传ID数组,例如: [1,5]
31
+ "user_group": [],
32
+ // 管理组, 允许访问该接口的管理员群体, 传ID数组,例如: [1,5]
33
+ "user_admin": []
34
+ }
35
+ }
@@ -0,0 +1,77 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ var dir = path.join($.runPath, "/static/img/avatar/");
4
+ dir.addDir();
5
+ var url_path = "/img/avatar/";
6
+
7
+ /**
8
+ * 处理头像
9
+ * @param {String} avatar
10
+ * @param {Number} user_id
11
+ */
12
+ function handle_avatar(avatar, user_id){
13
+ var url;
14
+ if(avatar.indexOf("data:") === 0){
15
+ var extension = avatar.between('data:image/', ';');
16
+ var name = "user_" + user_id + "." + extension;
17
+ var file = path.join(dir, name);
18
+ var data = avatar.replace(/^data:image\/\w+;base64,/, "");
19
+ var bf = Buffer.from(data, 'base64');
20
+ try {
21
+ fs.writeFileSync(file, bf);
22
+ url = url_path + name;
23
+ } catch (e) {
24
+ fs.closeSync(file);
25
+ console.log(e);
26
+ }
27
+ } else {
28
+ url = avatar;
29
+ }
30
+ return url;
31
+ }
32
+
33
+ /**
34
+ * 接口主函数
35
+ * @param {Object} ctx HTTP上下文
36
+ * @param {Object} db 数据管理器,如: { next: async function{}, ret: {} }
37
+ * @return {Object} 执行结果
38
+ */
39
+ async function main(ctx, db) {
40
+ // 获取请求参数
41
+ var req = ctx.request;
42
+ var {
43
+ query,
44
+ body
45
+ } = req;
46
+
47
+ // console.log("运行修改头像" ,query ,body);
48
+ var user = ctx.session.user;
49
+ if(!user){
50
+ return $.ret.error(10000 ,"用户未登录!");
51
+ }
52
+ var user_id = user.user_id;
53
+
54
+ var avatar = query.avatar || body.avatar;
55
+ if(!avatar){
56
+ return $.ret.error(10000 ,"头像是必填字段!");
57
+ }
58
+
59
+ var db1 = Object.assign({} ,db);
60
+ db1.table = "user_account";
61
+
62
+ var avatar = handle_avatar(avatar, user_id);
63
+ // console.log("操作", user_id ,avatar ,db1.sql ,db1.error);
64
+ var bl = await db1.set({user_id} ,{avatar});
65
+
66
+ bl = bl > 0 ? true : false;
67
+ var message = "头像修改失败!";
68
+
69
+ if(bl){
70
+ message = "头像修改成功!";
71
+ user.avatar = avatar;
72
+ ctx.session.user = user;
73
+ }
74
+ return $.ret.bl(bl, message);
75
+ };
76
+
77
+ exports.main = main;
@@ -0,0 +1,35 @@
1
+ {
2
+ // 路由路径
3
+ "path": "/api/user/set_info",
4
+ // 名称, 用于动态增删改API配置
5
+ "name": "user_set_info",
6
+ // 标题, 用于开发文档显示
7
+ "title": "修改用户信息",
8
+ // 描述, 用于介绍该路由的作用
9
+ "description": "描述接口使用方法",
10
+ // 函数文件, 用于驱动脚本, 实现业务
11
+ "func_file": "./index.js",
12
+ // 请求方法, 选填 GET, POST, ALL。 ALL指同时支持GET/POST
13
+ "method": "ALL",
14
+ // 开放域, 如果域未开放, 则只有特定的协议头才能访问该API, 同时API文档不接见
15
+ "scope": true,
16
+ // 缓存时长, 单位: 分钟。使用缓存后, 二次访问API直接从缓存读取, 不重复执行业务脚本
17
+ "cache": 0,
18
+ // 是否客户端缓存, 使用客户端则不再访问服务器, 直接从浏览器中拿; 使用服务端缓存则会访问服务器
19
+ "client_cache": false,
20
+ /* 授权协议 */
21
+ "oauth": {
22
+ // 是否需要登录, true表示需要登录才能访问该接口
23
+ "signIn": true,
24
+ // 会员权限级别, 如果小于该值, 则无法访问, 0为不限制
25
+ "vip": 0,
26
+ // 管理员权限级别, 如果小于该值, 则无法访问, 0为不限制
27
+ "gm": 0,
28
+ // 商户/第三方权限级别, 如果小于该值, 则无法访问, 0为不限制
29
+ "mc": 0,
30
+ // 用户组, 允许访问该接口的普通用户群体, 传ID数组,例如: [1,5]
31
+ "user_group": [],
32
+ // 管理组, 允许访问该接口的管理员群体, 传ID数组,例如: [1,5]
33
+ "user_admin": []
34
+ }
35
+ }
@@ -0,0 +1,47 @@
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
+
19
+ // console.log("运行修改性别" ,query ,body);
20
+ var user = ctx.session.user;
21
+ if(!user){
22
+ return $.ret.error(10000 ,"用户未登录!");
23
+ }
24
+ var user_id = user.user_id;
25
+
26
+ var sex = query.sex || body.sex;
27
+ if(!sex){
28
+ return $.ret.error(10000 ,"性别是必填字段!");
29
+ }
30
+
31
+ var db1 = Object.assign({} ,db);
32
+ db1.table = "user_info";
33
+
34
+ // console.log("操作", user_id ,sex ,db1.sql ,db1.error);
35
+ var bl = await db1.set({user_id} ,{sex});
36
+
37
+ bl = bl > 0 ? true : false;
38
+ var message = "性别修改失败!";
39
+
40
+ if(bl){
41
+ message = "性别修改成功!";
42
+ }
43
+
44
+ return $.ret.bl(bl ,message);
45
+ };
46
+
47
+ exports.main = main;
@@ -0,0 +1,35 @@
1
+ {
2
+ // 路由路径
3
+ "path": "/api/user/set_nickname",
4
+ // 名称, 用于动态增删改API配置
5
+ "name": "user_set_nickname",
6
+ // 标题, 用于开发文档显示
7
+ "title": "修改昵称",
8
+ // 描述, 用于介绍该路由的作用
9
+ "description": "描述接口使用方法",
10
+ // 函数文件, 用于驱动脚本, 实现业务
11
+ "func_file": "./index.js",
12
+ // 请求方法, 选填 GET, POST, ALL。 ALL指同时支持GET/POST
13
+ "method": "ALL",
14
+ // 开放域, 如果域未开放, 则只有特定的协议头才能访问该API, 同时API文档不接见
15
+ "scope": true,
16
+ // 缓存时长, 单位: 分钟。使用缓存后, 二次访问API直接从缓存读取, 不重复执行业务脚本
17
+ "cache": 0,
18
+ // 是否客户端缓存, 使用客户端则不再访问服务器, 直接从浏览器中拿; 使用服务端缓存则会访问服务器
19
+ "client_cache": false,
20
+ /* 授权协议 */
21
+ "oauth": {
22
+ // 是否需要登录, true表示需要登录才能访问该接口
23
+ "signIn": true,
24
+ // 会员权限级别, 如果小于该值, 则无法访问, 0为不限制
25
+ "vip": 0,
26
+ // 管理员权限级别, 如果小于该值, 则无法访问, 0为不限制
27
+ "gm": 0,
28
+ // 商户/第三方权限级别, 如果小于该值, 则无法访问, 0为不限制
29
+ "mc": 0,
30
+ // 用户组, 允许访问该接口的普通用户群体, 传ID数组,例如: [1,5]
31
+ "user_group": [],
32
+ // 管理组, 允许访问该接口的管理员群体, 传ID数组,例如: [1,5]
33
+ "user_admin": []
34
+ }
35
+ }
@@ -0,0 +1,49 @@
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
+
19
+ // console.log("运行修改昵称" ,query ,body);
20
+ var user = ctx.session.user;
21
+ if(!user){
22
+ return $.ret.error(10000 ,"用户未登录!");
23
+ }
24
+ var user_id = user.user_id;
25
+
26
+ var nickname = query.nickname || body.nickname;
27
+ if(!nickname){
28
+ return $.ret.error(10000 ,"昵称是必填字段!");
29
+ }
30
+
31
+ var db1 = Object.assign({} ,db);
32
+ db1.table = "user_account";
33
+
34
+ // console.log("操作", user_id ,nickname ,db1.sql ,db1.error);
35
+ var bl = await db1.set({user_id} ,{nickname});
36
+
37
+ bl = bl > 0 ? true : false;
38
+ var message = "昵称修改失败!";
39
+
40
+ if(bl){
41
+ message = "昵称修改成功!";
42
+ user.nickname = nickname;
43
+ ctx.session.user = user;
44
+ }
45
+
46
+ return $.ret.bl(bl ,message);
47
+ };
48
+
49
+ exports.main = main;
@@ -0,0 +1,21 @@
1
+ {
2
+ // 路由路径
3
+ "path": "/api/user/set_pay_password",
4
+ // 名称, 用于动态增删改API配置
5
+ "name": "user_set_pay_password",
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
+ "scope": true,
16
+ /* 授权协议 */
17
+ "oauth": {
18
+ // 是否需要登录, true表示需要登录才能访问该接口
19
+ "signIn": true
20
+ }
21
+ }
@@ -0,0 +1,67 @@
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
+
19
+ var user = ctx.session.user;
20
+ var user_id = user.user_id;
21
+ var {
22
+ phone,
23
+ password_pay,
24
+ code
25
+ } = body;
26
+
27
+ if (!code) {
28
+ return $.ret.error(10000, "验证码是必填字段!");
29
+ }
30
+
31
+ // 短信验证码判断
32
+ var key = "code_pay_password_" + phone;
33
+ var value = await $.cache.get(key);
34
+ if (!value) {
35
+ return $.ret.error(10000, '请先发送验证码!');
36
+ }
37
+ var json = value.toJson();
38
+ // if (code !== json.code) {
39
+ // return $.ret.error(30000, '验证码不正确!');
40
+ // }
41
+
42
+ if (!password_pay) {
43
+ return $.ret.error(10000, "支付密码是必填字段!");
44
+ } else if (!phone) {
45
+ return $.ret.error(10000, "手机号码是必填字段!");
46
+ }
47
+
48
+ var db1 = db.new("user_account", "user_id");
49
+
50
+ // console.log("修改操作", user_id, password_pay, db1.sql, db1.error);
51
+ var password_pay = (password_pay + user.salt).md5();
52
+ var bl = await db1.set({
53
+ user_id
54
+ }, {
55
+ password_pay
56
+ });
57
+
58
+ if (bl > 0) {
59
+ user.password_pay = password_pay;
60
+ ctx.session.user = user;
61
+ return $.ret.bl(true, "支付密码修改成功!");
62
+ }
63
+ return $.ret.bl(false, "支付密码修改失败!");
64
+
65
+ };
66
+
67
+ exports.main = main;
@@ -0,0 +1,11 @@
1
+ {
2
+ "path": "/api/user/sign_in",
3
+ "type": "api",
4
+ "name": "user_sign_in",
5
+ "title": "账户登录",
6
+ "cache": 0,
7
+ "func_file": "./index.js",
8
+ "method": "ALL",
9
+ "param_path": "./param.json",
10
+ "check_param": true
11
+ }