|
@@ -260,7 +260,9 @@ public class AuthApplicationImpl {
|
|
|
String userToken = MapTools.getMD5Str(String.valueOf(new Date().getTime()));
|
|
|
try {
|
|
|
Object token_valid_duration = userInfoList.get(0).get("token_valid_duration");
|
|
|
- myDbHelper.updateByCondition("update t_user set user_token = ?,user_status = 1,signInTime = NOW(),token_valid_time = if(" + Objects.isNull(token_valid_duration) + ",null, DATE_ADD(NOW(),INTERVAL " + (Objects.isNull(token_valid_duration) ? 0 : Integer.parseInt(token_valid_duration.toString())) + " SECOND) ) where user_id= ? ", null, userToken, userID);
|
|
|
+ myDbHelper.updateByCondition("update t_user set user_token = ?,user_status = 1,LogoutTime = null," +
|
|
|
+ "signInTime = NOW()," +
|
|
|
+ "token_valid_time = if(" + Objects.isNull(token_valid_duration) + ",null, DATE_ADD(NOW(),INTERVAL " + (Objects.isNull(token_valid_duration) ? 0 : Integer.parseInt(token_valid_duration.toString())) + " SECOND) ) where user_id= ? ", null, userToken, userID);
|
|
|
return processSuccess(new HashMap<String, Object>() {{
|
|
|
put("user_token", userToken);
|
|
|
put("user_id", userID);
|
|
@@ -274,7 +276,9 @@ public class AuthApplicationImpl {
|
|
|
public String verificationUserToken(Map<String, String> params) {
|
|
|
String user_token = params.get("user_token");
|
|
|
String user_id = params.get("user_id");
|
|
|
- if (Objects.isNull(user_token) || Objects.isNull(user_id)) return "user_token 或则 user_id为空";
|
|
|
+ if (Objects.isNull(user_token) || Objects.isNull(user_id)) {
|
|
|
+ return "user_token 或则 user_id为空";
|
|
|
+ }
|
|
|
MyDbHelper myDbHelper = ObjectMap.getordropMyDbHelper(AppConfig.REMOTE_DB_CONNECT);
|
|
|
if (Objects.nonNull(myDbHelper.getErrorMessage())) {
|
|
|
return "验证user_token获取远程数据库连接失败" + myDbHelper.getErrorMessage();
|