@authing/react-ui-components 3.1.37-beta.0 → 3.1.37-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts
CHANGED
|
@@ -1575,6 +1575,293 @@ declare module '@authing/react-ui-components/components/Guard/config' {
|
|
|
1575
1575
|
}
|
|
1576
1576
|
export const getDefaultGuardLocalConfig: () => GuardLocalConfig;
|
|
1577
1577
|
|
|
1578
|
+
}
|
|
1579
|
+
declare module '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts' {
|
|
1580
|
+
import { SelectOptions } from '@authing/react-ui-components/components/Login/multipleAccounts/panel';
|
|
1581
|
+
export const QR_CODE_WAY: LoginWay[];
|
|
1582
|
+
/**
|
|
1583
|
+
* 登录时所有支持的登录列表(前端定义列表)
|
|
1584
|
+
*/
|
|
1585
|
+
export type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap';
|
|
1586
|
+
/**
|
|
1587
|
+
* when: 多账号页面跳转进入登录页面
|
|
1588
|
+
* 携带的回填数据信息
|
|
1589
|
+
*/
|
|
1590
|
+
export interface BackFillMultipleState extends Omit<User, 'id' | 'name' | 'nickname' | 'username' | 'phone' | 'email' | 'photo' | '_updateTime'> {
|
|
1591
|
+
/**
|
|
1592
|
+
* 回填的账号名称 邮箱/用户名/手机
|
|
1593
|
+
*/
|
|
1594
|
+
account: string;
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Store instance
|
|
1598
|
+
*/
|
|
1599
|
+
export type StoreInstance = ReturnType<MultipleAccount['getStore']>;
|
|
1600
|
+
/**
|
|
1601
|
+
* 当前 userId 对应的类型
|
|
1602
|
+
*/
|
|
1603
|
+
export interface CurrentStore {
|
|
1604
|
+
[id: string]: User;
|
|
1605
|
+
}
|
|
1606
|
+
export interface User {
|
|
1607
|
+
/**
|
|
1608
|
+
* userId
|
|
1609
|
+
*/
|
|
1610
|
+
id: string;
|
|
1611
|
+
/**
|
|
1612
|
+
* Tab 栏状态
|
|
1613
|
+
*/
|
|
1614
|
+
tab: 'input' | 'qrcode';
|
|
1615
|
+
/**
|
|
1616
|
+
* 登录方式
|
|
1617
|
+
*/
|
|
1618
|
+
way: LoginWay;
|
|
1619
|
+
/**
|
|
1620
|
+
* 姓名
|
|
1621
|
+
*/
|
|
1622
|
+
name?: string | null;
|
|
1623
|
+
/**
|
|
1624
|
+
* 昵称
|
|
1625
|
+
*/
|
|
1626
|
+
nickname?: string | null;
|
|
1627
|
+
/**
|
|
1628
|
+
* 用户名
|
|
1629
|
+
*/
|
|
1630
|
+
username?: string | null;
|
|
1631
|
+
/**
|
|
1632
|
+
* 手机号
|
|
1633
|
+
*/
|
|
1634
|
+
phone?: string | null;
|
|
1635
|
+
/**
|
|
1636
|
+
* 邮箱
|
|
1637
|
+
*/
|
|
1638
|
+
email?: string | null;
|
|
1639
|
+
/**
|
|
1640
|
+
* 头像
|
|
1641
|
+
*/
|
|
1642
|
+
photo?: string | null;
|
|
1643
|
+
/**
|
|
1644
|
+
* qrCodeId 对应的ID
|
|
1645
|
+
*/
|
|
1646
|
+
qrCodeId?: string;
|
|
1647
|
+
/**
|
|
1648
|
+
* 国际化短信区号
|
|
1649
|
+
*/
|
|
1650
|
+
phoneCountryCode?: string;
|
|
1651
|
+
/**
|
|
1652
|
+
* 国际化短信选择框回填
|
|
1653
|
+
*/
|
|
1654
|
+
areaCode?: string;
|
|
1655
|
+
/**
|
|
1656
|
+
* 登录时间
|
|
1657
|
+
*/
|
|
1658
|
+
_updateTime?: string;
|
|
1659
|
+
}
|
|
1660
|
+
class MultipleAccount {
|
|
1661
|
+
/**
|
|
1662
|
+
* 原始的 localStore 值
|
|
1663
|
+
*/
|
|
1664
|
+
private originStore;
|
|
1665
|
+
/**
|
|
1666
|
+
* 当前 AppId Store
|
|
1667
|
+
*/
|
|
1668
|
+
private currentStore;
|
|
1669
|
+
/**
|
|
1670
|
+
* 单账号直接回填
|
|
1671
|
+
*/
|
|
1672
|
+
private firstBackFillData?;
|
|
1673
|
+
/**
|
|
1674
|
+
* server 返回支持的登录方式
|
|
1675
|
+
*/
|
|
1676
|
+
private serverSideLoginMethods;
|
|
1677
|
+
/**
|
|
1678
|
+
* 是否显示多账号登录页面
|
|
1679
|
+
* true 存在
|
|
1680
|
+
*/
|
|
1681
|
+
private memberState;
|
|
1682
|
+
/**
|
|
1683
|
+
* 二维码登录时的ID
|
|
1684
|
+
*/
|
|
1685
|
+
private qrCodeId?;
|
|
1686
|
+
/**
|
|
1687
|
+
* 国际化短信前缀 区号
|
|
1688
|
+
*/
|
|
1689
|
+
private phoneCountryCode?;
|
|
1690
|
+
/**
|
|
1691
|
+
* 国际化短信前缀 选中地区编号
|
|
1692
|
+
*/
|
|
1693
|
+
private areaCode?;
|
|
1694
|
+
private tabStatus?;
|
|
1695
|
+
/**
|
|
1696
|
+
* 当前登录二级状态
|
|
1697
|
+
*/
|
|
1698
|
+
private loginWay?;
|
|
1699
|
+
private appId;
|
|
1700
|
+
/**
|
|
1701
|
+
* 是否开启国际化短信
|
|
1702
|
+
*/
|
|
1703
|
+
private isInternationSms?;
|
|
1704
|
+
constructor();
|
|
1705
|
+
/**
|
|
1706
|
+
* 页面首次加载时初始化 Store
|
|
1707
|
+
* 从 LocalStore 中拿值 放到这里来
|
|
1708
|
+
*/
|
|
1709
|
+
private initStore;
|
|
1710
|
+
/**
|
|
1711
|
+
* 初始化记住账号相关信息
|
|
1712
|
+
* @param normalCount
|
|
1713
|
+
* @returns
|
|
1714
|
+
*/
|
|
1715
|
+
private initMemberState;
|
|
1716
|
+
/**
|
|
1717
|
+
* 获取当前ID下有效账号个数
|
|
1718
|
+
* @returns qrCount 有效的二维码登录个数 normalCount 有效的账号登录方式
|
|
1719
|
+
*/
|
|
1720
|
+
private memberStateCount;
|
|
1721
|
+
/**
|
|
1722
|
+
* 初始化第一次的数据 TODO: 逻辑有点脏 待整理
|
|
1723
|
+
*/
|
|
1724
|
+
private initBackfillData;
|
|
1725
|
+
/**
|
|
1726
|
+
* 根据前端存储的登录方式返回后端映射方式
|
|
1727
|
+
* @param front
|
|
1728
|
+
*/
|
|
1729
|
+
private getServerLoginMethodByFront;
|
|
1730
|
+
/**
|
|
1731
|
+
* 当前 Store DONE
|
|
1732
|
+
*/
|
|
1733
|
+
private getCurrentStore;
|
|
1734
|
+
/**
|
|
1735
|
+
* 国际化短信过滤
|
|
1736
|
+
* true 表示通过 需要保留
|
|
1737
|
+
* false 表示不通过 需要过滤
|
|
1738
|
+
*/
|
|
1739
|
+
private validateInternationSms;
|
|
1740
|
+
/**
|
|
1741
|
+
* 校验有效的登录方式账号
|
|
1742
|
+
* @param user
|
|
1743
|
+
* @param serverSideLoginMethods
|
|
1744
|
+
* @returns
|
|
1745
|
+
*/
|
|
1746
|
+
private validateMethod;
|
|
1747
|
+
/**
|
|
1748
|
+
*
|
|
1749
|
+
* @param tab 一级Tab状态
|
|
1750
|
+
* @param way 二级Tab状态
|
|
1751
|
+
* @param id 二维码登录时 记录对应的二维码 ID
|
|
1752
|
+
*/
|
|
1753
|
+
private setLoginWay;
|
|
1754
|
+
/**
|
|
1755
|
+
* 设置/更新 store 内的用户信息
|
|
1756
|
+
*/
|
|
1757
|
+
private setUserInfo;
|
|
1758
|
+
/**
|
|
1759
|
+
* 持久化保存
|
|
1760
|
+
*/
|
|
1761
|
+
private saveStore;
|
|
1762
|
+
/**
|
|
1763
|
+
* 根据登录的 account 判断本次登录的方式
|
|
1764
|
+
* @param account 登录输入的账号
|
|
1765
|
+
* @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
|
|
1766
|
+
* @returns
|
|
1767
|
+
*/
|
|
1768
|
+
private setLoginWayByHttpData;
|
|
1769
|
+
/**
|
|
1770
|
+
* 根据用户 ID 删除 localStorage 中当前用户 ID
|
|
1771
|
+
*/
|
|
1772
|
+
private delUserById;
|
|
1773
|
+
/**
|
|
1774
|
+
* 获得多账号登录页面的所有用户列表
|
|
1775
|
+
* @param excludeWays
|
|
1776
|
+
*/
|
|
1777
|
+
private getMemoUser;
|
|
1778
|
+
/**
|
|
1779
|
+
* 根据 id 获得当前已登录的用户信息
|
|
1780
|
+
* @param userId
|
|
1781
|
+
* @returns User / undefined
|
|
1782
|
+
*/
|
|
1783
|
+
private getMemoSingleUser;
|
|
1784
|
+
/**
|
|
1785
|
+
* 该方法仅仅需要回填账号的登录方式,其他都不计入
|
|
1786
|
+
* 当用户名/手机号/邮箱/AD/LDAP 相同时,根据登录顺序匹配不同的账号
|
|
1787
|
+
* 根据记住的用户登录方式获取对应的登录账户名
|
|
1788
|
+
* @param way
|
|
1789
|
+
* @param user
|
|
1790
|
+
* @returns
|
|
1791
|
+
*/
|
|
1792
|
+
private getAccountByWay;
|
|
1793
|
+
private _mappingUser;
|
|
1794
|
+
/**
|
|
1795
|
+
* 外部暴露方法
|
|
1796
|
+
*/
|
|
1797
|
+
getStore: () => {
|
|
1798
|
+
initStore: (appId: string, options: {
|
|
1799
|
+
serverSideLoginMethods: LoginWay[];
|
|
1800
|
+
isInternationSms: boolean;
|
|
1801
|
+
}) => void;
|
|
1802
|
+
setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
|
|
1803
|
+
phoneCountryCode: string;
|
|
1804
|
+
areaCode: string;
|
|
1805
|
+
} | undefined) => void;
|
|
1806
|
+
setUserInfo: (user: Pick<User & {
|
|
1807
|
+
id: string;
|
|
1808
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1809
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
1810
|
+
username?: string | undefined;
|
|
1811
|
+
phone?: string | undefined;
|
|
1812
|
+
email?: string | undefined;
|
|
1813
|
+
}) => void;
|
|
1814
|
+
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
1815
|
+
getMemoSingleUser: (id: string) => {
|
|
1816
|
+
way: LoginWay;
|
|
1817
|
+
account: string;
|
|
1818
|
+
} | undefined;
|
|
1819
|
+
delUserById: (id: string) => string;
|
|
1820
|
+
getMemberState: () => boolean;
|
|
1821
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* MultipleAccounts 相关 Hook
|
|
1826
|
+
* Finally Config 类型过滤
|
|
1827
|
+
*/
|
|
1828
|
+
const useMultipleAccounts: ({ appId, finallyConfig }: {
|
|
1829
|
+
appId?: string | undefined;
|
|
1830
|
+
finallyConfig?: any;
|
|
1831
|
+
}) => {
|
|
1832
|
+
instance: {
|
|
1833
|
+
initStore: (appId: string, options: {
|
|
1834
|
+
serverSideLoginMethods: LoginWay[];
|
|
1835
|
+
isInternationSms: boolean;
|
|
1836
|
+
}) => void;
|
|
1837
|
+
setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
|
|
1838
|
+
phoneCountryCode: string;
|
|
1839
|
+
areaCode: string;
|
|
1840
|
+
} | undefined) => void;
|
|
1841
|
+
setUserInfo: (user: Pick<User & {
|
|
1842
|
+
id: string;
|
|
1843
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1844
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
1845
|
+
username?: string | undefined;
|
|
1846
|
+
phone?: string | undefined;
|
|
1847
|
+
email?: string | undefined;
|
|
1848
|
+
}) => void;
|
|
1849
|
+
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
1850
|
+
getMemoSingleUser: (id: string) => {
|
|
1851
|
+
way: LoginWay;
|
|
1852
|
+
account: string;
|
|
1853
|
+
} | undefined;
|
|
1854
|
+
delUserById: (id: string) => string;
|
|
1855
|
+
getMemberState: () => boolean;
|
|
1856
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
1857
|
+
} | undefined;
|
|
1858
|
+
isMultipleAccount: boolean;
|
|
1859
|
+
referMultipleState: (type: 'login' | 'multiple', data?: BackFillMultipleState | undefined) => void;
|
|
1860
|
+
multipleAccountData: BackFillMultipleState | undefined;
|
|
1861
|
+
clearBackFillData: () => void;
|
|
1862
|
+
};
|
|
1863
|
+
export default useMultipleAccounts;
|
|
1864
|
+
|
|
1578
1865
|
}
|
|
1579
1866
|
declare module '@authing/react-ui-components/components/Guard/core/index' {
|
|
1580
1867
|
/// <reference types="react" />
|
|
@@ -1634,7 +1921,32 @@ declare module '@authing/react-ui-components/components/Guard/event' {
|
|
|
1634
1921
|
export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
|
|
1635
1922
|
onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
|
|
1636
1923
|
}
|
|
1637
|
-
export const guardEventsFilter: (props: any,
|
|
1924
|
+
export const guardEventsFilter: (props: any, multipleInstance?: {
|
|
1925
|
+
initStore: (appId: string, options: {
|
|
1926
|
+
serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
1927
|
+
isInternationSms: boolean;
|
|
1928
|
+
}) => void;
|
|
1929
|
+
setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
1930
|
+
phoneCountryCode: string;
|
|
1931
|
+
areaCode: string;
|
|
1932
|
+
} | undefined) => void;
|
|
1933
|
+
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
1934
|
+
id: string;
|
|
1935
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1936
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
1937
|
+
username?: string | undefined;
|
|
1938
|
+
phone?: string | undefined;
|
|
1939
|
+
email?: string | undefined;
|
|
1940
|
+
}) => void;
|
|
1941
|
+
getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
1942
|
+
getMemoSingleUser: (id: string) => {
|
|
1943
|
+
way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
1944
|
+
account: string;
|
|
1945
|
+
} | undefined;
|
|
1946
|
+
delUserById: (id: string) => string;
|
|
1947
|
+
getMemberState: () => boolean;
|
|
1948
|
+
getFirstBackFillData: () => import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").BackFillMultipleState | undefined;
|
|
1949
|
+
} | undefined, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1638
1950
|
export const guardEventsHijacking: (events: GuardEvents, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1639
1951
|
export const GuardEventsCamelToKebabMapping: {
|
|
1640
1952
|
readonly onLoad: "load";
|
|
@@ -1926,6 +2238,7 @@ declare module '@authing/react-ui-components/components/Login/codemap' {
|
|
|
1926
2238
|
declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
1927
2239
|
/// <reference types="react" />
|
|
1928
2240
|
import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2241
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
1929
2242
|
interface LoginWithADProps {
|
|
1930
2243
|
publicKey: string;
|
|
1931
2244
|
autoRegister?: boolean;
|
|
@@ -1933,6 +2246,14 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
|
1933
2246
|
onLoginFailed: any;
|
|
1934
2247
|
onBeforeLogin: any;
|
|
1935
2248
|
agreements: Agreement[];
|
|
2249
|
+
/**
|
|
2250
|
+
* 回填的数据
|
|
2251
|
+
*/
|
|
2252
|
+
backfillData?: BackFillMultipleState;
|
|
2253
|
+
/**
|
|
2254
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2255
|
+
*/
|
|
2256
|
+
multipleInstance?: StoreInstance;
|
|
1936
2257
|
}
|
|
1937
2258
|
export const LoginWithAD: (props: LoginWithADProps) => JSX.Element;
|
|
1938
2259
|
export {};
|
|
@@ -1940,17 +2261,21 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
|
1940
2261
|
}
|
|
1941
2262
|
declare module '@authing/react-ui-components/components/Login/core/withAppQrcode' {
|
|
1942
2263
|
/// <reference types="react" />
|
|
2264
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
1943
2265
|
interface LoginWithAppQrcodeProps {
|
|
1944
2266
|
onLoginSuccess: any;
|
|
1945
2267
|
canLoop: boolean;
|
|
2268
|
+
qrCodeScanOptions: any;
|
|
2269
|
+
multipleInstance?: StoreInstance;
|
|
1946
2270
|
}
|
|
1947
|
-
export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element
|
|
2271
|
+
export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element;
|
|
1948
2272
|
export {};
|
|
1949
2273
|
|
|
1950
2274
|
}
|
|
1951
2275
|
declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
|
|
1952
2276
|
/// <reference types="react" />
|
|
1953
2277
|
import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2278
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
1954
2279
|
interface LoginWithLDAPProps {
|
|
1955
2280
|
publicKey: string;
|
|
1956
2281
|
autoRegister?: boolean;
|
|
@@ -1959,6 +2284,14 @@ declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
|
|
|
1959
2284
|
onLoginFailed: any;
|
|
1960
2285
|
onBeforeLogin: any;
|
|
1961
2286
|
agreements: Agreement[];
|
|
2287
|
+
/**
|
|
2288
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2289
|
+
*/
|
|
2290
|
+
multipleInstance?: StoreInstance;
|
|
2291
|
+
/**
|
|
2292
|
+
* 多账号回填的数据
|
|
2293
|
+
*/
|
|
2294
|
+
backfillData?: BackFillMultipleState;
|
|
1962
2295
|
}
|
|
1963
2296
|
export const LoginWithLDAP: (props: LoginWithLDAPProps) => JSX.Element;
|
|
1964
2297
|
export {};
|
|
@@ -1999,6 +2332,7 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
|
|
|
1999
2332
|
import { Agreement, PasswordLoginMethods } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2000
2333
|
import { LoginMethods } from '@authing/react-ui-components/components/index';
|
|
2001
2334
|
import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
|
|
2335
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2002
2336
|
interface LoginWithPasswordProps {
|
|
2003
2337
|
publicKey: string;
|
|
2004
2338
|
autoRegister?: boolean;
|
|
@@ -2012,6 +2346,14 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
|
|
|
2012
2346
|
loginWay?: LoginMethods;
|
|
2013
2347
|
submitButText?: string;
|
|
2014
2348
|
saveIdentify?: (type: LoginMethods, identity: string) => void;
|
|
2349
|
+
/**
|
|
2350
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2351
|
+
*/
|
|
2352
|
+
multipleInstance?: StoreInstance;
|
|
2353
|
+
/**
|
|
2354
|
+
* 多账号回填的数据
|
|
2355
|
+
*/
|
|
2356
|
+
backfillData?: BackFillMultipleState;
|
|
2015
2357
|
}
|
|
2016
2358
|
export const LoginWithPassword: (props: LoginWithPasswordProps) => JSX.Element;
|
|
2017
2359
|
export {};
|
|
@@ -2045,6 +2387,10 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2045
2387
|
import React, { FC } from 'react';
|
|
2046
2388
|
import './styles.less';
|
|
2047
2389
|
export interface VirtualDropdownProps {
|
|
2390
|
+
/**
|
|
2391
|
+
* 回填的国际化区号
|
|
2392
|
+
*/
|
|
2393
|
+
regionCode?: string;
|
|
2048
2394
|
value?: string;
|
|
2049
2395
|
onChange?: (value: string) => void;
|
|
2050
2396
|
style?: React.CSSProperties;
|
|
@@ -2055,7 +2401,8 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2055
2401
|
declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/index' {
|
|
2056
2402
|
/// <reference types="react" />
|
|
2057
2403
|
import './styles.less';
|
|
2058
|
-
|
|
2404
|
+
const LoginWithVerifyCode: (props: any) => JSX.Element;
|
|
2405
|
+
export { LoginWithVerifyCode };
|
|
2059
2406
|
|
|
2060
2407
|
}
|
|
2061
2408
|
declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/inputIdentify' {
|
|
@@ -2070,23 +2417,92 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2070
2417
|
}
|
|
2071
2418
|
declare module '@authing/react-ui-components/components/Login/core/withWechatMiniQrcode' {
|
|
2072
2419
|
/// <reference types="react" />
|
|
2420
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2073
2421
|
interface LoginWithWechatMiniQrcodeProps {
|
|
2074
2422
|
onLoginSuccess: any;
|
|
2075
2423
|
canLoop: boolean;
|
|
2424
|
+
qrCodeScanOptions: any;
|
|
2425
|
+
id: string;
|
|
2426
|
+
multipleInstance?: StoreInstance;
|
|
2076
2427
|
}
|
|
2077
|
-
export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element
|
|
2428
|
+
export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element;
|
|
2078
2429
|
export {};
|
|
2079
2430
|
|
|
2080
2431
|
}
|
|
2081
2432
|
declare module '@authing/react-ui-components/components/Login/core/withWechatmpQrcode' {
|
|
2082
2433
|
/// <reference types="react" />
|
|
2434
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2083
2435
|
interface LoginWithWechatmpQrcodeProps {
|
|
2084
2436
|
onLoginSuccess: any;
|
|
2085
2437
|
canLoop: boolean;
|
|
2438
|
+
qrCodeScanOptions: any;
|
|
2439
|
+
id: string;
|
|
2440
|
+
/**
|
|
2441
|
+
* 多账号存储实例
|
|
2442
|
+
*/
|
|
2443
|
+
multipleInstance?: StoreInstance;
|
|
2086
2444
|
}
|
|
2087
|
-
export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element
|
|
2445
|
+
export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element;
|
|
2088
2446
|
export {};
|
|
2089
2447
|
|
|
2448
|
+
}
|
|
2449
|
+
declare module '@authing/react-ui-components/components/Login/hooks/useLoginMultiple' {
|
|
2450
|
+
/// <reference types="react" />
|
|
2451
|
+
import { FormInstance } from 'antd/lib/form';
|
|
2452
|
+
import { BackFillMultipleState, LoginWay } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2453
|
+
/**
|
|
2454
|
+
* 多账号登录下 账户 & 登录方式自动回填
|
|
2455
|
+
* TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
|
|
2456
|
+
* 调用地方 core 中需要回填的两个登录方式
|
|
2457
|
+
*/
|
|
2458
|
+
function useLoginMultipleBackFill(options: {
|
|
2459
|
+
form: FormInstance<any>;
|
|
2460
|
+
way: LoginWay;
|
|
2461
|
+
formKey: string;
|
|
2462
|
+
backfillData?: BackFillMultipleState;
|
|
2463
|
+
isOnlyInternationSms?: boolean;
|
|
2464
|
+
setAreaCode?: React.Dispatch<React.SetStateAction<string>>;
|
|
2465
|
+
cancelBackfill?: boolean;
|
|
2466
|
+
}): void;
|
|
2467
|
+
/**
|
|
2468
|
+
* 多账号统一状态管理
|
|
2469
|
+
* @param setLoginWay
|
|
2470
|
+
* @returns
|
|
2471
|
+
*/
|
|
2472
|
+
function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
2473
|
+
isMultipleAccount: boolean;
|
|
2474
|
+
multipleInstance: {
|
|
2475
|
+
initStore: (appId: string, options: {
|
|
2476
|
+
serverSideLoginMethods: LoginWay[];
|
|
2477
|
+
isInternationSms: boolean;
|
|
2478
|
+
}) => void;
|
|
2479
|
+
setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string | undefined, internation?: {
|
|
2480
|
+
phoneCountryCode: string;
|
|
2481
|
+
areaCode: string;
|
|
2482
|
+
} | undefined) => void;
|
|
2483
|
+
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
2484
|
+
id: string;
|
|
2485
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
2486
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
2487
|
+
username?: string | undefined;
|
|
2488
|
+
phone?: string | undefined;
|
|
2489
|
+
email?: string | undefined;
|
|
2490
|
+
}) => void;
|
|
2491
|
+
getMemoUser: (excludeWays?: LoginWay[]) => import("@authing/react-ui-components/components/Login/multipleAccounts/panel").SelectOptions[];
|
|
2492
|
+
getMemoSingleUser: (id: string) => {
|
|
2493
|
+
way: LoginWay;
|
|
2494
|
+
account: string;
|
|
2495
|
+
} | undefined;
|
|
2496
|
+
delUserById: (id: string) => string;
|
|
2497
|
+
getMemberState: () => boolean;
|
|
2498
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
2499
|
+
} | undefined;
|
|
2500
|
+
referMultipleState: ((type: "login" | "multiple") => void) | undefined;
|
|
2501
|
+
backfillData: BackFillMultipleState | undefined;
|
|
2502
|
+
defaultQrWay: string | undefined;
|
|
2503
|
+
};
|
|
2504
|
+
export { useLoginMultipleBackFill, useLoginMultiple };
|
|
2505
|
+
|
|
2090
2506
|
}
|
|
2091
2507
|
declare module '@authing/react-ui-components/components/Login/index' {
|
|
2092
2508
|
/// <reference types="react" />
|
|
@@ -2135,6 +2551,79 @@ declare module '@authing/react-ui-components/components/Login/interface' {
|
|
|
2135
2551
|
}
|
|
2136
2552
|
export const getDefaultLoginConfig: () => LoginConfig;
|
|
2137
2553
|
|
|
2554
|
+
}
|
|
2555
|
+
declare module '@authing/react-ui-components/components/Login/multipleAccounts/index' {
|
|
2556
|
+
import React from 'react';
|
|
2557
|
+
import { LoginWay, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2558
|
+
import { GuardModuleType } from '@authing/react-ui-components/components/Guard/index';
|
|
2559
|
+
interface MultipleAccountsProps {
|
|
2560
|
+
/**
|
|
2561
|
+
* 多账号存储实例
|
|
2562
|
+
*/
|
|
2563
|
+
multipleInstance?: StoreInstance;
|
|
2564
|
+
/**
|
|
2565
|
+
* 切换 Guard 方法
|
|
2566
|
+
*/
|
|
2567
|
+
changeModule?: (moduleName: GuardModuleType, initData?: any) => Promise<void>;
|
|
2568
|
+
/**
|
|
2569
|
+
* 切换多账号状态
|
|
2570
|
+
*/
|
|
2571
|
+
referMultipleState?: (type: 'login' | 'multiple', data?: {
|
|
2572
|
+
account: string;
|
|
2573
|
+
way: LoginWay;
|
|
2574
|
+
}) => void;
|
|
2575
|
+
}
|
|
2576
|
+
const MultipleAccounts: React.NamedExoticComponent<MultipleAccountsProps>;
|
|
2577
|
+
export { MultipleAccounts };
|
|
2578
|
+
|
|
2579
|
+
}
|
|
2580
|
+
declare module '@authing/react-ui-components/components/Login/multipleAccounts/panel' {
|
|
2581
|
+
import React from 'react';
|
|
2582
|
+
import './style.less';
|
|
2583
|
+
interface SelectPanelProps {
|
|
2584
|
+
lists: SelectOptions[];
|
|
2585
|
+
/**
|
|
2586
|
+
* 点击删除
|
|
2587
|
+
*/
|
|
2588
|
+
handleDel: (id: string) => void;
|
|
2589
|
+
/**
|
|
2590
|
+
* 点击 li
|
|
2591
|
+
*/
|
|
2592
|
+
onClick: (id: string) => void;
|
|
2593
|
+
}
|
|
2594
|
+
export interface SelectOptions {
|
|
2595
|
+
/**
|
|
2596
|
+
* 头像
|
|
2597
|
+
*/
|
|
2598
|
+
photo?: string;
|
|
2599
|
+
/**
|
|
2600
|
+
* 标题
|
|
2601
|
+
*/
|
|
2602
|
+
title?: string;
|
|
2603
|
+
/**
|
|
2604
|
+
* 描述
|
|
2605
|
+
*/
|
|
2606
|
+
description?: string;
|
|
2607
|
+
/**
|
|
2608
|
+
* 用户 ID 唯一标识符
|
|
2609
|
+
*/
|
|
2610
|
+
id: string | 'other';
|
|
2611
|
+
/**
|
|
2612
|
+
* 显示操作栏 default: true
|
|
2613
|
+
*/
|
|
2614
|
+
operation?: boolean;
|
|
2615
|
+
/**
|
|
2616
|
+
* 登录时间
|
|
2617
|
+
*/
|
|
2618
|
+
_updateTime: number;
|
|
2619
|
+
/**
|
|
2620
|
+
* 替代图片元素
|
|
2621
|
+
*/
|
|
2622
|
+
element?: React.ReactElement;
|
|
2623
|
+
}
|
|
2624
|
+
const SelectPanel: React.FC<SelectPanelProps>;
|
|
2625
|
+
export { SelectPanel };
|
|
2626
|
+
|
|
2138
2627
|
}
|
|
2139
2628
|
declare module '@authing/react-ui-components/components/Login/socialLogin/IdpButton/index' {
|
|
2140
2629
|
/// <reference types="react" />
|
|
@@ -2146,6 +2635,7 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
|
|
|
2146
2635
|
import { ApplicationConfig, SocialConnectionItem } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2147
2636
|
import './style.less';
|
|
2148
2637
|
import { GuardLocalConfig } from '@authing/react-ui-components/components/Guard/index';
|
|
2638
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2149
2639
|
export interface SocialLoginProps {
|
|
2150
2640
|
appId: string;
|
|
2151
2641
|
config: GuardLocalConfig;
|
|
@@ -2153,6 +2643,10 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
|
|
|
2153
2643
|
onLoginSuccess: any;
|
|
2154
2644
|
enterpriseConnectionObjs: ApplicationConfig['identityProviders'];
|
|
2155
2645
|
socialConnectionObjs: SocialConnectionItem[];
|
|
2646
|
+
/**
|
|
2647
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2648
|
+
*/
|
|
2649
|
+
multipleInstance?: StoreInstance;
|
|
2156
2650
|
}
|
|
2157
2651
|
export const SocialLogin: React.FC<SocialLoginProps>;
|
|
2158
2652
|
|
|
@@ -2429,233 +2923,6 @@ declare module '@authing/react-ui-components/components/NeedHelpView/index' {
|
|
|
2429
2923
|
/// <reference types="react" />
|
|
2430
2924
|
export const GuardNeedHelpView: (props: any) => JSX.Element;
|
|
2431
2925
|
|
|
2432
|
-
}
|
|
2433
|
-
declare module '@authing/react-ui-components/components/Qrcode/UiQrCode' {
|
|
2434
|
-
import React from 'react';
|
|
2435
|
-
import './index.less';
|
|
2436
|
-
import { CodeStatusDescriptions } from '@authing/react-ui-components/components/Qrcode/WorkQrCode';
|
|
2437
|
-
export type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
|
|
2438
|
-
export const prefix = "refactor";
|
|
2439
|
-
export interface UiQrProps {
|
|
2440
|
-
/**
|
|
2441
|
-
* Loading 组件
|
|
2442
|
-
*/
|
|
2443
|
-
loadingComponent?: React.ReactElement;
|
|
2444
|
-
/**
|
|
2445
|
-
* 二维码组件三种状态
|
|
2446
|
-
* ready 准备状态
|
|
2447
|
-
* already 已扫描状态
|
|
2448
|
-
* success 扫描成功/登录成功状态
|
|
2449
|
-
* error 错误状态(超时、网络错误)
|
|
2450
|
-
*/
|
|
2451
|
-
status: CodeStatus;
|
|
2452
|
-
/**
|
|
2453
|
-
* 二维码 URL
|
|
2454
|
-
*/
|
|
2455
|
-
src?: string;
|
|
2456
|
-
/**
|
|
2457
|
-
* 二维码底部内容
|
|
2458
|
-
*/
|
|
2459
|
-
descriptions: CodeStatusDescriptions;
|
|
2460
|
-
/**
|
|
2461
|
-
* 外层 container 样式
|
|
2462
|
-
*/
|
|
2463
|
-
containerStyle?: React.CSSProperties;
|
|
2464
|
-
/**
|
|
2465
|
-
* 内层 container 样式(图片)
|
|
2466
|
-
*/
|
|
2467
|
-
imageStyle?: React.CSSProperties;
|
|
2468
|
-
/**
|
|
2469
|
-
* 二维码图片准备好的回调
|
|
2470
|
-
*/
|
|
2471
|
-
onLoad?: () => void;
|
|
2472
|
-
/**
|
|
2473
|
-
* 点击遮罩中的内容区
|
|
2474
|
-
* status 当前组件所处状态
|
|
2475
|
-
*/
|
|
2476
|
-
onClickMaskEl?: (status: CodeStatus) => void;
|
|
2477
|
-
/**
|
|
2478
|
-
* 点击全部遮罩区域
|
|
2479
|
-
* status 当前组件所处状态
|
|
2480
|
-
*/
|
|
2481
|
-
onMaskContent?: (status: CodeStatus) => void;
|
|
2482
|
-
}
|
|
2483
|
-
const UiQrCode: React.NamedExoticComponent<UiQrProps>;
|
|
2484
|
-
export { UiQrCode };
|
|
2485
|
-
|
|
2486
|
-
}
|
|
2487
|
-
declare module '@authing/react-ui-components/components/Qrcode/WorkQrCode' {
|
|
2488
|
-
import React from 'react';
|
|
2489
|
-
import { QrCodeResponse } from '@authing/react-ui-components/components/Qrcode/hooks/usePostQrCode';
|
|
2490
|
-
import { CodeStatus, UiQrProps } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
|
|
2491
|
-
/**
|
|
2492
|
-
* 二维码不同状态下的底部描述文字
|
|
2493
|
-
*/
|
|
2494
|
-
export type CodeStatusDescriptions = Partial<Record<Exclude<CodeStatus, 'loading'>, React.ReactNode | ((referQrCode?: () => void) => React.ReactNode)>>;
|
|
2495
|
-
export interface WorkQrCodeRef {
|
|
2496
|
-
referQrCode: () => Promise<{
|
|
2497
|
-
random: string;
|
|
2498
|
-
url: string;
|
|
2499
|
-
} | undefined>;
|
|
2500
|
-
}
|
|
2501
|
-
interface WorkQrCodeProps extends Omit<UiQrProps, 'description' | 'status'> {
|
|
2502
|
-
/**
|
|
2503
|
-
* 二维码场景
|
|
2504
|
-
*/
|
|
2505
|
-
scene: 'WXAPP_AUTH' | 'APP_AUTH' | 'WECHATMP_AUTH';
|
|
2506
|
-
/**
|
|
2507
|
-
* 不同状态请求文字
|
|
2508
|
-
*/
|
|
2509
|
-
descriptions: CodeStatusDescriptions;
|
|
2510
|
-
/**
|
|
2511
|
-
* 睡眠时间 默认 1000
|
|
2512
|
-
*/
|
|
2513
|
-
sleepTime?: number;
|
|
2514
|
-
/**
|
|
2515
|
-
* 每当状态变化时,触发的 callback 。
|
|
2516
|
-
*/
|
|
2517
|
-
onStatusChange?: (status: CodeStatus, data: QrCodeResponse) => void;
|
|
2518
|
-
/**
|
|
2519
|
-
* 不同状态下点击遮罩中间区域方法
|
|
2520
|
-
*/
|
|
2521
|
-
onClickMaskContent?: (status: CodeStatus) => void;
|
|
2522
|
-
}
|
|
2523
|
-
const WorkQrCode: React.ForwardRefExoticComponent<WorkQrCodeProps & React.RefAttributes<any>>;
|
|
2524
|
-
export { WorkQrCode };
|
|
2525
|
-
|
|
2526
|
-
}
|
|
2527
|
-
declare module '@authing/react-ui-components/components/Qrcode/hooks/useImage' {
|
|
2528
|
-
const useImage: (src: string | undefined, options: {
|
|
2529
|
-
onLoad?: (() => void) | undefined;
|
|
2530
|
-
}) => (string | undefined)[];
|
|
2531
|
-
export { useImage };
|
|
2532
|
-
|
|
2533
|
-
}
|
|
2534
|
-
declare module '@authing/react-ui-components/components/Qrcode/hooks/usePostQrCode' {
|
|
2535
|
-
/// <reference types="react" />
|
|
2536
|
-
import { AuthingGuardResponse, AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
|
|
2537
|
-
import { CodeStatus } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
|
|
2538
|
-
import { CodeStatusDescriptions } from '@authing/react-ui-components/components/Qrcode/WorkQrCode';
|
|
2539
|
-
import { ReducerType, RootState } from '@authing/react-ui-components/components/Qrcode/hooks/usePreQrCode';
|
|
2540
|
-
export interface QrCodeResponse {
|
|
2541
|
-
/**
|
|
2542
|
-
* 根据状态确定不同的流程
|
|
2543
|
-
*/
|
|
2544
|
-
status: number;
|
|
2545
|
-
/**
|
|
2546
|
-
* 返回的随机值
|
|
2547
|
-
*/
|
|
2548
|
-
random: number;
|
|
2549
|
-
/**
|
|
2550
|
-
* 返回的用户信息
|
|
2551
|
-
*/
|
|
2552
|
-
userInfo?: any;
|
|
2553
|
-
/**
|
|
2554
|
-
* 扫码成功后 Tick 换取用户信息
|
|
2555
|
-
*/
|
|
2556
|
-
ticket?: string;
|
|
2557
|
-
/**
|
|
2558
|
-
* MFA 状态下的返回
|
|
2559
|
-
*/
|
|
2560
|
-
scannedResult?: AuthingResponse;
|
|
2561
|
-
}
|
|
2562
|
-
/**
|
|
2563
|
-
* 二维码请求相关
|
|
2564
|
-
*/
|
|
2565
|
-
interface QrCodeRequest {
|
|
2566
|
-
genCodeRequest?: () => Promise<AuthingGuardResponse<{
|
|
2567
|
-
random: string;
|
|
2568
|
-
url: string;
|
|
2569
|
-
}>>;
|
|
2570
|
-
/**
|
|
2571
|
-
* 未扫码下的请求方法
|
|
2572
|
-
*/
|
|
2573
|
-
readyCheckedRequest?: () => Promise<AuthingGuardResponse<QrCodeResponse>>;
|
|
2574
|
-
/**
|
|
2575
|
-
* 已经扫码下的请求方法(待确认)
|
|
2576
|
-
*/
|
|
2577
|
-
alreadyCheckedRequest?: () => Promise<AuthingGuardResponse<QrCodeResponse>>;
|
|
2578
|
-
/**
|
|
2579
|
-
* 使用 ticket 交换用户信息
|
|
2580
|
-
*/
|
|
2581
|
-
exchangeUserInfo?: (ticket: string) => Promise<any>;
|
|
2582
|
-
}
|
|
2583
|
-
interface QrCodeOptions {
|
|
2584
|
-
state: RootState;
|
|
2585
|
-
dispatch: React.Dispatch<{
|
|
2586
|
-
type: ReducerType;
|
|
2587
|
-
payload: Partial<RootState>;
|
|
2588
|
-
}>;
|
|
2589
|
-
descriptions: CodeStatusDescriptions;
|
|
2590
|
-
sleepTime?: number;
|
|
2591
|
-
/**
|
|
2592
|
-
* 状态改变时触发事件,仅在 Server 返回的二维码状态改变时进行触发
|
|
2593
|
-
*/
|
|
2594
|
-
onStatusChange?: (status: CodeStatus, data: QrCodeResponse) => void;
|
|
2595
|
-
}
|
|
2596
|
-
/**
|
|
2597
|
-
* 二维码处理阶段
|
|
2598
|
-
* 二维码处理阶段分为两个主要流程
|
|
2599
|
-
* 1. 同一状态下的轮询逻辑处理
|
|
2600
|
-
* 2. 根据不同返回状态码进行处理
|
|
2601
|
-
*/
|
|
2602
|
-
export const useQrCode: (options: QrCodeOptions, request: QrCodeRequest) => void;
|
|
2603
|
-
export {};
|
|
2604
|
-
|
|
2605
|
-
}
|
|
2606
|
-
declare module '@authing/react-ui-components/components/Qrcode/hooks/usePreQrCode' {
|
|
2607
|
-
/// <reference types="react" />
|
|
2608
|
-
import { CodeStatus } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
|
|
2609
|
-
export type ReducerType = 'change' | 'changeStatus' | 'changeDesc';
|
|
2610
|
-
export type RootState = {
|
|
2611
|
-
/**
|
|
2612
|
-
* 状态
|
|
2613
|
-
*/
|
|
2614
|
-
status: CodeStatus;
|
|
2615
|
-
/**
|
|
2616
|
-
* 底部描述
|
|
2617
|
-
*/
|
|
2618
|
-
/**
|
|
2619
|
-
* 当前二维码 URL
|
|
2620
|
-
*/
|
|
2621
|
-
src?: string;
|
|
2622
|
-
/**
|
|
2623
|
-
* 二维码随机值
|
|
2624
|
-
*/
|
|
2625
|
-
random?: string;
|
|
2626
|
-
};
|
|
2627
|
-
/**
|
|
2628
|
-
* QrCode 准备阶段 Hook
|
|
2629
|
-
*/
|
|
2630
|
-
const usePreQrCode: () => {
|
|
2631
|
-
state: RootState;
|
|
2632
|
-
dispatch: import("react").Dispatch<{
|
|
2633
|
-
type: ReducerType;
|
|
2634
|
-
payload: Partial<RootState>;
|
|
2635
|
-
}>;
|
|
2636
|
-
};
|
|
2637
|
-
export { usePreQrCode };
|
|
2638
|
-
|
|
2639
|
-
}
|
|
2640
|
-
declare module '@authing/react-ui-components/components/Qrcode/hooks/useStatus' {
|
|
2641
|
-
import { CodeStatus } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
|
|
2642
|
-
/**
|
|
2643
|
-
* 根据不同状态添加不同的元素
|
|
2644
|
-
* 维护不同状态的处理
|
|
2645
|
-
*/
|
|
2646
|
-
const useStatus: (status: CodeStatus) => ({} | null | undefined)[];
|
|
2647
|
-
export { useStatus };
|
|
2648
|
-
|
|
2649
|
-
}
|
|
2650
|
-
declare module '@authing/react-ui-components/components/Qrcode/index' {
|
|
2651
|
-
import { UiQrCode } from '@authing/react-ui-components/components/Qrcode/UiQrCode';
|
|
2652
|
-
import { WorkQrCode } from '@authing/react-ui-components/components/Qrcode/WorkQrCode';
|
|
2653
|
-
type IQrCode = typeof WorkQrCode & {
|
|
2654
|
-
UI: typeof UiQrCode;
|
|
2655
|
-
};
|
|
2656
|
-
const QrCode: IQrCode;
|
|
2657
|
-
export { QrCode };
|
|
2658
|
-
|
|
2659
2926
|
}
|
|
2660
2927
|
declare module '@authing/react-ui-components/components/RecoveryCode/businessRequest' {
|
|
2661
2928
|
export enum TotpRecoveryCodeBusinessAction {
|
|
@@ -3245,6 +3512,7 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3245
3512
|
import React from 'react';
|
|
3246
3513
|
import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '@authing/react-ui-components/components/index';
|
|
3247
3514
|
import { ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
3515
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
3248
3516
|
import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
|
|
3249
3517
|
import { GuardHttp } from '@authing/react-ui-components/components/_utils/guardHttp';
|
|
3250
3518
|
export interface IGuardContext {
|
|
@@ -3262,6 +3530,29 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3262
3530
|
isAuthFlow: boolean;
|
|
3263
3531
|
contextLoaded: boolean;
|
|
3264
3532
|
guardPageConfig: Partial<GuardPageConfig>;
|
|
3533
|
+
multipleInstance: {
|
|
3534
|
+
/**
|
|
3535
|
+
* 多账号相关
|
|
3536
|
+
*/
|
|
3537
|
+
isMultipleAccount: boolean;
|
|
3538
|
+
/**
|
|
3539
|
+
* when: 多账号页面跳转进入登录页面
|
|
3540
|
+
* 携带的回填数据信息
|
|
3541
|
+
*/
|
|
3542
|
+
multipleAccountData?: BackFillMultipleState;
|
|
3543
|
+
/**
|
|
3544
|
+
* 多账号 store 实例
|
|
3545
|
+
*/
|
|
3546
|
+
instance?: StoreInstance;
|
|
3547
|
+
/**
|
|
3548
|
+
* 切换多账号 isMultipleAccount 状态
|
|
3549
|
+
*/
|
|
3550
|
+
referMultipleState?: (type: 'login' | 'multiple') => void;
|
|
3551
|
+
/**
|
|
3552
|
+
* 清空回填数据
|
|
3553
|
+
*/
|
|
3554
|
+
clearBackFillData?: () => void;
|
|
3555
|
+
};
|
|
3265
3556
|
}
|
|
3266
3557
|
export const createGuardXContext: () => {
|
|
3267
3558
|
Provider: React.FC<{
|
|
@@ -3299,6 +3590,57 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3299
3590
|
export const useGuardContextLoaded: () => boolean;
|
|
3300
3591
|
export const useGuardIsAuthFlow: () => boolean;
|
|
3301
3592
|
export const useGuardPageConfig: () => Partial<GuardPageConfig>;
|
|
3593
|
+
/**
|
|
3594
|
+
* 多账号登录 store 实例
|
|
3595
|
+
*/
|
|
3596
|
+
export const useGuardMultipleInstance: () => {
|
|
3597
|
+
/**
|
|
3598
|
+
* 多账号相关
|
|
3599
|
+
*/
|
|
3600
|
+
isMultipleAccount: boolean;
|
|
3601
|
+
/**
|
|
3602
|
+
* when: 多账号页面跳转进入登录页面
|
|
3603
|
+
* 携带的回填数据信息
|
|
3604
|
+
*/
|
|
3605
|
+
multipleAccountData?: BackFillMultipleState | undefined;
|
|
3606
|
+
/**
|
|
3607
|
+
* 多账号 store 实例
|
|
3608
|
+
*/
|
|
3609
|
+
instance?: {
|
|
3610
|
+
initStore: (appId: string, options: {
|
|
3611
|
+
serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
3612
|
+
isInternationSms: boolean;
|
|
3613
|
+
}) => void;
|
|
3614
|
+
setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
3615
|
+
phoneCountryCode: string;
|
|
3616
|
+
areaCode: string;
|
|
3617
|
+
} | undefined) => void;
|
|
3618
|
+
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
3619
|
+
id: string;
|
|
3620
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
3621
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
3622
|
+
username?: string | undefined;
|
|
3623
|
+
phone?: string | undefined;
|
|
3624
|
+
email?: string | undefined;
|
|
3625
|
+
}) => void;
|
|
3626
|
+
getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
3627
|
+
getMemoSingleUser: (id: string) => {
|
|
3628
|
+
way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
3629
|
+
account: string;
|
|
3630
|
+
} | undefined;
|
|
3631
|
+
delUserById: (id: string) => string;
|
|
3632
|
+
getMemberState: () => boolean;
|
|
3633
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
3634
|
+
} | undefined;
|
|
3635
|
+
/**
|
|
3636
|
+
* 切换多账号 isMultipleAccount 状态
|
|
3637
|
+
*/
|
|
3638
|
+
referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
|
|
3639
|
+
/**
|
|
3640
|
+
* 清空回填数据
|
|
3641
|
+
*/
|
|
3642
|
+
clearBackFillData?: (() => void) | undefined;
|
|
3643
|
+
};
|
|
3302
3644
|
|
|
3303
3645
|
}
|
|
3304
3646
|
declare module '@authing/react-ui-components/components/_utils/corsVerification' {
|
|
@@ -3509,7 +3851,11 @@ declare module '@authing/react-ui-components/components/_utils/index' {
|
|
|
3509
3851
|
* @param ...sources
|
|
3510
3852
|
*/
|
|
3511
3853
|
export function deepMerge<T extends any = any>(target: T, ...sources: any[]): T;
|
|
3512
|
-
|
|
3854
|
+
/**
|
|
3855
|
+
* 在托管页下上传query中指定的用户自定义字段进行补全
|
|
3856
|
+
* @param params 指定上传的用户自定义字段
|
|
3857
|
+
*/
|
|
3858
|
+
export const getUserRegisterParams: (params?: string[] | undefined) => {
|
|
3513
3859
|
key: string;
|
|
3514
3860
|
value: string | string[] | qs.ParsedQs | qs.ParsedQs[] | undefined;
|
|
3515
3861
|
}[];
|
|
@@ -3763,7 +4109,7 @@ declare module '@authing/react-ui-components/components/version/index' {
|
|
|
3763
4109
|
|
|
3764
4110
|
}
|
|
3765
4111
|
declare module '@authing/react-ui-components/components/version/version' {
|
|
3766
|
-
const _default: "3.1.37-beta.
|
|
4112
|
+
const _default: "3.1.37-beta.1";
|
|
3767
4113
|
export default _default;
|
|
3768
4114
|
|
|
3769
4115
|
}
|