123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8">
- <style type="text/css">
- <!--
- @import url(md.css);
- -->
- </style>
-
-
- </head>
- <body>
- <h1>1 帐号注册接口</h1>
- <h3>注册请求</h3>
- <ul>
- <li><p>URI</p>
- <pre><code>/he/register POST
- </code></pre></li>
- <li><p>参数</p>
- <pre><code>参数以 form 表单的形式提交.
- </code></pre>
- <table><thead>
- <tr>
- <th align="left">字段</th>
- <th align="left">字段名称</th>
- <th align="left">类型</th>
- <th align="left">长度</th>
- <th align="left">必须有值</th>
- <th align="left">必传</th>
- </tr>
- </thead><tbody>
- <tr>
- <td align="left">email</td>
- <td align="left">企业邮箱</td>
- <td align="left">string</td>
- <td align="left">6 ~ 32</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- <tr>
- <td align="left">phone</td>
- <td align="left">手机号码</td>
- <td align="left">string</td>
- <td align="left">6 ~ 32</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- <tr>
- <td align="left">sms_code</td>
- <td align="left">手机验证码</td>
- <td align="left">string</td>
- <td align="left">4 ~ 6</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- <tr>
- <td align="left">pass</td>
- <td align="left">密码(MD5)</td>
- <td align="left">string</td>
- <td align="left">32</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- </tbody></table></li>
- </ul>
- <h3>注册响应</h3>
- <ul>
- <li><p>状态码</p>
- <pre><code>200 注册操作成功.
- 500 参数不合要求 或 注册出现异常
- </code></pre></li>
- <li><p>注册成功, 返回用户手机号码</p>
- <pre><code>{
- "data": 18818869897, // 手机号码
- "msg": "",
- "code": 200
- }
- </code></pre></li>
- <li><p>注册不成功, 提示异常信息给用户查看</p>
- <pre><code>{
- "data": null,
- "msg": "增加用户资料步骤出错了",
- "code": 500
- }
- </code></pre></li>
- </ul>
- <hr>
- <h1>2 登录接口</h1>
- <h3>登录请求</h3>
- <ul>
- <li><p>URI</p>
- <pre><code> /he/jss_login_check POST
- </code></pre></li>
- <li><p>参数</p>
- <pre><code> 参数以 form 表单的形式提交.
- </code></pre>
- <table><thead>
- <tr>
- <th align="left">字段</th>
- <th align="left">字段名称</th>
- <th align="left">类型</th>
- <th align="left">长度</th>
- <th align="left">必须有值</th>
- <th align="left">必传</th>
- </tr>
- </thead><tbody>
- <tr>
- <td align="left">username</td>
- <td align="left">用户帐号 或 手机号</td>
- <td align="left">string</td>
- <td align="left">6 ~ 32</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- <tr>
- <td align="left">password</td>
- <td align="left">密码</td>
- <td align="left">string</td>
- <td align="left">32</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- </tbody></table>
- <h4>登录方式现在有两种</h4>
- <h5>一. 用户帐号 + 密码 登录方式</h5>
- <blockquote>
- <p>提交到 Server 端之前帐号和密码都需要做如下的变动:</p>
- <ul>
- <li><p>帐号值变动</p>
- <pre><code>$("#username").val("account"+username);
- </code></pre></li>
- <li><p>密码值变动: (此处采用的username的值是未变动的.)</p>
- <pre><code>var pmd5 = $.md5(password);
- $("#password").val($.md5(username+pmd5));
- </code></pre></li>
- </ul>
- </blockquote>
- <h5>二. 手机号 + 验证码 快捷登录方式</h5>
- <p>1 . 手机验证码请求</p>
- <blockquote>
- <ul>
- <li><p>URI</p>
- <pre><code>/he/n/send_sms
- </code></pre></li>
- <li><p>参数</p>
- <pre><code>手机号检验通过,才会发送验证码到手机
- </code></pre>
- <table><thead>
- <tr>
- <th align="left">字段</th>
- <th align="left">字段名称</th>
- <th align="left">类型</th>
- <th align="left">长度</th>
- <th align="left">必须有值</th>
- <th align="left">必传</th>
- </tr>
- </thead><tbody>
- <tr>
- <td align="left">phone</td>
- <td align="left">手机号</td>
- <td align="left">string</td>
- <td align="left">11</td>
- <td align="left">Y</td>
- <td align="left">Y</td>
- </tr>
- </tbody></table></li>
- </ul>
- </blockquote>
- <p>2 . 提交到 Server 端之前帐号和密码都需要做如下的变动:</p>
- <blockquote>
- <ul>
- <li><p>帐号值变动: </p>
- <pre><code>$("#username").val("sms"+username);
- </code></pre></li>
- <li><p>密码值变动 (此处采用的 <code>username</code> 的值是未变动的; <code>smsCode</code> 是用户填写的验证码值)</p>
- <pre><code>$("#password").val($.md5(username+smsCode));
- </code></pre></li>
- </ul>
- </blockquote></li>
- </ul>
- <h3>登录响应</h3>
- <ul>
- <li><p>登录失败</p>
- <pre><code>{
- "data": null,
- "msg": "未通过登录检查",
- "code": 500
- }
- </code></pre></li>
- <li><p>登录成功.</p></li>
- </ul>
- <blockquote>
- <ol>
- <li>设置了用户名称到Session , 属性值: <code>username</code> .</li>
- <li><p>设置了此用户可访问的菜单列表 <code>List<AccessMenu></code> , Session属性值: <code>user_menu_session</code> .</p>
- <ul>
- <li><p>数据结构:</p>
- <pre><code>List<AccessMenu>
- 其中 AccessMenu:
- String desc;
- List<AccessModule> moduleList;
- List<AccessMenu> subMenuList; // 子菜单列表
- 其中 AccessModule:
- String desc;
- String uri;
- </code></pre></li>
- <li><p>数据范例 </p>
- <pre><code>[{
- "desc": "系统基本配置",
- "moduleList": [{
- "desc": "权限基础数据",
- "uri": "/he/privilege/manager"
- },
- {
- "desc": "角色管理配置",
- "uri": "/he/privilege_role/manager"
- },
- {
- "desc": "用户管理配置",
- "uri": "/he/privilege_user/manager"
- }],
- "subMenuList": [{
- "desc": "测试2",
- "moduleList": [{
- "desc": "用户管理",
- "uri": "/he/user/manager"
- }],
- "subMenuList": []
- }]
- },
- {
- "desc": "测试",
- "moduleList": [{
- "desc": "用户管理配置",
- "uri": "/he/privilege_user/manager"
- }],
- "subMenuList": []
- }]
- </code></pre></li>
- </ul></li>
- </ol>
- </blockquote>
- <hr>
- <h1>3. 修改密码</h1>
- <hr>
- <h1>4. 忘记密码(更换密码)</h1>
- <hr>
- <h1>5. 更换邮箱</h1>
- <hr>
- <h1>6. 更换手机号码</h1>
- <hr>
- <script src="md.js"></script>
- </body>
- </html>
|