mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2026-03-13 09:02:05 +08:00
修复客户端切换语言时,后台服务没有切换
This commit is contained in:
@@ -105,6 +105,9 @@ export default function BaseSetting() {
|
||||
|
||||
function changeLang(e: any) {
|
||||
setLangLocalStorage(e.target.value);
|
||||
//切换语言时,需要设置cookie,用来改变后台服务的Locale
|
||||
const date = new Date('2030-12-30 12:30:00').toUTCString();
|
||||
document.cookie = `CHAT2DB.LOCALE=${e.target.value};Expires=${date}`;
|
||||
location.reload();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CopyTemplate {
|
||||
try (// 模板文件输入输出地址 读取resources下文件
|
||||
FileOutputStream outputStream = new FileOutputStream(dir + File.separator + path);
|
||||
//返回读取指定资源的输入流
|
||||
InputStream inputStream = ConfigUtils.class.getClassLoader().getResourceAsStream("template" + File.separator + path)) {
|
||||
InputStream inputStream = CopyTemplate.class.getClassLoader().getResourceAsStream("template/" + path)) {
|
||||
byte[] buffer = new byte[4096];
|
||||
int n = 0;
|
||||
while (-1 != (n = inputStream.read(buffer))) {
|
||||
|
||||
Reference in New Issue
Block a user