Commit b7277067 authored by Quxl's avatar Quxl

xxx

parent 459e0dbe
......@@ -13,6 +13,8 @@ import com.egolm.film.config.XException;
import com.egolm.film.model.LoginToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@Api
......@@ -29,6 +31,9 @@ public class MemberLoginController {
@ResponseBody
@PostMapping("login")
@ApiOperation("登陆")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", dataType="string", name="i18n_language")
})
public Object login(String username, String password) {
XException.assertNotBlank(messages.get("err.user_pwd_null"), username, password);
if(tokenService.isLogin()) {
......
......@@ -30,9 +30,9 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
public String getParameterValue(HttpServletRequest request, String name) {
String value = request.getParameter(name);
String value = request.getHeader(name);
if(StringUtil.isBlank(value)) {
value = request.getHeader(name);
value = request.getParameter(name);
}
if(StringUtil.isBlank(value)) {
Cookie[] cookies = request.getCookies();
......@@ -46,4 +46,9 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
}
return value;
}
public static void main(String[] args) {
System.out.println("i18n_language".equals(language));
System.out.println("en_US".matches("[a-z]{2}_[A-Z]{2}"));
}
}
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