Commit 7f569fef by fukai

提交优化

parent f2cdc2ce
...@@ -86,7 +86,13 @@ public class LoginController { ...@@ -86,7 +86,13 @@ public class LoginController {
} }
} catch (Exception e) { } catch (Exception e) {
log.error("Login command error", e); log.error("Login command error", e);
throw new NoUiException("Login command error", e); return ResultUtil.result(ErrorCodes.ERROR, "login failed with exception", null);
}finally{
if (context != null)
{
context.getSupport().disconnect();
context.dispose();
}
} }
log.debug("Login command is finished"); log.debug("Login command is finished");
return ResultUtil.result(ErrorCodes.ERROR, "login failed", null); return ResultUtil.result(ErrorCodes.ERROR, "login failed", null);
......
...@@ -14,7 +14,7 @@ public class Cors extends HandlerInterceptorAdapter { ...@@ -14,7 +14,7 @@ public class Cors extends HandlerInterceptorAdapter {
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Max-Age", "3600");
response.addHeader("Access-Control-Allow-Headers", response.addHeader("Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"); "Origin, X-Requested-With, Content-Type, Accept, token, userId, terminalType");
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment