u
This commit is contained in:
parent
736717ba91
commit
4f2058e9f6
@ -690,6 +690,7 @@
|
||||
},
|
||||
|
||||
async refreshData() {
|
||||
console.log('[refreshData] 开始刷新数据...');
|
||||
this.loading = true;
|
||||
try {
|
||||
await Promise.all([
|
||||
@ -703,6 +704,7 @@
|
||||
if (this.currentTab === 'orders') {
|
||||
await this.fetchOrderHistory();
|
||||
}
|
||||
console.log('[refreshData] 数据刷新完成');
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
@ -710,7 +712,9 @@
|
||||
|
||||
async fetchServiceStatus() {
|
||||
try {
|
||||
console.log('[fetchServiceStatus] 开始请求服务状态...');
|
||||
const response = await axios.get('/api/real-trading/status');
|
||||
console.log('[fetchServiceStatus] 响应:', response.data);
|
||||
if (response.data.success) {
|
||||
const status = response.data.status;
|
||||
this.serviceEnabled = status.enabled;
|
||||
@ -721,6 +725,12 @@
|
||||
if (status.account) {
|
||||
this.account = status.account;
|
||||
}
|
||||
console.log('[fetchServiceStatus] 状态已更新:', {
|
||||
serviceEnabled: this.serviceEnabled,
|
||||
apiConfigured: this.apiConfigured,
|
||||
autoTradingEnabled: this.autoTradingEnabled,
|
||||
account: this.account
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取服务状态失败:', error);
|
||||
@ -757,7 +767,9 @@
|
||||
|
||||
async fetchAccountStatus() {
|
||||
try {
|
||||
console.log('[fetchAccountStatus] 开始请求账户状态...');
|
||||
const response = await axios.get('/api/real-trading/account');
|
||||
console.log('[fetchAccountStatus] 响应:', response.data);
|
||||
if (response.data.success) {
|
||||
this.account = response.data.account;
|
||||
}
|
||||
@ -803,7 +815,9 @@
|
||||
|
||||
async fetchExchangePositions() {
|
||||
try {
|
||||
console.log('[fetchExchangePositions] 开始请求交易所持仓...');
|
||||
const response = await axios.get('/api/real-trading/positions');
|
||||
console.log('[fetchExchangePositions] 响应:', response.data);
|
||||
if (response.data.success) {
|
||||
this.exchangePositions = response.data.positions;
|
||||
}
|
||||
@ -863,6 +877,7 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('[Vue] 应用已挂载,开始加载数据...');
|
||||
this.refreshData();
|
||||
// 不自动刷新,用户可以手动点击刷新按钮
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user