User_Account.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8">
  5. <style type="text/css">
  6. <!--
  7. @import url(md.css);
  8. -->
  9. </style>
  10. </head>
  11. <body>
  12. <h1>1 帐号注册接口</h1>
  13. <h3>注册请求</h3>
  14. <ul>
  15. <li><p>URI</p>
  16. <pre><code>/he/register POST
  17. </code></pre></li>
  18. <li><p>参数</p>
  19. <pre><code>参数以 form 表单的形式提交.
  20. </code></pre>
  21. <table><thead>
  22. <tr>
  23. <th align="left">字段</th>
  24. <th align="left">字段名称</th>
  25. <th align="left">类型</th>
  26. <th align="left">长度</th>
  27. <th align="left">必须有值</th>
  28. <th align="left">必传</th>
  29. </tr>
  30. </thead><tbody>
  31. <tr>
  32. <td align="left">email</td>
  33. <td align="left">企业邮箱</td>
  34. <td align="left">string</td>
  35. <td align="left">6 ~ 32</td>
  36. <td align="left">Y</td>
  37. <td align="left">Y</td>
  38. </tr>
  39. <tr>
  40. <td align="left">phone</td>
  41. <td align="left">手机号码</td>
  42. <td align="left">string</td>
  43. <td align="left">6 ~ 32</td>
  44. <td align="left">Y</td>
  45. <td align="left">Y</td>
  46. </tr>
  47. <tr>
  48. <td align="left">sms_code</td>
  49. <td align="left">手机验证码</td>
  50. <td align="left">string</td>
  51. <td align="left">4 ~ 6</td>
  52. <td align="left">Y</td>
  53. <td align="left">Y</td>
  54. </tr>
  55. <tr>
  56. <td align="left">pass</td>
  57. <td align="left">密码(MD5)</td>
  58. <td align="left">string</td>
  59. <td align="left">32</td>
  60. <td align="left">Y</td>
  61. <td align="left">Y</td>
  62. </tr>
  63. </tbody></table></li>
  64. </ul>
  65. <h3>注册响应</h3>
  66. <ul>
  67. <li><p>状态码</p>
  68. <pre><code>200 注册操作成功.
  69. 500 参数不合要求 或 注册出现异常
  70. </code></pre></li>
  71. <li><p>注册成功, 返回用户手机号码</p>
  72. <pre><code>{
  73. &quot;data&quot;: 18818869897, // 手机号码
  74. &quot;msg&quot;: &quot;&quot;,
  75. &quot;code&quot;: 200
  76. }
  77. </code></pre></li>
  78. <li><p>注册不成功, 提示异常信息给用户查看</p>
  79. <pre><code>{
  80. &quot;data&quot;: null,
  81. &quot;msg&quot;: &quot;增加用户资料步骤出错了&quot;,
  82. &quot;code&quot;: 500
  83. }
  84. </code></pre></li>
  85. </ul>
  86. <hr>
  87. <h1>2 登录接口</h1>
  88. <h3>登录请求</h3>
  89. <ul>
  90. <li><p>URI</p>
  91. <pre><code> /he/jss_login_check POST
  92. </code></pre></li>
  93. <li><p>参数</p>
  94. <pre><code> 参数以 form 表单的形式提交.
  95. </code></pre>
  96. <table><thead>
  97. <tr>
  98. <th align="left">字段</th>
  99. <th align="left">字段名称</th>
  100. <th align="left">类型</th>
  101. <th align="left">长度</th>
  102. <th align="left">必须有值</th>
  103. <th align="left">必传</th>
  104. </tr>
  105. </thead><tbody>
  106. <tr>
  107. <td align="left">username</td>
  108. <td align="left">用户帐号 或 手机号</td>
  109. <td align="left">string</td>
  110. <td align="left">6 ~ 32</td>
  111. <td align="left">Y</td>
  112. <td align="left">Y</td>
  113. </tr>
  114. <tr>
  115. <td align="left">password</td>
  116. <td align="left">密码</td>
  117. <td align="left">string</td>
  118. <td align="left">32</td>
  119. <td align="left">Y</td>
  120. <td align="left">Y</td>
  121. </tr>
  122. </tbody></table>
  123. <h4>登录方式现在有两种</h4>
  124. <h5>一. 用户帐号 + 密码 登录方式</h5>
  125. <blockquote>
  126. <p>提交到 Server 端之前帐号和密码都需要做如下的变动:</p>
  127. <ul>
  128. <li><p>帐号值变动</p>
  129. <pre><code>$(&quot;#username&quot;).val(&quot;account&quot;+username);
  130. </code></pre></li>
  131. <li><p>密码值变动: (此处采用的username的值是未变动的.)</p>
  132. <pre><code>var pmd5 = $.md5(password);
  133. $(&quot;#password&quot;).val($.md5(username+pmd5));
  134. </code></pre></li>
  135. </ul>
  136. </blockquote>
  137. <h5>二. 手机号 + 验证码 快捷登录方式</h5>
  138. <p>1 . 手机验证码请求</p>
  139. <blockquote>
  140. <ul>
  141. <li><p>URI</p>
  142. <pre><code>/he/n/send_sms
  143. </code></pre></li>
  144. <li><p>参数</p>
  145. <pre><code>手机号检验通过,才会发送验证码到手机
  146. </code></pre>
  147. <table><thead>
  148. <tr>
  149. <th align="left">字段</th>
  150. <th align="left">字段名称</th>
  151. <th align="left">类型</th>
  152. <th align="left">长度</th>
  153. <th align="left">必须有值</th>
  154. <th align="left">必传</th>
  155. </tr>
  156. </thead><tbody>
  157. <tr>
  158. <td align="left">phone</td>
  159. <td align="left">手机号</td>
  160. <td align="left">string</td>
  161. <td align="left">11</td>
  162. <td align="left">Y</td>
  163. <td align="left">Y</td>
  164. </tr>
  165. </tbody></table></li>
  166. </ul>
  167. </blockquote>
  168. <p>2 . 提交到 Server 端之前帐号和密码都需要做如下的变动:</p>
  169. <blockquote>
  170. <ul>
  171. <li><p>帐号值变动: </p>
  172. <pre><code>$(&quot;#username&quot;).val(&quot;sms&quot;+username);
  173. </code></pre></li>
  174. <li><p>密码值变动 (此处采用的 <code>username</code> 的值是未变动的; <code>smsCode</code> 是用户填写的验证码值)</p>
  175. <pre><code>$(&quot;#password&quot;).val($.md5(username+smsCode));
  176. </code></pre></li>
  177. </ul>
  178. </blockquote></li>
  179. </ul>
  180. <h3>登录响应</h3>
  181. <ul>
  182. <li><p>登录失败</p>
  183. <pre><code>{
  184. &quot;data&quot;: null,
  185. &quot;msg&quot;: &quot;未通过登录检查&quot;,
  186. &quot;code&quot;: 500
  187. }
  188. </code></pre></li>
  189. <li><p>登录成功.</p></li>
  190. </ul>
  191. <blockquote>
  192. <ol>
  193. <li>设置了用户名称到Session , 属性值: <code>username</code> .</li>
  194. <li><p>设置了此用户可访问的菜单列表 <code>List&lt;AccessMenu&gt;</code> , Session属性值: <code>user_menu_session</code> .</p>
  195. <ul>
  196. <li><p>数据结构:</p>
  197. <pre><code>List&lt;AccessMenu&gt;
  198. 其中 AccessMenu:
  199. String desc;
  200. List&lt;AccessModule&gt; moduleList;
  201. List&lt;AccessMenu&gt; subMenuList; // 子菜单列表
  202. 其中 AccessModule:
  203. String desc;
  204. String uri;
  205. </code></pre></li>
  206. <li><p>数据范例 </p>
  207. <pre><code>[{
  208. &quot;desc&quot;: &quot;系统基本配置&quot;,
  209. &quot;moduleList&quot;: [{
  210. &quot;desc&quot;: &quot;权限基础数据&quot;,
  211. &quot;uri&quot;: &quot;/he/privilege/manager&quot;
  212. },
  213. {
  214. &quot;desc&quot;: &quot;角色管理配置&quot;,
  215. &quot;uri&quot;: &quot;/he/privilege_role/manager&quot;
  216. },
  217. {
  218. &quot;desc&quot;: &quot;用户管理配置&quot;,
  219. &quot;uri&quot;: &quot;/he/privilege_user/manager&quot;
  220. }],
  221. &quot;subMenuList&quot;: [{
  222. &quot;desc&quot;: &quot;测试2&quot;,
  223. &quot;moduleList&quot;: [{
  224. &quot;desc&quot;: &quot;用户管理&quot;,
  225. &quot;uri&quot;: &quot;/he/user/manager&quot;
  226. }],
  227. &quot;subMenuList&quot;: []
  228. }]
  229. },
  230. {
  231. &quot;desc&quot;: &quot;测试&quot;,
  232. &quot;moduleList&quot;: [{
  233. &quot;desc&quot;: &quot;用户管理配置&quot;,
  234. &quot;uri&quot;: &quot;/he/privilege_user/manager&quot;
  235. }],
  236. &quot;subMenuList&quot;: []
  237. }]
  238. </code></pre></li>
  239. </ul></li>
  240. </ol>
  241. </blockquote>
  242. <hr>
  243. <h1>3. 修改密码</h1>
  244. <hr>
  245. <h1>4. 忘记密码(更换密码)</h1>
  246. <hr>
  247. <h1>5. 更换邮箱</h1>
  248. <hr>
  249. <h1>6. 更换手机号码</h1>
  250. <hr>
  251. <script src="md.js"></script>
  252. </body>
  253. </html>