@blocklet/ui-react 2.10.81 → 2.10.83
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.
|
@@ -40,7 +40,7 @@ export default function UserSessions({
|
|
|
40
40
|
let data = user?.userSessions || [];
|
|
41
41
|
try {
|
|
42
42
|
if (!data && session.user) {
|
|
43
|
-
data = await client.userSession.
|
|
43
|
+
data = await client.userSession.getMyLoginSessions();
|
|
44
44
|
}
|
|
45
45
|
const ipIndexList = data?.map((x, index) => [index, x.lastLoginIp]).filter((x) => !!x[1]);
|
|
46
46
|
const ipList = ipIndexList?.map((x) => x[1]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.83",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@arcblock/bridge": "^2.10.
|
|
36
|
-
"@arcblock/react-hooks": "^2.10.
|
|
35
|
+
"@arcblock/bridge": "^2.10.83",
|
|
36
|
+
"@arcblock/react-hooks": "^2.10.83",
|
|
37
37
|
"@blocklet/did-space-react": "^0.5.77",
|
|
38
38
|
"@iconify-icons/logos": "^1.2.36",
|
|
39
39
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"jest": "^29.7.0",
|
|
81
81
|
"unbuild": "^2.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "3dc3cfcb73c77c423d7f8d5bab93c38ddfbf55f9"
|
|
84
84
|
}
|
|
@@ -5,10 +5,12 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
|
|
6
6
|
export default function InstallerItem({ optionalComponent, index, installStatus, hasPermission, t }) {
|
|
7
7
|
const handleInstall = () => {
|
|
8
|
+
// 这里是安全的
|
|
8
9
|
window.open(optionalComponent?.installUrl, '_blank');
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
const handleOpenStore = () => {
|
|
13
|
+
// 这里是安全的
|
|
12
14
|
window.open(optionalComponent?.storeUrl, '_blank');
|
|
13
15
|
};
|
|
14
16
|
|
package/src/Dashboard/index.jsx
CHANGED
|
@@ -79,6 +79,7 @@ function Dashboard({ meta, fallbackUrl, invalidPathFallback, headerAddons, sessi
|
|
|
79
79
|
// 未认证 (user 为空) 时不做处理, 这种情况的页面跳转逻辑一般由应用自行处理
|
|
80
80
|
useLayoutEffect(() => {
|
|
81
81
|
if (!!user && !flattened?.length && fallbackUrl) {
|
|
82
|
+
// 这里是安全的
|
|
82
83
|
window.location.href = fallbackUrl;
|
|
83
84
|
}
|
|
84
85
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -148,6 +149,7 @@ Dashboard.defaultProps = {
|
|
|
148
149
|
showRole: true,
|
|
149
150
|
// dashboard 默认退出登录行为: 跳转到 (root) blocklet 首页
|
|
150
151
|
onLogout: () => {
|
|
152
|
+
// 这里是安全的
|
|
151
153
|
window.location.href = publicPath;
|
|
152
154
|
},
|
|
153
155
|
},
|
|
@@ -173,6 +173,7 @@ export default function UserCenter({
|
|
|
173
173
|
const handleChangeTab = useMemoizedFn((value) => {
|
|
174
174
|
const findTab = userCenterTabs.find((x) => x.value === value);
|
|
175
175
|
if (findTab) {
|
|
176
|
+
// 这里是安全的
|
|
176
177
|
window.location.href = withQuery(findTab.url, {
|
|
177
178
|
did: isMyself ? undefined : currentDid,
|
|
178
179
|
});
|
|
@@ -52,7 +52,8 @@ export default function UserSessions({
|
|
|
52
52
|
let data = (user?.userSessions || []) as (UserSession & { ipRegion?: string })[];
|
|
53
53
|
try {
|
|
54
54
|
if (!data && session.user) {
|
|
55
|
-
|
|
55
|
+
// 依赖新版 js-sdk
|
|
56
|
+
data = await client.userSession.getMyLoginSessions();
|
|
56
57
|
}
|
|
57
58
|
// FIXME: @zhanghan 优化获取 IP 信息的处理逻辑
|
|
58
59
|
const ipIndexList = data?.map((x, index) => [index, x.lastLoginIp] as [number, string]).filter((x) => !!x[1]);
|