Commit 171b6964 authored by Quxl's avatar Quxl

xx

parent d714f253
...@@ -35,4 +35,6 @@ public interface MemberService { ...@@ -35,4 +35,6 @@ public interface MemberService {
void updateToken(Integer member_id, String token_string); void updateToken(Integer member_id, String token_string);
void updateLang(Integer id, String string);
} }
...@@ -109,4 +109,9 @@ public class MemberServiceImpl implements MemberService { ...@@ -109,4 +109,9 @@ public class MemberServiceImpl implements MemberService {
jdbcTemplate.executeUpdate(sql, token_string, member_id); jdbcTemplate.executeUpdate(sql, token_string, member_id);
} }
@Override
public void updateLang(Integer id, String lang) {
jdbcTemplate.executeUpdate("update fc_member set lang = ? where id = ?", lang, id);
}
} }
...@@ -19,10 +19,12 @@ import com.egolm.common.bean.Rjx; ...@@ -19,10 +19,12 @@ import com.egolm.common.bean.Rjx;
import com.egolm.common.web.ServletUtil; import com.egolm.common.web.ServletUtil;
import com.egolm.film.api.service.EmailService; import com.egolm.film.api.service.EmailService;
import com.egolm.film.api.service.MemberService; import com.egolm.film.api.service.MemberService;
import com.egolm.film.api.service.MemberTokenService;
import com.egolm.film.api.service.Messages; import com.egolm.film.api.service.Messages;
import com.egolm.film.bean.Fc_member; import com.egolm.film.bean.Fc_member;
import com.egolm.film.config.XException; import com.egolm.film.config.XException;
import com.egolm.film.config.interceptor.LocaleInterceptor; import com.egolm.film.config.interceptor.LocaleInterceptor;
import com.egolm.film.model.LoginToken;
import com.egolm.film.util.Common; import com.egolm.film.util.Common;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -44,6 +46,9 @@ public class OpenMemberApiController { ...@@ -44,6 +46,9 @@ public class OpenMemberApiController {
@Autowired @Autowired
private MemberService memberService; private MemberService memberService;
@Autowired
private MemberTokenService memberTokenService;
@ResponseBody @ResponseBody
@PostMapping("register") @PostMapping("register")
@ApiOperation("会员注册") @ApiOperation("会员注册")
...@@ -132,6 +137,12 @@ public class OpenMemberApiController { ...@@ -132,6 +137,12 @@ public class OpenMemberApiController {
cookie.setMaxAge(3600000); cookie.setMaxAge(3600000);
cookie.setPath("/"); cookie.setPath("/");
response.addCookie(cookie); response.addCookie(cookie);
LoginToken token = memberTokenService.getToken();
if(token != null) {
memberService.updateLang((Integer)token.getId(), i18n_language.split("_")[0]);
}
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
......
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