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