重构
This commit is contained in:
@@ -17,6 +17,12 @@ api.interceptors.request.use((config) => {
|
||||
|
||||
const locale = localStorage.getItem('locale') || 'zh-CN';
|
||||
config.headers['X-Locale'] = locale;
|
||||
try {
|
||||
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
if (timeZone) config.headers['X-Time-Zone'] = timeZone;
|
||||
} catch {
|
||||
// Some WebViews may not expose a time zone; the API falls back to UTC.
|
||||
}
|
||||
|
||||
return config;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user