@@ -211,6 +211,7 @@ public String open_head(@PathVariable String request, HttpSession session) {
211211 VERIFY_ = Verify .class .getSimpleName ();
212212 }
213213
214+ public static final String VERSION = JSONRequest .KEY_VERSION ;
214215 public static final String COUNT = JSONResponse .KEY_COUNT ;
215216 public static final String TOTAL = JSONResponse .KEY_TOTAL ;
216217
@@ -232,6 +233,7 @@ public String open_head(@PathVariable String request, HttpSession session) {
232233 public static final String TYPE = "type" ;
233234 public static final String WAY = "way" ;
234235 public static final String CONTENT = "content" ;
236+
235237
236238
237239
@@ -400,9 +402,10 @@ private JSONObject newVerifyRequest(int type, String phone, String verify) {
400402 * @see
401403 * <pre>
402404 {
403- "type": 0,
405+ "type": 0, //登录方式,非必须 0-密码 2-验证码
404406 "phone": "13000082001",
405- "password": "1234567"
407+ "password": "1234567",
408+ "version": 1 //全局版本号,非必须
406409 }
407410 * </pre>
408411 */
@@ -412,6 +415,7 @@ public JSONObject login(@RequestBody String request, HttpSession session) {
412415 boolean isPassword ;
413416 String phone ;
414417 String password ;
418+ int version ;
415419 try {
416420 requestObject = Parser .parseRequest (request , POST );
417421
@@ -432,6 +436,8 @@ public JSONObject login(@RequestBody String request, HttpSession session) {
432436 throw new IllegalArgumentException ("验证码不合法!" );
433437 }
434438 }
439+
440+ version = requestObject .getIntValue (VERSION );
435441 } catch (Exception e ) {
436442 return Parser .extendErrorResult (requestObject , e );
437443 }
@@ -499,6 +505,7 @@ public JSONObject login(@RequestBody String request, HttpSession session) {
499505 session .setAttribute (TYPE , isPassword ? LOGIN_TYPE_PASSWORD : LOGIN_TYPE_VERIFY );//登录方式
500506 session .setAttribute (USER_ , user );//用户
501507 session .setAttribute (PRIVACY_ , privacy );//用户隐私信息
508+ session .setAttribute (VERSION , version );//用户隐私信息
502509 // session.setMaxInactiveInterval(1*60);//设置session过期时间
503510
504511 return response ;
0 commit comments