best-unit 1.0.13 → 1.0.15
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/package.json
CHANGED
|
@@ -41,6 +41,11 @@ function RefreshButton({
|
|
|
41
41
|
transform-origin: center;
|
|
42
42
|
will-change: transform;
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
/* 隐藏 fallback content */
|
|
46
|
+
:host {
|
|
47
|
+
display: inline-block;
|
|
48
|
+
}
|
|
44
49
|
`;
|
|
45
50
|
|
|
46
51
|
const handleClick = async () => {
|
|
@@ -89,6 +94,6 @@ function RefreshButton({
|
|
|
89
94
|
);
|
|
90
95
|
}
|
|
91
96
|
|
|
92
|
-
register(RefreshButton, "best-refresh-button");
|
|
97
|
+
register(RefreshButton, "best-refresh-button", [], { shadow: true });
|
|
93
98
|
|
|
94
99
|
export default RefreshButton;
|
|
@@ -10,10 +10,10 @@ export function TestBalanceData({ isDark }: TestBalanceDataProps) {
|
|
|
10
10
|
const [balanceLoading, setBalanceLoading] = useState(false);
|
|
11
11
|
|
|
12
12
|
// 测试 getBalanceData 函数
|
|
13
|
-
const testGetBalanceData = () => {
|
|
13
|
+
const testGetBalanceData = async () => {
|
|
14
14
|
setBalanceLoading(true);
|
|
15
15
|
try {
|
|
16
|
-
const result = getBalanceData();
|
|
16
|
+
const result = await getBalanceData();
|
|
17
17
|
setBalanceData(result);
|
|
18
18
|
console.log("getBalanceData 测试结果:", result);
|
|
19
19
|
} catch (error) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAllDicts } from "@/api";
|
|
1
|
+
import { getAllDicts, getBalance } from "@/api";
|
|
2
2
|
import { resetHttpInstance } from "@/api/axiosInstance";
|
|
3
3
|
import { Locale, Theme, type Env } from "@/types";
|
|
4
4
|
|
|
@@ -28,8 +28,13 @@ export interface InitParams {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// 获取余额数据并暴露给外部系统
|
|
31
|
-
export function getBalanceData() {
|
|
32
|
-
|
|
31
|
+
export async function getBalanceData() {
|
|
32
|
+
let balanceData = JSON.parse(sessionStorage.getItem("balanceData") || "{}");
|
|
33
|
+
if (balanceData && Object.keys(balanceData).length > 0) {
|
|
34
|
+
return balanceData;
|
|
35
|
+
}
|
|
36
|
+
balanceData = await getBalance();
|
|
37
|
+
return balanceData;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
export function initFundUnit(params: InitParams) {
|