update pay ui
This commit is contained in:
@@ -53,6 +53,7 @@ import {
|
||||
FaChevronDown,
|
||||
FaChevronUp,
|
||||
} from 'react-icons/fa';
|
||||
import { getApiBase } from '../../utils/apiConfig';
|
||||
|
||||
export default function SubscriptionContent() {
|
||||
// Auth context
|
||||
@@ -129,7 +130,7 @@ export default function SubscriptionContent() {
|
||||
const fetchSubscriptionPlans = async () => {
|
||||
try {
|
||||
logger.debug('SubscriptionContent', '正在获取订阅套餐');
|
||||
const response = await fetch('/api/subscription/plans');
|
||||
const response = await fetch(`${getApiBase()}/api/subscription/plans`);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
@@ -175,7 +176,7 @@ export default function SubscriptionContent() {
|
||||
validPromoCode
|
||||
});
|
||||
|
||||
const response = await fetch('/api/subscription/calculate-price', {
|
||||
const response = await fetch(`${getApiBase()}/api/subscription/calculate-price`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -307,7 +308,7 @@ export default function SubscriptionContent() {
|
||||
orderId: null // Will be set after order creation
|
||||
});
|
||||
|
||||
const response = await fetch('/api/payment/create-order', {
|
||||
const response = await fetch(`${getApiBase()}/api/payment/create-order`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -379,7 +380,7 @@ export default function SubscriptionContent() {
|
||||
|
||||
const checkInterval = setInterval(async () => {
|
||||
try {
|
||||
const response = await fetch(`/api/payment/order/${orderId}/status`, {
|
||||
const response = await fetch(`${getApiBase()}/api/payment/order/${orderId}/status`, {
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
@@ -456,7 +457,7 @@ export default function SubscriptionContent() {
|
||||
|
||||
setForceUpdating(true);
|
||||
try {
|
||||
const response = await fetch(`/api/payment/order/${paymentOrder.id}/force-update`, {
|
||||
const response = await fetch(`${getApiBase()}/api/payment/order/${paymentOrder.id}/force-update`, {
|
||||
method: 'POST',
|
||||
credentials: 'include'
|
||||
});
|
||||
@@ -517,7 +518,7 @@ export default function SubscriptionContent() {
|
||||
|
||||
setCheckingPayment(true);
|
||||
try {
|
||||
const response = await fetch(`/api/payment/order/${paymentOrder.id}/status`, {
|
||||
const response = await fetch(`${getApiBase()}/api/payment/order/${paymentOrder.id}/status`, {
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user