|
|
@@ -7,6 +7,10 @@ const path = require('path');
|
|
|
const fs = require('fs');
|
|
|
const { getDeviceConfigs, getDeviceConfigDetail, removeConfig, saveDeviceConfig } = require('../api/setting');
|
|
|
|
|
|
+const errData = {
|
|
|
+ msg :'请求失败,请联系管理员',
|
|
|
+ code:999
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 设置控制器
|
|
|
@@ -24,13 +28,12 @@ class SettingController extends Controller {
|
|
|
*/
|
|
|
async getDeviceConfigList(args) {
|
|
|
try {
|
|
|
- console.log(2)
|
|
|
const result = await getDeviceConfigs(args);
|
|
|
- console.log(result)
|
|
|
- return result;
|
|
|
+ if(result.data) result.data
|
|
|
+ return errData;
|
|
|
} catch (error) {
|
|
|
Log.error('获取设备配置列表失败:', error);
|
|
|
- return [];
|
|
|
+ return errData;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -41,10 +44,10 @@ class SettingController extends Controller {
|
|
|
async getDeviceConfigDetail(args) {
|
|
|
try {
|
|
|
const result = await getDeviceConfigDetail(args);
|
|
|
- return result;
|
|
|
+ if(result.data) result.data
|
|
|
+ return errData;
|
|
|
} catch (error) {
|
|
|
- Log.error('获取设备配置详情失败:', error);
|
|
|
- return null;
|
|
|
+ return errData;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -79,4 +82,4 @@ class SettingController extends Controller {
|
|
|
}
|
|
|
|
|
|
SettingController.toString = () => '[class SettingController]';
|
|
|
-module.exports = SettingController;
|
|
|
+module.exports = SettingController;
|