mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-14 14:42:02 +08:00
feat: increase support for multiple time zones
This commit is contained in:
23
apps/web-naive/src/api/core/user-profile.ts
Normal file
23
apps/web-naive/src/api/core/user-profile.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { TimezoneOption } from '@vben/types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 获取系统支持的时区列表
|
||||
*/
|
||||
export async function getTimezoneOptionsApi() {
|
||||
return requestClient.get<TimezoneOption[]>('/profile/timezone');
|
||||
}
|
||||
/**
|
||||
* 获取用户时区
|
||||
*/
|
||||
export async function getUserTimezoneApi(): Promise<null | string | undefined> {
|
||||
return requestClient.get<null | string | undefined>('/user/timezone');
|
||||
}
|
||||
/**
|
||||
* 设置用户时区
|
||||
* @param timezone 时区
|
||||
*/
|
||||
export async function setUserTimezoneApi(timezone: string) {
|
||||
return requestClient.post('/user/setTimezone', { timezone });
|
||||
}
|
||||
Reference in New Issue
Block a user