fix:api接口错误
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
VITE_APP_ENV=production
|
VITE_APP_ENV=production
|
||||||
VITE_API_BASE_URL=http://120.26.116.145:4000/api
|
VITE_API_BASE_URL=http://120.26.116.145:4010/api
|
||||||
|
|
||||||
# Optional native server url for live reload (used by capacitor.config.ts when building native shell)
|
# Optional native server url for live reload (used by capacitor.config.ts when building native shell)
|
||||||
CAP_SERVER_URL=
|
CAP_SERVER_URL=
|
||||||
|
|||||||
@@ -4,5 +4,7 @@
|
|||||||
<domain includeSubdomains="true">localhost</domain>
|
<domain includeSubdomains="true">localhost</domain>
|
||||||
<domain includeSubdomains="true">127.0.0.1</domain>
|
<domain includeSubdomains="true">127.0.0.1</domain>
|
||||||
<domain includeSubdomains="true">10.0.2.2</domain>
|
<domain includeSubdomains="true">10.0.2.2</domain>
|
||||||
|
<!-- Production/backend host -->
|
||||||
|
<domain includeSubdomains="true">120.26.116.145</domain>
|
||||||
</domain-config>
|
</domain-config>
|
||||||
</network-security-config>
|
</network-security-config>
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ org.gradle.jvmargs=-Xmx1536m
|
|||||||
# Android operating system, and which are packaged with your app's APK
|
# Android operating system, and which are packaged with your app's APK
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
API_BASE_URL=http://10.0.2.2:4000/api
|
API_BASE_URL=http://120.26.116.145:4010/api
|
||||||
NOTIFICATION_WEBHOOK_SECRET=38f71dbf99ab510d970165e43979f945f992848406117c8597a892837331a853
|
NOTIFICATION_WEBHOOK_SECRET=bf921ce9ac433ba2fdfccbccb50e7d805ac89f166962e4b8437a3ecd4ef833b2
|
||||||
@@ -11,6 +11,10 @@ export interface NotificationStatus {
|
|||||||
ingestEndpoint: string;
|
ingestEndpoint: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Derive a sensible default ingest endpoint from current API base URL
|
||||||
|
const apiBaseUrl = (apiClient.defaults.baseURL as string | undefined) ?? 'http://localhost:4000/api';
|
||||||
|
const defaultIngestEndpoint = (apiBaseUrl.endsWith('/') ? apiBaseUrl.slice(0, -1) : apiBaseUrl) + '/transactions/notification';
|
||||||
|
|
||||||
const initialStatus: NotificationStatus = {
|
const initialStatus: NotificationStatus = {
|
||||||
secretConfigured: false,
|
secretConfigured: false,
|
||||||
secretHint: null,
|
secretHint: null,
|
||||||
@@ -18,7 +22,7 @@ const initialStatus: NotificationStatus = {
|
|||||||
packageWhitelist: [],
|
packageWhitelist: [],
|
||||||
ingestedCount: 0,
|
ingestedCount: 0,
|
||||||
lastNotificationAt: null,
|
lastNotificationAt: null,
|
||||||
ingestEndpoint: 'http://localhost:4000/api/transactions/notification'
|
ingestEndpoint: defaultIngestEndpoint
|
||||||
};
|
};
|
||||||
|
|
||||||
export function useNotificationStatusQuery() {
|
export function useNotificationStatusQuery() {
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ const removeChannel = async (channelId: string) => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-sm font-mono break-all text-gray-800">
|
<p class="text-sm font-mono break-all text-gray-800">
|
||||||
{{ notificationStatus?.ingestEndpoint ?? 'http://localhost:4000/api/transactions/notification' }}
|
{{ notificationStatus?.ingestEndpoint }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user