|
@@ -79,10 +79,10 @@ class SystemctlController extends Controller {
|
|
|
if (res.errcode === 0 && res.data !== '') {
|
|
|
this.ctx.body = { errcode: 0, errmsg: '' };
|
|
|
} else {
|
|
|
- this.ctx.body = { errcode: -1, errmsg: '地址链接失败' };
|
|
|
+ this.ctx.body = { errcode: -1, errmsg: '地址连接失败' };
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- const body = { errcode: -1002, errmsg: '地址链接异常', error };
|
|
|
+ const body = { errcode: -1002, errmsg: '地址连接异常', error };
|
|
|
throw new Error(JSON.stringify(body));
|
|
|
}
|
|
|
}
|
|
@@ -116,17 +116,17 @@ class SystemctlController extends Controller {
|
|
|
throw new Error(JSON.stringify(body));
|
|
|
}
|
|
|
}
|
|
|
- // 获取vpn链接状态
|
|
|
+ // 获取vpn连接状态
|
|
|
async vpnstate() {
|
|
|
try {
|
|
|
const res = await this.service.shell.shell('swanctl -l | grep established');
|
|
|
if (res.errcode === 0 && res.data.length > 0) {
|
|
|
- this.ctx.body = { errcode: 0, errmsg: '', data: '已链接' };
|
|
|
+ this.ctx.body = { errcode: 0, errmsg: '', data: '已连接' };
|
|
|
} else {
|
|
|
- this.ctx.body = { errcode: 0, errmsg: '', data: '未链接' };
|
|
|
+ this.ctx.body = { errcode: 0, errmsg: '', data: '未连接' };
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- const body = { errcode: -1002, errmsg: '获取VPN链接状态失败', error };
|
|
|
+ const body = { errcode: -1002, errmsg: '获取VPN连接状态失败', error };
|
|
|
throw new Error(JSON.stringify(body));
|
|
|
}
|
|
|
}
|