fix:api接口错误
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
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)
|
||||
CAP_SERVER_URL=
|
||||
|
||||
@@ -11,6 +11,6 @@ public class MainActivity extends BridgeActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
registerPlugin(NotificationPermissionPlugin.class);
|
||||
registerPlugin(CapacitorSQLitePlugin.class);
|
||||
super.onCreate(savedInstanceState);
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
<domain includeSubdomains="true">localhost</domain>
|
||||
<domain includeSubdomains="true">127.0.0.1</domain>
|
||||
<domain includeSubdomains="true">10.0.2.2</domain>
|
||||
<!-- Production/backend host -->
|
||||
<domain includeSubdomains="true">120.26.116.145</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
|
||||
@@ -20,5 +20,5 @@ org.gradle.jvmargs=-Xmx1536m
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
API_BASE_URL=http://10.0.2.2:4000/api
|
||||
NOTIFICATION_WEBHOOK_SECRET=38f71dbf99ab510d970165e43979f945f992848406117c8597a892837331a853
|
||||
API_BASE_URL=http://120.26.116.145:4010/api
|
||||
NOTIFICATION_WEBHOOK_SECRET=bf921ce9ac433ba2fdfccbccb50e7d805ac89f166962e4b8437a3ecd4ef833b2
|
||||
@@ -11,6 +11,10 @@ export interface NotificationStatus {
|
||||
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 = {
|
||||
secretConfigured: false,
|
||||
secretHint: null,
|
||||
@@ -18,7 +22,7 @@ const initialStatus: NotificationStatus = {
|
||||
packageWhitelist: [],
|
||||
ingestedCount: 0,
|
||||
lastNotificationAt: null,
|
||||
ingestEndpoint: 'http://localhost:4000/api/transactions/notification'
|
||||
ingestEndpoint: defaultIngestEndpoint
|
||||
};
|
||||
|
||||
export function useNotificationStatusQuery() {
|
||||
|
||||
@@ -366,7 +366,7 @@ const removeChannel = async (channelId: string) => {
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-sm font-mono break-all text-gray-800">
|
||||
{{ notificationStatus?.ingestEndpoint ?? 'http://localhost:4000/api/transactions/notification' }}
|
||||
{{ notificationStatus?.ingestEndpoint }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user