로그용 디바이스 아이디

This commit is contained in:
focp212@naver.com
2025-10-30 13:49:27 +09:00
parent f55c425037
commit b454bfbd69
4 changed files with 16 additions and 6 deletions

View File

@@ -55,6 +55,11 @@ export const useUserInfo = () => {
setLocalStorage(StorageKeys.Requires2FA, data.requires2FA);
setLocalStorage(StorageKeys.Usrid, data.usrid);
if(isNativeEnvironment){
setLocalStorage(StorageKeys.DeviceId, data.deviceId);
setLocalStorage(StorageKeys.AppVersion, data.appVersion);
}
useStore.getState().UserStore.setUserInfo({
...data
});

View File

@@ -26,6 +26,8 @@ export interface LoginResponse {
tempTokenExpiresIn?: number;
available2FAMethod?: Array<string>;
requires2FA?: boolean;
deviceId?: string;
appVersion: string;
};
export interface UserFavorite {

View File

@@ -11,7 +11,9 @@ export enum StorageKeys {
Requires2FA = 'REQUIRES_2FA',
BottomBannerClose = 'BOTTOM_BANNER_CLOSE',
RootStore = 'ROOT_STORE',
DeviceId = 'DEVICE_ID',
AppVersion = 'APP_VERSION',
LogOut = 'LOGOUT',
requestId = 'REQUEST_ID',
@@ -20,15 +22,14 @@ export enum StorageKeys {
HasBioHardware = 'HAS_BIO_HARDWARE',
DeviceUniqueId = 'DEVICE_UNIQUE_ID',
AppVersion = 'APP_VERSION',
AppColor = 'APP_COLOR',
RedirectPath = 'REDIRECT_PATH',
Platform = 'PLATFORM',
AppPagingSpeed = 'APP_PAGING_SPEED', // deprecated
ScannedQrCode = 'SCANNED_QR_CODE',
HasPushTokenSent = 'HAS_PUSH_TOKEN_SENT',
SetFont = 'SET_FONT',
LogOut = 'LOGOUT',
}

View File

@@ -1,4 +1,6 @@
import { UAParser } from 'ua-parser-js';
import { getLocalStorage } from '../lib';
import { StorageKeys } from './local-storage';
const { origin } = window.location;
export const CURRENT_URL = `${origin}`;
@@ -28,8 +30,8 @@ export const getHeaderUserAgent = (options?: {
let os = result.os.name;
let deviceType = result.device.type;
let deviceID = 'uuid';
let appVersion = '1.0.0';
let deviceID = getLocalStorage(StorageKeys.DeviceId);
let appVersion = getLocalStorage(StorageKeys.AppVersion);
let browserInformation = result.browser.name;
return `${os} ${deviceType} ${deviceID} ${appVersion} ${browserInformation} ${options?.menuId || ''} ${options?.apiType || ''}`;