请求HslServer接口的用户名密码统一写入在api文件

This commit is contained in:
wu
2022-08-23 11:18:12 +08:00
parent a35532f8e7
commit af6e1c1cd4
4 changed files with 25 additions and 47 deletions

View File

@@ -641,8 +641,6 @@ export default {
async delDevice() {
const deviceConfigure = await this.$api.GET_HSLSERVER_CONFIGURE(
"http://" + this.serverData.url + ":" + this.serverData.port,
"admin",
process.env.VUE_APP_HSLSERVER_PASSWORD
);
let deviceNode = deviceConfigure.Content.Settings.GroupNode[0].DeviceNode;
if (deviceNode !== undefined && isArray(deviceNode)) {
@@ -659,8 +657,6 @@ export default {
try {
await this.$api.SET_HSLSERVER_CONFIGURE(
"http://" + this.serverData.url + ":" + this.serverData.port,
"admin",
process.env.VUE_APP_HSLSERVER_PASSWORD,
{ data: deviceConfigure.Content }
);
await this.$api.DEL_DEVICE({
@@ -717,8 +713,6 @@ export default {
this.$api
.GET_DEVICE_POINT_VALUE(
"http://" + this.serverData.url + ":" + this.serverData.port,
"admin",
process.env.VUE_APP_HSLSERVER_PASSWORD,
this.deviceData[this.deviceActiveStatus].name,
item.value,
item.type
@@ -749,9 +743,7 @@ export default {
}
});
const deviceConfigure = await this.$api.GET_HSLSERVER_CONFIGURE(
"http://" + this.serverData.url + ":" + this.serverData.port,
"admin",
process.env.VUE_APP_HSLSERVER_PASSWORD
"http://" + this.serverData.url + ":" + this.serverData.port
);
const deviceConfigureModelValue = this.$refs.deviceConfigure.deviceConfigureModelValue
if (this.devicePointData.length > 0) {
@@ -792,8 +784,6 @@ export default {
deviceConfigure.Content.Settings.GroupNode[0].DeviceNode = deviceNode;
await this.$api.SET_HSLSERVER_CONFIGURE(
"http://" + this.serverData.url + ":" + this.serverData.port,
"admin",
process.env.VUE_APP_HSLSERVER_PASSWORD,
{ data: deviceConfigure.Content }
);
deviceConfigureModelValue.DeviceTypeName =
@@ -815,9 +805,7 @@ export default {
},
async getDeviceStatus() {
const res = await this.$api.GET_SERVER_DEVICE_STATUS(
"http://" + this.serverData.url + ":" + this.serverData.port,
"admin",
process.env.VUE_APP_HSLSERVER_PASSWORD
"http://" + this.serverData.url + ":" + this.serverData.port
);
if (res) {
this.$emit("changeStatus", "online");