Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:dataease/dataease into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jinlong-T committed Mar 2, 2022
2 parents 2f0bbe7 + 0a6e552 commit 2b05361
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import javax.annotation.Resource;

@Component
@Order(value = 1)
@Order(value = 2)
public class DataSourceInitStartListener implements ApplicationListener<ApplicationReadyEvent> {
@Resource
private DatasourceService datasourceService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

@Component
@Order(value = 1)
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent> {
private final Logger logger = LoggerFactory.getLogger(ClassloaderResponsity.class);

Expand Down
13 changes: 12 additions & 1 deletion mobile/src/common/js/request/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios'
import Config from '@/settings'
import { getToken, setToken, setUserInfo } from '@/common/utils'
import { getToken, setToken, setUserInfo, parseLanguage } from '@/common/utils'
const TokenKey = Config.TokenKey
const RefreshTokenKey = Config.RefreshTokenKey
const white_list = Config.WHITE_LIST
Expand All @@ -15,6 +15,17 @@ let service = axios.create({
// request interceptor
service.interceptors.request.use(
config => {

let lang = parseLanguage() || uni.getLocale()
if (lang === 'en') {
config.headers['Accept-Language'] = 'en-US'
}else if(lang === 'zh-Hant'){
config.headers['Accept-Language'] = 'zh-TW'
}else {
config.headers['Accept-Language'] = 'zh-CN'
}


if (white_list.includes(config.url)) {
return config
}
Expand Down

0 comments on commit 2b05361

Please sign in to comment.