@windrun-huaiin/third-ui 7.3.14 → 7.4.0
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/dist/main/money-price/money-price-interactive.js +4 -3
- package/dist/main/money-price/money-price-interactive.mjs +4 -3
- package/dist/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js +1 -1
- package/dist/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js +1 -1
- package/package.json +1 -1
- package/src/main/money-price/money-price-interactive.tsx +3 -3
|
@@ -57,6 +57,7 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
57
57
|
}, [signInPath, redirectToSignIn, router]);
|
|
58
58
|
// 处理升级
|
|
59
59
|
const handleUpgrade = React.useCallback((plan, billingType) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
var _a;
|
|
60
61
|
if (!upgradeApiEndpoint) {
|
|
61
62
|
router.push('/');
|
|
62
63
|
return;
|
|
@@ -77,11 +78,11 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
77
78
|
})
|
|
78
79
|
});
|
|
79
80
|
const result = yield response.json();
|
|
80
|
-
if (result.success && result.
|
|
81
|
-
window.location.href = result.
|
|
81
|
+
if (result.success && ((_a = result.data) === null || _a === void 0 ? void 0 : _a.sessionUrl)) {
|
|
82
|
+
window.location.href = result.data.sessionUrl;
|
|
82
83
|
}
|
|
83
84
|
else {
|
|
84
|
-
console.error('Failed to create checkout session:', result.error);
|
|
85
|
+
console.error('Failed to create checkout session:', result.error || 'Unknown error');
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
catch (error) {
|
|
@@ -55,6 +55,7 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
55
55
|
}, [signInPath, redirectToSignIn, router]);
|
|
56
56
|
// 处理升级
|
|
57
57
|
const handleUpgrade = useCallback((plan, billingType) => __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
var _a;
|
|
58
59
|
if (!upgradeApiEndpoint) {
|
|
59
60
|
router.push('/');
|
|
60
61
|
return;
|
|
@@ -75,11 +76,11 @@ function MoneyPriceInteractive({ data, config, upgradeApiEndpoint, signInPath })
|
|
|
75
76
|
})
|
|
76
77
|
});
|
|
77
78
|
const result = yield response.json();
|
|
78
|
-
if (result.success && result.
|
|
79
|
-
window.location.href = result.
|
|
79
|
+
if (result.success && ((_a = result.data) === null || _a === void 0 ? void 0 : _a.sessionUrl)) {
|
|
80
|
+
window.location.href = result.data.sessionUrl;
|
|
80
81
|
}
|
|
81
82
|
else {
|
|
82
|
-
console.error('Failed to create checkout session:', result.error);
|
|
83
|
+
console.error('Failed to create checkout session:', result.error || 'Unknown error');
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -94,10 +94,10 @@ export function MoneyPriceInteractive({
|
|
|
94
94
|
|
|
95
95
|
const result = await response.json();
|
|
96
96
|
|
|
97
|
-
if (result.success && result.
|
|
98
|
-
window.location.href = result.
|
|
97
|
+
if (result.success && result.data?.sessionUrl) {
|
|
98
|
+
window.location.href = result.data.sessionUrl;
|
|
99
99
|
} else {
|
|
100
|
-
console.error('Failed to create checkout session:', result.error);
|
|
100
|
+
console.error('Failed to create checkout session:', result.error || 'Unknown error');
|
|
101
101
|
}
|
|
102
102
|
} catch (error) {
|
|
103
103
|
console.error('Error during upgrade:', error);
|