@authing/react-ui-components 3.1.36 → 3.1.37-beta.2
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 +580 -3
- package/lib/index.min.css +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +9 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1575,6 +1575,299 @@ 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
|
+
* 原始的登录账号
|
|
1663
|
+
*/
|
|
1664
|
+
private originAccount;
|
|
1665
|
+
/**
|
|
1666
|
+
* 原始的 localStore 值
|
|
1667
|
+
*/
|
|
1668
|
+
private originStore;
|
|
1669
|
+
/**
|
|
1670
|
+
* 当前 AppId Store
|
|
1671
|
+
*/
|
|
1672
|
+
private currentStore;
|
|
1673
|
+
/**
|
|
1674
|
+
* 单账号直接回填
|
|
1675
|
+
*/
|
|
1676
|
+
private firstBackFillData?;
|
|
1677
|
+
/**
|
|
1678
|
+
* server 返回支持的登录方式
|
|
1679
|
+
*/
|
|
1680
|
+
private serverSideLoginMethods;
|
|
1681
|
+
/**
|
|
1682
|
+
* 是否显示多账号登录页面
|
|
1683
|
+
* true 存在
|
|
1684
|
+
*/
|
|
1685
|
+
private memberState;
|
|
1686
|
+
/**
|
|
1687
|
+
* 二维码登录时的ID
|
|
1688
|
+
*/
|
|
1689
|
+
private qrCodeId?;
|
|
1690
|
+
/**
|
|
1691
|
+
* 国际化短信前缀 区号
|
|
1692
|
+
*/
|
|
1693
|
+
private phoneCountryCode?;
|
|
1694
|
+
/**
|
|
1695
|
+
* 国际化短信前缀 选中地区编号
|
|
1696
|
+
*/
|
|
1697
|
+
private areaCode?;
|
|
1698
|
+
private tabStatus?;
|
|
1699
|
+
/**
|
|
1700
|
+
* 当前登录二级状态
|
|
1701
|
+
*/
|
|
1702
|
+
private loginWay?;
|
|
1703
|
+
private appId;
|
|
1704
|
+
/**
|
|
1705
|
+
* 是否开启国际化短信
|
|
1706
|
+
*/
|
|
1707
|
+
private isInternationSms?;
|
|
1708
|
+
constructor();
|
|
1709
|
+
/**
|
|
1710
|
+
* 页面首次加载时初始化 Store
|
|
1711
|
+
* 从 LocalStore 中拿值 放到这里来
|
|
1712
|
+
*/
|
|
1713
|
+
private initStore;
|
|
1714
|
+
/**
|
|
1715
|
+
* 初始化记住账号相关信息
|
|
1716
|
+
* @param normalCount
|
|
1717
|
+
* @returns
|
|
1718
|
+
*/
|
|
1719
|
+
private initMemberState;
|
|
1720
|
+
/**
|
|
1721
|
+
* 获取当前ID下有效账号个数
|
|
1722
|
+
* @returns qrCount 有效的二维码登录个数 normalCount 有效的账号登录方式
|
|
1723
|
+
*/
|
|
1724
|
+
private memberStateCount;
|
|
1725
|
+
/**
|
|
1726
|
+
* 初始化第一次的数据 TODO: 逻辑有点脏 待整理
|
|
1727
|
+
*/
|
|
1728
|
+
private initBackfillData;
|
|
1729
|
+
/**
|
|
1730
|
+
* 根据前端存储的登录方式返回后端映射方式
|
|
1731
|
+
* @param front
|
|
1732
|
+
*/
|
|
1733
|
+
private getServerLoginMethodByFront;
|
|
1734
|
+
/**
|
|
1735
|
+
* 当前 Store DONE
|
|
1736
|
+
*/
|
|
1737
|
+
private getCurrentStore;
|
|
1738
|
+
/**
|
|
1739
|
+
* 国际化短信过滤
|
|
1740
|
+
* true 表示通过 需要保留
|
|
1741
|
+
* false 表示不通过 需要过滤
|
|
1742
|
+
*/
|
|
1743
|
+
private validateInternationSms;
|
|
1744
|
+
/**
|
|
1745
|
+
* 校验有效的登录方式账号
|
|
1746
|
+
* @param user
|
|
1747
|
+
* @param serverSideLoginMethods
|
|
1748
|
+
* @returns
|
|
1749
|
+
*/
|
|
1750
|
+
private validateMethod;
|
|
1751
|
+
/**
|
|
1752
|
+
*
|
|
1753
|
+
* @param tab 一级Tab状态
|
|
1754
|
+
* @param way 二级Tab状态
|
|
1755
|
+
* @param id 二维码登录时 记录对应的二维码 ID
|
|
1756
|
+
*/
|
|
1757
|
+
private setLoginWay;
|
|
1758
|
+
/**
|
|
1759
|
+
* 设置/更新 store 内的用户信息
|
|
1760
|
+
*/
|
|
1761
|
+
private setUserInfo;
|
|
1762
|
+
/**
|
|
1763
|
+
* 持久化保存
|
|
1764
|
+
*/
|
|
1765
|
+
private saveStore;
|
|
1766
|
+
/**
|
|
1767
|
+
* 根据登录的 account 判断本次登录的方式
|
|
1768
|
+
* @param account 登录输入的账号
|
|
1769
|
+
* @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
|
|
1770
|
+
* @returns
|
|
1771
|
+
*/
|
|
1772
|
+
private setLoginWayByHttpData;
|
|
1773
|
+
/**
|
|
1774
|
+
* 根据用户 ID 删除 localStorage 中当前用户 ID
|
|
1775
|
+
*/
|
|
1776
|
+
private delUserById;
|
|
1777
|
+
/**
|
|
1778
|
+
* 获得多账号登录页面的所有用户列表
|
|
1779
|
+
* @param excludeWays
|
|
1780
|
+
*/
|
|
1781
|
+
private getMemoUser;
|
|
1782
|
+
/**
|
|
1783
|
+
* 根据 id 获得当前已登录的用户信息
|
|
1784
|
+
* @param userId
|
|
1785
|
+
* @returns User / undefined
|
|
1786
|
+
*/
|
|
1787
|
+
private getMemoSingleUser;
|
|
1788
|
+
/**
|
|
1789
|
+
* 该方法仅仅需要回填账号的登录方式,其他都不计入
|
|
1790
|
+
* 当用户名/手机号/邮箱/AD/LDAP 相同时,根据登录顺序匹配不同的账号
|
|
1791
|
+
* 根据记住的用户登录方式获取对应的登录账户名
|
|
1792
|
+
* @param way
|
|
1793
|
+
* @param user
|
|
1794
|
+
* @returns
|
|
1795
|
+
*/
|
|
1796
|
+
private getAccountByWay;
|
|
1797
|
+
private _mappingUser;
|
|
1798
|
+
/**
|
|
1799
|
+
* 外部暴露方法
|
|
1800
|
+
*/
|
|
1801
|
+
getStore: () => {
|
|
1802
|
+
initStore: (appId: string, options: {
|
|
1803
|
+
serverSideLoginMethods: LoginWay[];
|
|
1804
|
+
isInternationSms: boolean;
|
|
1805
|
+
}) => void;
|
|
1806
|
+
setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
|
|
1807
|
+
phoneCountryCode: string;
|
|
1808
|
+
areaCode: string;
|
|
1809
|
+
} | undefined) => void;
|
|
1810
|
+
setUserInfo: (user: Pick<User & {
|
|
1811
|
+
id: string;
|
|
1812
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1813
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
1814
|
+
username?: string | undefined;
|
|
1815
|
+
phone?: string | undefined;
|
|
1816
|
+
email?: string | undefined;
|
|
1817
|
+
}) => void;
|
|
1818
|
+
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
1819
|
+
getMemoSingleUser: (id: string) => {
|
|
1820
|
+
way: LoginWay;
|
|
1821
|
+
account: string;
|
|
1822
|
+
} | undefined;
|
|
1823
|
+
delUserById: (id: string) => string;
|
|
1824
|
+
getMemberState: () => boolean;
|
|
1825
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
1826
|
+
getOriginAccount: () => string;
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* MultipleAccounts 相关 Hook
|
|
1831
|
+
* Finally Config 类型过滤
|
|
1832
|
+
*/
|
|
1833
|
+
const useMultipleAccounts: ({ appId, finallyConfig }: {
|
|
1834
|
+
appId?: string | undefined;
|
|
1835
|
+
finallyConfig?: any;
|
|
1836
|
+
}) => {
|
|
1837
|
+
instance: {
|
|
1838
|
+
initStore: (appId: string, options: {
|
|
1839
|
+
serverSideLoginMethods: LoginWay[];
|
|
1840
|
+
isInternationSms: boolean;
|
|
1841
|
+
}) => void;
|
|
1842
|
+
setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
|
|
1843
|
+
phoneCountryCode: string;
|
|
1844
|
+
areaCode: string;
|
|
1845
|
+
} | undefined) => void;
|
|
1846
|
+
setUserInfo: (user: Pick<User & {
|
|
1847
|
+
id: string;
|
|
1848
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1849
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
1850
|
+
username?: string | undefined;
|
|
1851
|
+
phone?: string | undefined;
|
|
1852
|
+
email?: string | undefined;
|
|
1853
|
+
}) => void;
|
|
1854
|
+
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
1855
|
+
getMemoSingleUser: (id: string) => {
|
|
1856
|
+
way: LoginWay;
|
|
1857
|
+
account: string;
|
|
1858
|
+
} | undefined;
|
|
1859
|
+
delUserById: (id: string) => string;
|
|
1860
|
+
getMemberState: () => boolean;
|
|
1861
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
1862
|
+
getOriginAccount: () => string;
|
|
1863
|
+
} | undefined;
|
|
1864
|
+
isMultipleAccount: boolean;
|
|
1865
|
+
referMultipleState: (type: 'login' | 'multiple', data?: BackFillMultipleState | undefined) => void;
|
|
1866
|
+
multipleAccountData: BackFillMultipleState | undefined;
|
|
1867
|
+
clearBackFillData: () => void;
|
|
1868
|
+
};
|
|
1869
|
+
export default useMultipleAccounts;
|
|
1870
|
+
|
|
1578
1871
|
}
|
|
1579
1872
|
declare module '@authing/react-ui-components/components/Guard/core/index' {
|
|
1580
1873
|
/// <reference types="react" />
|
|
@@ -1634,7 +1927,33 @@ declare module '@authing/react-ui-components/components/Guard/event' {
|
|
|
1634
1927
|
export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
|
|
1635
1928
|
onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
|
|
1636
1929
|
}
|
|
1637
|
-
export const guardEventsFilter: (props: any,
|
|
1930
|
+
export const guardEventsFilter: (props: any, multipleInstance?: {
|
|
1931
|
+
initStore: (appId: string, options: {
|
|
1932
|
+
serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
1933
|
+
isInternationSms: boolean;
|
|
1934
|
+
}) => void;
|
|
1935
|
+
setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
1936
|
+
phoneCountryCode: string;
|
|
1937
|
+
areaCode: string;
|
|
1938
|
+
} | undefined) => void;
|
|
1939
|
+
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
1940
|
+
id: string;
|
|
1941
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1942
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
1943
|
+
username?: string | undefined;
|
|
1944
|
+
phone?: string | undefined;
|
|
1945
|
+
email?: string | undefined;
|
|
1946
|
+
}) => void;
|
|
1947
|
+
getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
1948
|
+
getMemoSingleUser: (id: string) => {
|
|
1949
|
+
way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
1950
|
+
account: string;
|
|
1951
|
+
} | undefined;
|
|
1952
|
+
delUserById: (id: string) => string;
|
|
1953
|
+
getMemberState: () => boolean;
|
|
1954
|
+
getFirstBackFillData: () => import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").BackFillMultipleState | undefined;
|
|
1955
|
+
getOriginAccount: () => string;
|
|
1956
|
+
} | undefined, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1638
1957
|
export const guardEventsHijacking: (events: GuardEvents, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1639
1958
|
export const GuardEventsCamelToKebabMapping: {
|
|
1640
1959
|
readonly onLoad: "load";
|
|
@@ -1926,6 +2245,7 @@ declare module '@authing/react-ui-components/components/Login/codemap' {
|
|
|
1926
2245
|
declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
1927
2246
|
/// <reference types="react" />
|
|
1928
2247
|
import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2248
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
1929
2249
|
interface LoginWithADProps {
|
|
1930
2250
|
publicKey: string;
|
|
1931
2251
|
autoRegister?: boolean;
|
|
@@ -1933,6 +2253,14 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
|
1933
2253
|
onLoginFailed: any;
|
|
1934
2254
|
onBeforeLogin: any;
|
|
1935
2255
|
agreements: Agreement[];
|
|
2256
|
+
/**
|
|
2257
|
+
* 回填的数据
|
|
2258
|
+
*/
|
|
2259
|
+
backfillData?: BackFillMultipleState;
|
|
2260
|
+
/**
|
|
2261
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2262
|
+
*/
|
|
2263
|
+
multipleInstance?: StoreInstance;
|
|
1936
2264
|
}
|
|
1937
2265
|
export const LoginWithAD: (props: LoginWithADProps) => JSX.Element;
|
|
1938
2266
|
export {};
|
|
@@ -1940,10 +2268,12 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
|
1940
2268
|
}
|
|
1941
2269
|
declare module '@authing/react-ui-components/components/Login/core/withAppQrcode' {
|
|
1942
2270
|
/// <reference types="react" />
|
|
2271
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
1943
2272
|
interface LoginWithAppQrcodeProps {
|
|
1944
2273
|
onLoginSuccess: any;
|
|
1945
2274
|
canLoop: boolean;
|
|
1946
2275
|
qrCodeScanOptions: any;
|
|
2276
|
+
multipleInstance?: StoreInstance;
|
|
1947
2277
|
}
|
|
1948
2278
|
export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element;
|
|
1949
2279
|
export {};
|
|
@@ -1952,6 +2282,7 @@ declare module '@authing/react-ui-components/components/Login/core/withAppQrcode
|
|
|
1952
2282
|
declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
|
|
1953
2283
|
/// <reference types="react" />
|
|
1954
2284
|
import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2285
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
1955
2286
|
interface LoginWithLDAPProps {
|
|
1956
2287
|
publicKey: string;
|
|
1957
2288
|
autoRegister?: boolean;
|
|
@@ -1960,6 +2291,14 @@ declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
|
|
|
1960
2291
|
onLoginFailed: any;
|
|
1961
2292
|
onBeforeLogin: any;
|
|
1962
2293
|
agreements: Agreement[];
|
|
2294
|
+
/**
|
|
2295
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2296
|
+
*/
|
|
2297
|
+
multipleInstance?: StoreInstance;
|
|
2298
|
+
/**
|
|
2299
|
+
* 多账号回填的数据
|
|
2300
|
+
*/
|
|
2301
|
+
backfillData?: BackFillMultipleState;
|
|
1963
2302
|
}
|
|
1964
2303
|
export const LoginWithLDAP: (props: LoginWithLDAPProps) => JSX.Element;
|
|
1965
2304
|
export {};
|
|
@@ -2000,6 +2339,7 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
|
|
|
2000
2339
|
import { Agreement, PasswordLoginMethods } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2001
2340
|
import { LoginMethods } from '@authing/react-ui-components/components/index';
|
|
2002
2341
|
import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
|
|
2342
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2003
2343
|
interface LoginWithPasswordProps {
|
|
2004
2344
|
publicKey: string;
|
|
2005
2345
|
autoRegister?: boolean;
|
|
@@ -2013,6 +2353,14 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
|
|
|
2013
2353
|
loginWay?: LoginMethods;
|
|
2014
2354
|
submitButText?: string;
|
|
2015
2355
|
saveIdentify?: (type: LoginMethods, identity: string) => void;
|
|
2356
|
+
/**
|
|
2357
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2358
|
+
*/
|
|
2359
|
+
multipleInstance?: StoreInstance;
|
|
2360
|
+
/**
|
|
2361
|
+
* 多账号回填的数据
|
|
2362
|
+
*/
|
|
2363
|
+
backfillData?: BackFillMultipleState;
|
|
2016
2364
|
}
|
|
2017
2365
|
export const LoginWithPassword: (props: LoginWithPasswordProps) => JSX.Element;
|
|
2018
2366
|
export {};
|
|
@@ -2046,6 +2394,10 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2046
2394
|
import React, { FC } from 'react';
|
|
2047
2395
|
import './styles.less';
|
|
2048
2396
|
export interface VirtualDropdownProps {
|
|
2397
|
+
/**
|
|
2398
|
+
* 回填的国际化区号
|
|
2399
|
+
*/
|
|
2400
|
+
regionCode?: string;
|
|
2049
2401
|
value?: string;
|
|
2050
2402
|
onChange?: (value: string) => void;
|
|
2051
2403
|
style?: React.CSSProperties;
|
|
@@ -2056,7 +2408,8 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2056
2408
|
declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/index' {
|
|
2057
2409
|
/// <reference types="react" />
|
|
2058
2410
|
import './styles.less';
|
|
2059
|
-
|
|
2411
|
+
const LoginWithVerifyCode: (props: any) => JSX.Element;
|
|
2412
|
+
export { LoginWithVerifyCode };
|
|
2060
2413
|
|
|
2061
2414
|
}
|
|
2062
2415
|
declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/inputIdentify' {
|
|
@@ -2071,10 +2424,13 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2071
2424
|
}
|
|
2072
2425
|
declare module '@authing/react-ui-components/components/Login/core/withWechatMiniQrcode' {
|
|
2073
2426
|
/// <reference types="react" />
|
|
2427
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2074
2428
|
interface LoginWithWechatMiniQrcodeProps {
|
|
2075
2429
|
onLoginSuccess: any;
|
|
2076
2430
|
canLoop: boolean;
|
|
2077
2431
|
qrCodeScanOptions: any;
|
|
2432
|
+
id: string;
|
|
2433
|
+
multipleInstance?: StoreInstance;
|
|
2078
2434
|
}
|
|
2079
2435
|
export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element;
|
|
2080
2436
|
export {};
|
|
@@ -2082,14 +2438,79 @@ declare module '@authing/react-ui-components/components/Login/core/withWechatMin
|
|
|
2082
2438
|
}
|
|
2083
2439
|
declare module '@authing/react-ui-components/components/Login/core/withWechatmpQrcode' {
|
|
2084
2440
|
/// <reference types="react" />
|
|
2441
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2085
2442
|
interface LoginWithWechatmpQrcodeProps {
|
|
2086
2443
|
onLoginSuccess: any;
|
|
2087
2444
|
canLoop: boolean;
|
|
2088
2445
|
qrCodeScanOptions: any;
|
|
2446
|
+
id: string;
|
|
2447
|
+
/**
|
|
2448
|
+
* 多账号存储实例
|
|
2449
|
+
*/
|
|
2450
|
+
multipleInstance?: StoreInstance;
|
|
2089
2451
|
}
|
|
2090
2452
|
export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element;
|
|
2091
2453
|
export {};
|
|
2092
2454
|
|
|
2455
|
+
}
|
|
2456
|
+
declare module '@authing/react-ui-components/components/Login/hooks/useLoginMultiple' {
|
|
2457
|
+
/// <reference types="react" />
|
|
2458
|
+
import { FormInstance } from 'antd/lib/form';
|
|
2459
|
+
import { BackFillMultipleState, LoginWay } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2460
|
+
/**
|
|
2461
|
+
* 多账号登录下 账户 & 登录方式自动回填
|
|
2462
|
+
* TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
|
|
2463
|
+
* 调用地方 core 中需要回填的两个登录方式
|
|
2464
|
+
*/
|
|
2465
|
+
function useLoginMultipleBackFill(options: {
|
|
2466
|
+
form: FormInstance<any>;
|
|
2467
|
+
way: LoginWay;
|
|
2468
|
+
formKey: string;
|
|
2469
|
+
backfillData?: BackFillMultipleState;
|
|
2470
|
+
isOnlyInternationSms?: boolean;
|
|
2471
|
+
setAreaCode?: React.Dispatch<React.SetStateAction<string>>;
|
|
2472
|
+
cancelBackfill?: boolean;
|
|
2473
|
+
}): void;
|
|
2474
|
+
/**
|
|
2475
|
+
* 多账号统一状态管理
|
|
2476
|
+
* @param setLoginWay
|
|
2477
|
+
* @returns
|
|
2478
|
+
*/
|
|
2479
|
+
function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
2480
|
+
isMultipleAccount: boolean;
|
|
2481
|
+
multipleInstance: {
|
|
2482
|
+
initStore: (appId: string, options: {
|
|
2483
|
+
serverSideLoginMethods: LoginWay[];
|
|
2484
|
+
isInternationSms: boolean;
|
|
2485
|
+
}) => void;
|
|
2486
|
+
setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string | undefined, internation?: {
|
|
2487
|
+
phoneCountryCode: string;
|
|
2488
|
+
areaCode: string;
|
|
2489
|
+
} | undefined) => void;
|
|
2490
|
+
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
2491
|
+
id: string;
|
|
2492
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
2493
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
2494
|
+
username?: string | undefined;
|
|
2495
|
+
phone?: string | undefined;
|
|
2496
|
+
email?: string | undefined;
|
|
2497
|
+
}) => void;
|
|
2498
|
+
getMemoUser: (excludeWays?: LoginWay[]) => import("@authing/react-ui-components/components/Login/multipleAccounts/panel").SelectOptions[];
|
|
2499
|
+
getMemoSingleUser: (id: string) => {
|
|
2500
|
+
way: LoginWay;
|
|
2501
|
+
account: string;
|
|
2502
|
+
} | undefined;
|
|
2503
|
+
delUserById: (id: string) => string;
|
|
2504
|
+
getMemberState: () => boolean;
|
|
2505
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
2506
|
+
getOriginAccount: () => string;
|
|
2507
|
+
} | undefined;
|
|
2508
|
+
referMultipleState: ((type: "login" | "multiple") => void) | undefined;
|
|
2509
|
+
backfillData: BackFillMultipleState | undefined;
|
|
2510
|
+
defaultQrWay: string | undefined;
|
|
2511
|
+
};
|
|
2512
|
+
export { useLoginMultipleBackFill, useLoginMultiple };
|
|
2513
|
+
|
|
2093
2514
|
}
|
|
2094
2515
|
declare module '@authing/react-ui-components/components/Login/index' {
|
|
2095
2516
|
/// <reference types="react" />
|
|
@@ -2138,6 +2559,79 @@ declare module '@authing/react-ui-components/components/Login/interface' {
|
|
|
2138
2559
|
}
|
|
2139
2560
|
export const getDefaultLoginConfig: () => LoginConfig;
|
|
2140
2561
|
|
|
2562
|
+
}
|
|
2563
|
+
declare module '@authing/react-ui-components/components/Login/multipleAccounts/index' {
|
|
2564
|
+
import React from 'react';
|
|
2565
|
+
import { LoginWay, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2566
|
+
import { GuardModuleType } from '@authing/react-ui-components/components/Guard/index';
|
|
2567
|
+
interface MultipleAccountsProps {
|
|
2568
|
+
/**
|
|
2569
|
+
* 多账号存储实例
|
|
2570
|
+
*/
|
|
2571
|
+
multipleInstance?: StoreInstance;
|
|
2572
|
+
/**
|
|
2573
|
+
* 切换 Guard 方法
|
|
2574
|
+
*/
|
|
2575
|
+
changeModule?: (moduleName: GuardModuleType, initData?: any) => Promise<void>;
|
|
2576
|
+
/**
|
|
2577
|
+
* 切换多账号状态
|
|
2578
|
+
*/
|
|
2579
|
+
referMultipleState?: (type: 'login' | 'multiple', data?: {
|
|
2580
|
+
account: string;
|
|
2581
|
+
way: LoginWay;
|
|
2582
|
+
}) => void;
|
|
2583
|
+
}
|
|
2584
|
+
const MultipleAccounts: React.NamedExoticComponent<MultipleAccountsProps>;
|
|
2585
|
+
export { MultipleAccounts };
|
|
2586
|
+
|
|
2587
|
+
}
|
|
2588
|
+
declare module '@authing/react-ui-components/components/Login/multipleAccounts/panel' {
|
|
2589
|
+
import React from 'react';
|
|
2590
|
+
import './style.less';
|
|
2591
|
+
interface SelectPanelProps {
|
|
2592
|
+
lists: SelectOptions[];
|
|
2593
|
+
/**
|
|
2594
|
+
* 点击删除
|
|
2595
|
+
*/
|
|
2596
|
+
handleDel: (id: string) => void;
|
|
2597
|
+
/**
|
|
2598
|
+
* 点击 li
|
|
2599
|
+
*/
|
|
2600
|
+
onClick: (id: string) => void;
|
|
2601
|
+
}
|
|
2602
|
+
export interface SelectOptions {
|
|
2603
|
+
/**
|
|
2604
|
+
* 头像
|
|
2605
|
+
*/
|
|
2606
|
+
photo?: string;
|
|
2607
|
+
/**
|
|
2608
|
+
* 标题
|
|
2609
|
+
*/
|
|
2610
|
+
title?: string;
|
|
2611
|
+
/**
|
|
2612
|
+
* 描述
|
|
2613
|
+
*/
|
|
2614
|
+
description?: string;
|
|
2615
|
+
/**
|
|
2616
|
+
* 用户 ID 唯一标识符
|
|
2617
|
+
*/
|
|
2618
|
+
id: string | 'other';
|
|
2619
|
+
/**
|
|
2620
|
+
* 显示操作栏 default: true
|
|
2621
|
+
*/
|
|
2622
|
+
operation?: boolean;
|
|
2623
|
+
/**
|
|
2624
|
+
* 登录时间
|
|
2625
|
+
*/
|
|
2626
|
+
_updateTime: number;
|
|
2627
|
+
/**
|
|
2628
|
+
* 替代图片元素
|
|
2629
|
+
*/
|
|
2630
|
+
element?: React.ReactElement;
|
|
2631
|
+
}
|
|
2632
|
+
const SelectPanel: React.FC<SelectPanelProps>;
|
|
2633
|
+
export { SelectPanel };
|
|
2634
|
+
|
|
2141
2635
|
}
|
|
2142
2636
|
declare module '@authing/react-ui-components/components/Login/socialLogin/IdpButton/index' {
|
|
2143
2637
|
/// <reference types="react" />
|
|
@@ -2149,6 +2643,7 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
|
|
|
2149
2643
|
import { ApplicationConfig, SocialConnectionItem } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2150
2644
|
import './style.less';
|
|
2151
2645
|
import { GuardLocalConfig } from '@authing/react-ui-components/components/Guard/index';
|
|
2646
|
+
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2152
2647
|
export interface SocialLoginProps {
|
|
2153
2648
|
appId: string;
|
|
2154
2649
|
config: GuardLocalConfig;
|
|
@@ -2156,6 +2651,10 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
|
|
|
2156
2651
|
onLoginSuccess: any;
|
|
2157
2652
|
enterpriseConnectionObjs: ApplicationConfig['identityProviders'];
|
|
2158
2653
|
socialConnectionObjs: SocialConnectionItem[];
|
|
2654
|
+
/**
|
|
2655
|
+
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2656
|
+
*/
|
|
2657
|
+
multipleInstance?: StoreInstance;
|
|
2159
2658
|
}
|
|
2160
2659
|
export const SocialLogin: React.FC<SocialLoginProps>;
|
|
2161
2660
|
|
|
@@ -2998,6 +3497,8 @@ declare module '@authing/react-ui-components/components/_utils/config/index' {
|
|
|
2998
3497
|
expired?: string | undefined;
|
|
2999
3498
|
retry?: string | undefined;
|
|
3000
3499
|
failed?: string | undefined;
|
|
3500
|
+
middleTitle?: string | undefined;
|
|
3501
|
+
referText?: string | undefined;
|
|
3001
3502
|
} | undefined;
|
|
3002
3503
|
onAuthFlow?: ((flow: Record<string, any>) => {}) | undefined;
|
|
3003
3504
|
customData?: {
|
|
@@ -3019,6 +3520,7 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3019
3520
|
import React from 'react';
|
|
3020
3521
|
import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '@authing/react-ui-components/components/index';
|
|
3021
3522
|
import { ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
3523
|
+
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
3022
3524
|
import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
|
|
3023
3525
|
import { GuardHttp } from '@authing/react-ui-components/components/_utils/guardHttp';
|
|
3024
3526
|
export interface IGuardContext {
|
|
@@ -3036,6 +3538,29 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3036
3538
|
isAuthFlow: boolean;
|
|
3037
3539
|
contextLoaded: boolean;
|
|
3038
3540
|
guardPageConfig: Partial<GuardPageConfig>;
|
|
3541
|
+
multipleInstance: {
|
|
3542
|
+
/**
|
|
3543
|
+
* 多账号相关
|
|
3544
|
+
*/
|
|
3545
|
+
isMultipleAccount: boolean;
|
|
3546
|
+
/**
|
|
3547
|
+
* when: 多账号页面跳转进入登录页面
|
|
3548
|
+
* 携带的回填数据信息
|
|
3549
|
+
*/
|
|
3550
|
+
multipleAccountData?: BackFillMultipleState;
|
|
3551
|
+
/**
|
|
3552
|
+
* 多账号 store 实例
|
|
3553
|
+
*/
|
|
3554
|
+
instance?: StoreInstance;
|
|
3555
|
+
/**
|
|
3556
|
+
* 切换多账号 isMultipleAccount 状态
|
|
3557
|
+
*/
|
|
3558
|
+
referMultipleState?: (type: 'login' | 'multiple') => void;
|
|
3559
|
+
/**
|
|
3560
|
+
* 清空回填数据
|
|
3561
|
+
*/
|
|
3562
|
+
clearBackFillData?: () => void;
|
|
3563
|
+
};
|
|
3039
3564
|
}
|
|
3040
3565
|
export const createGuardXContext: () => {
|
|
3041
3566
|
Provider: React.FC<{
|
|
@@ -3073,6 +3598,58 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3073
3598
|
export const useGuardContextLoaded: () => boolean;
|
|
3074
3599
|
export const useGuardIsAuthFlow: () => boolean;
|
|
3075
3600
|
export const useGuardPageConfig: () => Partial<GuardPageConfig>;
|
|
3601
|
+
/**
|
|
3602
|
+
* 多账号登录 store 实例
|
|
3603
|
+
*/
|
|
3604
|
+
export const useGuardMultipleInstance: () => {
|
|
3605
|
+
/**
|
|
3606
|
+
* 多账号相关
|
|
3607
|
+
*/
|
|
3608
|
+
isMultipleAccount: boolean;
|
|
3609
|
+
/**
|
|
3610
|
+
* when: 多账号页面跳转进入登录页面
|
|
3611
|
+
* 携带的回填数据信息
|
|
3612
|
+
*/
|
|
3613
|
+
multipleAccountData?: BackFillMultipleState | undefined;
|
|
3614
|
+
/**
|
|
3615
|
+
* 多账号 store 实例
|
|
3616
|
+
*/
|
|
3617
|
+
instance?: {
|
|
3618
|
+
initStore: (appId: string, options: {
|
|
3619
|
+
serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
3620
|
+
isInternationSms: boolean;
|
|
3621
|
+
}) => void;
|
|
3622
|
+
setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
3623
|
+
phoneCountryCode: string;
|
|
3624
|
+
areaCode: string;
|
|
3625
|
+
} | undefined) => void;
|
|
3626
|
+
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
3627
|
+
id: string;
|
|
3628
|
+
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
3629
|
+
setLoginWayByHttpData: (account: string, data: {
|
|
3630
|
+
username?: string | undefined;
|
|
3631
|
+
phone?: string | undefined;
|
|
3632
|
+
email?: string | undefined;
|
|
3633
|
+
}) => void;
|
|
3634
|
+
getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
3635
|
+
getMemoSingleUser: (id: string) => {
|
|
3636
|
+
way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
3637
|
+
account: string;
|
|
3638
|
+
} | undefined;
|
|
3639
|
+
delUserById: (id: string) => string;
|
|
3640
|
+
getMemberState: () => boolean;
|
|
3641
|
+
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
3642
|
+
getOriginAccount: () => string;
|
|
3643
|
+
} | undefined;
|
|
3644
|
+
/**
|
|
3645
|
+
* 切换多账号 isMultipleAccount 状态
|
|
3646
|
+
*/
|
|
3647
|
+
referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
|
|
3648
|
+
/**
|
|
3649
|
+
* 清空回填数据
|
|
3650
|
+
*/
|
|
3651
|
+
clearBackFillData?: (() => void) | undefined;
|
|
3652
|
+
};
|
|
3076
3653
|
|
|
3077
3654
|
}
|
|
3078
3655
|
declare module '@authing/react-ui-components/components/_utils/corsVerification' {
|
|
@@ -3541,7 +4118,7 @@ declare module '@authing/react-ui-components/components/version/index' {
|
|
|
3541
4118
|
|
|
3542
4119
|
}
|
|
3543
4120
|
declare module '@authing/react-ui-components/components/version/version' {
|
|
3544
|
-
const _default: "3.1.
|
|
4121
|
+
const _default: "3.1.37-beta.2";
|
|
3545
4122
|
export default _default;
|
|
3546
4123
|
|
|
3547
4124
|
}
|