fix(api): correct api endpoint paths and remove stale console debug calls

This commit is contained in:
pnoker
2021-10-23 22:43:02 +08:00
parent cf9e99b350
commit bbf919c3c9
18 changed files with 2164 additions and 2193 deletions
+47 -35
View File
@@ -1,47 +1,59 @@
:boom: 你的 `Star` 是我开发的动力,下载源码 `git clone https://gitee.com/pnoker/dc3-web.git` !
:rocket: 非常欢迎广大兴趣爱好者的加入,你的 `Star` 是我们开发的动力 :boom:!
:rocket: 非常欢迎广大兴趣爱好者的加入,第一时间 [联系作者]([https://gitee.com/pnoker/iot-dc3/tree/dev/#5-%E8%81%94%E7%B3%BB%E4%BD%9C%E8%80%85](https://gitee.com/pnoker/iot-dc3/tree/dev/#5-联系作者)),`show me you code`,让我们肩并肩 :alien:!
:seedling: 该 `Demo Web UI` ,需要借助 `DC3` 平台服务,https://gitee.com/pnoker/iot-dc3
<p align="center">
<img src="./dc3/images/iot-dc3-logo.png" width="400"><br>
<a href='https://gitee.com/pnoker/iot-dc3/stargazers'><img src='https://gitee.com/pnoker/iot-dc3/badge/star.svg?theme=gray' alt='star'></a>
<a href="https://github.com/pnoker/iot-dc3/blob/master/LICENSE"><img src="https://img.shields.io/github/license/pnoker/iot-dc3.svg"></a>
<br><strong>DC3是基于Spring Cloud的开源可分布式物联网(IOT)平台,用于快速开发、部署物联设备接入项目,是一整套物联系统解决方案。<br>IOT DC3 is an open source, distributed Internet of Things (IOT) platform based on Spring Cloud. It is used for rapid development of IOT projects and management of IOT devices. It is a set of solutions for IOT system.</strong>
</p>
:seedling: 该 `Web UI` ,需要借助 `DC3` 平台服务,https://gitee.com/pnoker/iot-dc3
------
### Run & Build
```bash
git clone https://gitee.com/pnoker/dc3-web.git
cd dc3-web
npm install -g yarn --registry=https://registry.npm.taobao.org
yarn
## 一、准备
# run
yarn run serve
- `nodejs` >= 12
- `git`
- `Web Storm` 或者 `Visual Studio Code`
# build
yarn run build
### 配置国内 `npm` 源
> 在用户目录下创建 `.npmrc` 文件,并写入以下内容
```txt
registry=https://registry.npm.taobao.org
sass_binary_site=https://npm.taobao.org/mirrors/node-sass
```
### Demo UI
![](./dc3/images/demo/1.png)
![](./dc3/images/demo/2.png)
![](./dc3/images/demo/3.png)
![](./dc3/images/demo/4.png)
![](./dc3/images/demo/5.png)
![](./dc3/images/demo/6.png)
![](./dc3/images/demo/7.png)
![](./dc3/images/demo/8.png)
![](./dc3/images/demo/9.png)
![](./dc3/images/demo/10.png)
![](./dc3/images/demo/11.png)
![](./dc3/images/demo/12.png)
![](./dc3/images/demo/13.png)
### 安装 `yarn`
```bash
npm install -g yarn
```
## 二、源码
```bash
git clone https://gitee.com/pnoker/dc3-web.git
```
## 三、开发
```bash
cd dc3-web
# install
yarn
# run
yarn run serve
# build
yarn run build
```
+2 -2
View File
@@ -1,11 +1,11 @@
import request from '@/config/axios'
export const driverAttributeByDriverId = (id) => request({
url: 'api/v3/manager/driver_attribute/driverId/' + id,
url: 'api/v3/manager/driver_attribute/driver_id/' + id,
method: 'get'
});
export const pointAttributeByDriverId = (id) => request({
url: 'api/v3/manager/point_attribute/driverId/' + id,
url: 'api/v3/manager/point_attribute/driver_id/' + id,
method: 'get'
});
+4 -4
View File
@@ -23,12 +23,12 @@ export const deviceById = (id) => request({
});
export const deviceByDriverId = (driverId) => request({
url: 'api/v3/manager/device/driverId/' + driverId,
url: 'api/v3/manager/device/driver_id/' + driverId,
method: 'get'
});
export const deviceByProfileId = (profileId) => request({
url: 'api/v3/manager/device/profileId/' + profileId,
url: 'api/v3/manager/device/profile_id/' + profileId,
method: 'get'
});
@@ -46,11 +46,11 @@ export const deviceStatus = (device) => request({
});
export const deviceStatusByDriverId = (driverId) => request({
url: 'api/v3/manager/status/device/driverId/' + driverId,
url: 'api/v3/manager/status/device/driver_id/' + driverId,
method: 'get'
});
export const deviceStatusByProfileId = (profileId) => request({
url: 'api/v3/manager/status/device/profileId/' + profileId,
url: 'api/v3/manager/status/device/profile_id/' + profileId,
method: 'get'
});
+4 -4
View File
@@ -13,12 +13,12 @@ export const driverInfoUpdate = (driverInfo) => request({
});
export const driverInfoByAttributeIdAndDeviceId = (attributeId, deviceId) => request({
url: 'api/v3/manager/driver_info/attributeId/' + attributeId + '/deviceId/' + deviceId,
url: 'api/v3/manager/driver_info/attributeId/' + attributeId + '/device_id/' + deviceId,
method: 'get'
});
export const driverInfoByDeviceId = (deviceId) => request({
url: 'api/v3/manager/driver_info/deviceId/' + deviceId,
url: 'api/v3/manager/driver_info/device_id/' + deviceId,
method: 'get'
});
@@ -35,11 +35,11 @@ export const pointInfoUpdate = (pointInfo) => request({
});
export const pointInfoByDeviceIdAndPointId = (deviceId, pointId) => request({
url: 'api/v3/manager/point_info/deviceId/' + deviceId + '/pointId/' + pointId,
url: 'api/v3/manager/point_info/device_id/' + deviceId + '/pointId/' + pointId,
method: 'get'
});
export const pointInfoByDeviceId = (deviceId) => request({
url: 'api/v3/manager/point_info/deviceId/' + deviceId,
url: 'api/v3/manager/point_info/device_id/' + deviceId,
method: 'get'
});
+2 -2
View File
@@ -36,12 +36,12 @@ export const pointUnit = (pointIds) => request({
});
export const pointByProfileId = (profileId) => request({
url: 'api/v3/manager/point/profileId/' + profileId,
url: 'api/v3/manager/point/profile_id/' + profileId,
method: 'get'
});
export const pointByDeviceId = (deviceId) => request({
url: 'api/v3/manager/point/deviceId/' + deviceId,
url: 'api/v3/manager/point/device_id/' + deviceId,
method: 'get'
});
+1 -1
View File
@@ -23,7 +23,7 @@ export const profileById = (id) => request({
});
export const profileByDeviceId = (deviceId) => request({
url: 'api/v3/manager/profile/deviceId/' + deviceId,
url: 'api/v3/manager/profile/device_id/' + deviceId,
method: 'get'
});
-11
View File
@@ -142,17 +142,6 @@
this.status();
this.profiles();
this.points();
this.interval1 = setInterval(() => {
this.device();
this.status();
this.profiles();
this.points();
}, 60000);
this.interval2 = setInterval(() => {
this.pointValues();
}, 5000);
},
beforeRouteLeave(to, from, next) {
if (this.interval1) {
-5
View File
@@ -64,11 +64,6 @@
this.driver();
this.profile();
this.list();
this.interval = setInterval(() => {
this.driver();
this.profile();
this.list();
}, 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-6
View File
@@ -56,12 +56,6 @@
this.device();
this.drivers();
this.profiles();
this.interval = setInterval(() => {
this.driver();
this.device();
this.drivers();
this.profiles();
}, 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-1
View File
@@ -46,7 +46,6 @@
},
created() {
this.list();
this.interval = setInterval(() => this.list(), 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-1
View File
@@ -57,7 +57,6 @@
this.device();
this.drivers();
this.profiles();
this.interval = setInterval(() => this.device(), 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-1
View File
@@ -46,7 +46,6 @@
},
created() {
this.list();
this.interval = setInterval(() => this.list(), 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-1
View File
@@ -56,7 +56,6 @@
this.device();
this.drivers();
this.profiles();
this.interval = setInterval(() => this.device(), 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-4
View File
@@ -80,10 +80,6 @@
created() {
this.profile();
this.list();
this.interval = setInterval(() => {
this.profile();
this.list();
}, 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-5
View File
@@ -54,11 +54,6 @@
this.device();
this.point();
this.list();
this.interval = setInterval(() => {
this.device();
this.point();
this.list();
}, 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-7
View File
@@ -71,13 +71,6 @@
this.point();
this.drivers();
this.profiles();
this.interval = setInterval(() => {
this.profile();
this.device();
this.point();
this.drivers();
this.profiles();
}, 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
-4
View File
@@ -55,10 +55,6 @@
created() {
this.point();
this.list();
this.interval = setInterval(() => {
this.point();
this.list();
}, 60000);
},
beforeRouteLeave(to, from, next) {
if (this.interval) {
+2104 -2099
View File
File diff suppressed because it is too large Load Diff