fix(mining-admin-service): 修复mining-service API路径为v2
This commit is contained in:
parent
09b15da3cb
commit
d404521841
|
|
@ -50,7 +50,7 @@ export class ConfigController {
|
||||||
async getMiningStatus() {
|
async getMiningStatus() {
|
||||||
const miningServiceUrl = this.appConfigService.get<string>('MINING_SERVICE_URL', 'http://localhost:3021');
|
const miningServiceUrl = this.appConfigService.get<string>('MINING_SERVICE_URL', 'http://localhost:3021');
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${miningServiceUrl}/api/v1/admin/status`);
|
const response = await fetch(`${miningServiceUrl}/api/v2/admin/status`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Failed to fetch mining status');
|
throw new Error('Failed to fetch mining status');
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ export class ConfigController {
|
||||||
async activateMining(@Req() req: any) {
|
async activateMining(@Req() req: any) {
|
||||||
const miningServiceUrl = this.appConfigService.get<string>('MINING_SERVICE_URL', 'http://localhost:3021');
|
const miningServiceUrl = this.appConfigService.get<string>('MINING_SERVICE_URL', 'http://localhost:3021');
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${miningServiceUrl}/api/v1/admin/activate`, {
|
const response = await fetch(`${miningServiceUrl}/api/v2/admin/activate`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|
@ -90,7 +90,7 @@ export class ConfigController {
|
||||||
async deactivateMining(@Req() req: any) {
|
async deactivateMining(@Req() req: any) {
|
||||||
const miningServiceUrl = this.appConfigService.get<string>('MINING_SERVICE_URL', 'http://localhost:3021');
|
const miningServiceUrl = this.appConfigService.get<string>('MINING_SERVICE_URL', 'http://localhost:3021');
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${miningServiceUrl}/api/v1/admin/deactivate`, {
|
const response = await fetch(`${miningServiceUrl}/api/v2/admin/deactivate`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue