로그용 디바이스 아이디
This commit is contained in:
@@ -55,6 +55,11 @@ export const useUserInfo = () => {
|
|||||||
setLocalStorage(StorageKeys.Requires2FA, data.requires2FA);
|
setLocalStorage(StorageKeys.Requires2FA, data.requires2FA);
|
||||||
setLocalStorage(StorageKeys.Usrid, data.usrid);
|
setLocalStorage(StorageKeys.Usrid, data.usrid);
|
||||||
|
|
||||||
|
if(isNativeEnvironment){
|
||||||
|
setLocalStorage(StorageKeys.DeviceId, data.deviceId);
|
||||||
|
setLocalStorage(StorageKeys.AppVersion, data.appVersion);
|
||||||
|
}
|
||||||
|
|
||||||
useStore.getState().UserStore.setUserInfo({
|
useStore.getState().UserStore.setUserInfo({
|
||||||
...data
|
...data
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export interface LoginResponse {
|
|||||||
tempTokenExpiresIn?: number;
|
tempTokenExpiresIn?: number;
|
||||||
available2FAMethod?: Array<string>;
|
available2FAMethod?: Array<string>;
|
||||||
requires2FA?: boolean;
|
requires2FA?: boolean;
|
||||||
|
deviceId?: string;
|
||||||
|
appVersion: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface UserFavorite {
|
export interface UserFavorite {
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ export enum StorageKeys {
|
|||||||
Requires2FA = 'REQUIRES_2FA',
|
Requires2FA = 'REQUIRES_2FA',
|
||||||
BottomBannerClose = 'BOTTOM_BANNER_CLOSE',
|
BottomBannerClose = 'BOTTOM_BANNER_CLOSE',
|
||||||
RootStore = 'ROOT_STORE',
|
RootStore = 'ROOT_STORE',
|
||||||
|
DeviceId = 'DEVICE_ID',
|
||||||
|
AppVersion = 'APP_VERSION',
|
||||||
|
LogOut = 'LOGOUT',
|
||||||
|
|
||||||
requestId = 'REQUEST_ID',
|
requestId = 'REQUEST_ID',
|
||||||
|
|
||||||
@@ -20,15 +22,14 @@ export enum StorageKeys {
|
|||||||
|
|
||||||
HasBioHardware = 'HAS_BIO_HARDWARE',
|
HasBioHardware = 'HAS_BIO_HARDWARE',
|
||||||
DeviceUniqueId = 'DEVICE_UNIQUE_ID',
|
DeviceUniqueId = 'DEVICE_UNIQUE_ID',
|
||||||
AppVersion = 'APP_VERSION',
|
|
||||||
AppColor = 'APP_COLOR',
|
AppColor = 'APP_COLOR',
|
||||||
RedirectPath = 'REDIRECT_PATH',
|
RedirectPath = 'REDIRECT_PATH',
|
||||||
Platform = 'PLATFORM',
|
Platform = 'PLATFORM',
|
||||||
AppPagingSpeed = 'APP_PAGING_SPEED', // deprecated
|
|
||||||
ScannedQrCode = 'SCANNED_QR_CODE',
|
ScannedQrCode = 'SCANNED_QR_CODE',
|
||||||
HasPushTokenSent = 'HAS_PUSH_TOKEN_SENT',
|
HasPushTokenSent = 'HAS_PUSH_TOKEN_SENT',
|
||||||
SetFont = 'SET_FONT',
|
SetFont = 'SET_FONT',
|
||||||
|
|
||||||
LogOut = 'LOGOUT',
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { UAParser } from 'ua-parser-js';
|
import { UAParser } from 'ua-parser-js';
|
||||||
|
import { getLocalStorage } from '../lib';
|
||||||
|
import { StorageKeys } from './local-storage';
|
||||||
|
|
||||||
const { origin } = window.location;
|
const { origin } = window.location;
|
||||||
export const CURRENT_URL = `${origin}`;
|
export const CURRENT_URL = `${origin}`;
|
||||||
@@ -28,8 +30,8 @@ export const getHeaderUserAgent = (options?: {
|
|||||||
|
|
||||||
let os = result.os.name;
|
let os = result.os.name;
|
||||||
let deviceType = result.device.type;
|
let deviceType = result.device.type;
|
||||||
let deviceID = 'uuid';
|
let deviceID = getLocalStorage(StorageKeys.DeviceId);
|
||||||
let appVersion = '1.0.0';
|
let appVersion = getLocalStorage(StorageKeys.AppVersion);
|
||||||
let browserInformation = result.browser.name;
|
let browserInformation = result.browser.name;
|
||||||
|
|
||||||
return `${os} ${deviceType} ${deviceID} ${appVersion} ${browserInformation} ${options?.menuId || ''} ${options?.apiType || ''}`;
|
return `${os} ${deviceType} ${deviceID} ${appVersion} ${browserInformation} ${options?.menuId || ''} ${options?.apiType || ''}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user