mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
发布v1.1版本
This commit is contained in:
44
vue/src/api/iot/alert.js
Normal file
44
vue/src/api/iot/alert.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备告警列表
|
||||
export function listAlert(query) {
|
||||
return request({
|
||||
url: '/iot/alert/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备告警详细
|
||||
export function getAlert(alertId) {
|
||||
return request({
|
||||
url: '/iot/alert/' + alertId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备告警
|
||||
export function addAlert(data) {
|
||||
return request({
|
||||
url: '/iot/alert',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备告警
|
||||
export function updateAlert(data) {
|
||||
return request({
|
||||
url: '/iot/alert',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备告警
|
||||
export function delAlert(alertId) {
|
||||
return request({
|
||||
url: '/iot/alert/' + alertId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/alertLog.js
Normal file
44
vue/src/api/iot/alertLog.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备告警列表
|
||||
export function listAlertLog(query) {
|
||||
return request({
|
||||
url: '/iot/alertLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备告警详细
|
||||
export function getAlertLog(alertLogId) {
|
||||
return request({
|
||||
url: '/iot/alertLog/' + alertLogId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备告警
|
||||
export function addAlertLog(data) {
|
||||
return request({
|
||||
url: '/iot/alertLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备告警
|
||||
export function updateAlertLog(data) {
|
||||
return request({
|
||||
url: '/iot/alertLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备告警
|
||||
export function delAlertLog(alertLogId) {
|
||||
return request({
|
||||
url: '/iot/alertLog/' + alertLogId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
52
vue/src/api/iot/category.js
Normal file
52
vue/src/api/iot/category.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品分类列表
|
||||
export function listCategory(query) {
|
||||
return request({
|
||||
url: '/iot/category/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品简短分类列表
|
||||
export function listShortCategory() {
|
||||
return request({
|
||||
url: '/iot/category/shortlist',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品分类详细
|
||||
export function getCategory(categoryId) {
|
||||
return request({
|
||||
url: '/iot/category/' + categoryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增产品分类
|
||||
export function addCategory(data) {
|
||||
return request({
|
||||
url: '/iot/category',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改产品分类
|
||||
export function updateCategory(data) {
|
||||
return request({
|
||||
url: '/iot/category',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品分类
|
||||
export function delCategory(categoryId) {
|
||||
return request({
|
||||
url: '/iot/category/' + categoryId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/clientDetails.js
Normal file
44
vue/src/api/iot/clientDetails.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询云云对接列表
|
||||
export function listClientDetails(query) {
|
||||
return request({
|
||||
url: '/iot/clientDetails/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询云云对接详细
|
||||
export function getClientDetails(clientId) {
|
||||
return request({
|
||||
url: '/iot/clientDetails/' + clientId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增云云对接
|
||||
export function addClientDetails(data) {
|
||||
return request({
|
||||
url: '/iot/clientDetails',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改云云对接
|
||||
export function updateClientDetails(data) {
|
||||
return request({
|
||||
url: '/iot/clientDetails',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除云云对接
|
||||
export function delClientDetails(clientId) {
|
||||
return request({
|
||||
url: '/iot/clientDetails/' + clientId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
85
vue/src/api/iot/device.js
Normal file
85
vue/src/api/iot/device.js
Normal file
@@ -0,0 +1,85 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备列表
|
||||
export function listDevice(query) {
|
||||
return request({
|
||||
url: '/iot/device/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备简短列表
|
||||
export function listDeviceShort(query) {
|
||||
return request({
|
||||
url: '/iot/device/shortList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有设备简短列表
|
||||
export function listAllDeviceShort() {
|
||||
return request({
|
||||
url: '/iot/device/all',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备详细
|
||||
export function getDevice(deviceId) {
|
||||
return request({
|
||||
url: '/iot/device/' + deviceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备运行状态详细
|
||||
export function getDeviceRunningStatus(deviceId) {
|
||||
return request({
|
||||
url: '/iot/device/runningStatus/' + deviceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备物模型的值
|
||||
export function getDeviceThingsModelValue(deviceId) {
|
||||
return request({
|
||||
url: '/iot/device/thingsModelValue/' + deviceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备
|
||||
export function addDevice(data) {
|
||||
return request({
|
||||
url: '/iot/device',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备
|
||||
export function updateDevice(data) {
|
||||
return request({
|
||||
url: '/iot/device',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
export function delDevice(deviceId) {
|
||||
return request({
|
||||
url: '/iot/device/' + deviceId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 生成设备编号
|
||||
export function generatorDeviceNum() {
|
||||
return request({
|
||||
url: '/iot/device/generator',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
71
vue/src/api/iot/deviceJob.js
Normal file
71
vue/src/api/iot/deviceJob.js
Normal file
@@ -0,0 +1,71 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询定时任务调度列表
|
||||
export function listJob(query) {
|
||||
return request({
|
||||
url: '/iot/job/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询定时任务调度详细
|
||||
export function getJob(jobId) {
|
||||
return request({
|
||||
url: '/iot/job/' + jobId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增定时任务调度
|
||||
export function addJob(data) {
|
||||
return request({
|
||||
url: '/iot/job',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改定时任务调度
|
||||
export function updateJob(data) {
|
||||
return request({
|
||||
url: '/iot/job',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除定时任务调度
|
||||
export function delJob(jobId) {
|
||||
return request({
|
||||
url: '/iot/job/' + jobId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export function changeJobStatus(jobId, status) {
|
||||
const data = {
|
||||
jobId,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/iot/job/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 定时任务立即执行一次
|
||||
export function runJob(jobId, jobGroup) {
|
||||
const data = {
|
||||
jobId,
|
||||
jobGroup
|
||||
}
|
||||
return request({
|
||||
url: '/iot/job/run',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
53
vue/src/api/iot/deviceLog.js
Normal file
53
vue/src/api/iot/deviceLog.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备日志列表
|
||||
export function listDeviceLog(query) {
|
||||
return request({
|
||||
url: '/iot/deviceLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备监测数据
|
||||
export function listMonitor(query) {
|
||||
return request({
|
||||
url: '/iot/deviceLog/monitor',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备日志详细
|
||||
export function getDeviceLog(logId) {
|
||||
return request({
|
||||
url: '/iot/deviceLog/' + logId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备日志
|
||||
export function addDeviceLog(data) {
|
||||
return request({
|
||||
url: '/iot/deviceLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备日志
|
||||
export function updateDeviceLog(data) {
|
||||
return request({
|
||||
url: '/iot/deviceLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备日志
|
||||
export function delDeviceLog(logId) {
|
||||
return request({
|
||||
url: '/iot/deviceLog/' + logId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/deviceuser.js
Normal file
44
vue/src/api/iot/deviceuser.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备用户列表
|
||||
export function listDeviceUser(query) {
|
||||
return request({
|
||||
url: '/iot/deviceUser/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备用户详细
|
||||
export function getDeviceUser(deviceId) {
|
||||
return request({
|
||||
url: '/iot/deviceUser/' + deviceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备用户
|
||||
export function addDeviceUser(data) {
|
||||
return request({
|
||||
url: '/iot/deviceUser',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备用户
|
||||
export function updateDeviceUser(data) {
|
||||
return request({
|
||||
url: '/iot/deviceUser',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备用户
|
||||
export function delDeviceUser(deviceId) {
|
||||
return request({
|
||||
url: '/iot/deviceUser/' + deviceId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
124
vue/src/api/iot/emqx.js
Normal file
124
vue/src/api/iot/emqx.js
Normal file
@@ -0,0 +1,124 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const username = 'admin';
|
||||
const password = 'public';
|
||||
|
||||
// 集群下所有客户端列表
|
||||
export function listMqttClient(query) {
|
||||
var url = "/api/v4/clients";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 集群下所有订阅信息
|
||||
export function listMqttSubscribe(query) {
|
||||
var url = "/api/v4/subscriptions";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 集群下所有主题/路由信息
|
||||
export function listMqttTopic(query) {
|
||||
var url = "/api/v4/routes";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 集群下所有插件信息
|
||||
export function listMqttPlugin() {
|
||||
var url = "/api/v4/plugins";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 加载指定节点的指定插件
|
||||
export function loadMqttPlugin(node,plugin) {
|
||||
var url = "/api/v4/nodes/"+node+"/plugins/"+plugin+"/load";
|
||||
return axios({
|
||||
method: 'put',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 卸载指定节点的指定插件
|
||||
export function unloadMqttPlugin(node,plugin) {
|
||||
var url = "/api/v4/nodes/"+node+"/plugins/"+plugin+"/unload";
|
||||
return axios({
|
||||
method: 'put',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 集群下所有监听器信息
|
||||
export function listMqttListener() {
|
||||
var url = "/api/v4/listeners";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 集群下所有统计指标数据
|
||||
export function statisticMqtt() {
|
||||
var url = "/api/v4/metrics";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 集群下所有状态数据
|
||||
export function getMqttStats() {
|
||||
var url = "/api/v4/stats";
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
auth: {
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/firmware.js
Normal file
44
vue/src/api/iot/firmware.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品固件列表
|
||||
export function listFirmware(query) {
|
||||
return request({
|
||||
url: '/iot/firmware/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品固件详细
|
||||
export function getFirmware(firmwareId) {
|
||||
return request({
|
||||
url: '/iot/firmware/' + firmwareId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增产品固件
|
||||
export function addFirmware(data) {
|
||||
return request({
|
||||
url: '/iot/firmware',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改产品固件
|
||||
export function updateFirmware(data) {
|
||||
return request({
|
||||
url: '/iot/firmware',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品固件
|
||||
export function delFirmware(firmwareId) {
|
||||
return request({
|
||||
url: '/iot/firmware/' + firmwareId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
61
vue/src/api/iot/group.js
Normal file
61
vue/src/api/iot/group.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备分组列表
|
||||
export function listGroup(query) {
|
||||
return request({
|
||||
url: '/iot/group/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备分组详细
|
||||
export function getGroup(groupId) {
|
||||
return request({
|
||||
url: '/iot/group/' + groupId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询分组下的关联设备ID数组
|
||||
export function getDeviceIds(groupId) {
|
||||
return request({
|
||||
url: '/iot/group/getDeviceIds/' + groupId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备分组
|
||||
export function addGroup(data) {
|
||||
return request({
|
||||
url: '/iot/group',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备分组
|
||||
export function updateGroup(data) {
|
||||
return request({
|
||||
url: '/iot/group',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新分组下的设备
|
||||
export function updateDeviceGroups(data) {
|
||||
return request({
|
||||
url: '/iot/group/updateDeviceGroups',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备分组
|
||||
export function delGroup(groupId) {
|
||||
return request({
|
||||
url: '/iot/group/' + groupId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/log.js
Normal file
44
vue/src/api/iot/log.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备日志列表
|
||||
export function listLog(query) {
|
||||
return request({
|
||||
url: '/iot/log/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备日志详细
|
||||
export function getLog(deviceLogId) {
|
||||
return request({
|
||||
url: '/iot/log/' + deviceLogId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备日志
|
||||
export function addLog(data) {
|
||||
return request({
|
||||
url: '/iot/log',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备日志
|
||||
export function updateLog(data) {
|
||||
return request({
|
||||
url: '/iot/log',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备日志
|
||||
export function delLog(deviceLogId) {
|
||||
return request({
|
||||
url: '/iot/log/' + deviceLogId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
61
vue/src/api/iot/model.js
Normal file
61
vue/src/api/iot/model.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询物模型列表
|
||||
export function listModel(query) {
|
||||
return request({
|
||||
url: '/iot/model/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询物模型详细
|
||||
export function getModel(modelId) {
|
||||
return request({
|
||||
url: '/iot/model/' + modelId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增物模型
|
||||
export function addModel(data) {
|
||||
return request({
|
||||
url: '/iot/model',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导入通用物模型
|
||||
export function importModel(data) {
|
||||
return request({
|
||||
url: '/iot/model/import',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改物模型
|
||||
export function updateModel(data) {
|
||||
return request({
|
||||
url: '/iot/model',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物模型
|
||||
export function delModel(modelId) {
|
||||
return request({
|
||||
url: '/iot/model/' + modelId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据产品ID获取缓存的物模型
|
||||
export function cacheJsonThingsModel(productId){
|
||||
return request({
|
||||
url: '/iot/model/cache/' + productId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
61
vue/src/api/iot/product.js
Normal file
61
vue/src/api/iot/product.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品列表
|
||||
export function listProduct(query) {
|
||||
return request({
|
||||
url: '/iot/product/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品列表
|
||||
export function listShortProduct() {
|
||||
return request({
|
||||
url: '/iot/product/shortList',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品详细
|
||||
export function getProduct(productId) {
|
||||
return request({
|
||||
url: '/iot/product/' + productId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增产品
|
||||
export function addProduct(data) {
|
||||
return request({
|
||||
url: '/iot/product',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改产品
|
||||
export function updateProduct(data) {
|
||||
return request({
|
||||
url: '/iot/product',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新产品状态
|
||||
export function changeProductStatus(data) {
|
||||
return request({
|
||||
url: '/iot/product/status/',
|
||||
method: 'put',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品
|
||||
export function delProduct(productId) {
|
||||
return request({
|
||||
url: '/iot/product/' + productId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/scene.js
Normal file
44
vue/src/api/iot/scene.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询场景联动列表
|
||||
export function listScene(query) {
|
||||
return request({
|
||||
url: '/iot/scene/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询场景联动详细
|
||||
export function getScene(sceneId) {
|
||||
return request({
|
||||
url: '/iot/scene/' + sceneId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增场景联动
|
||||
export function addScene(data) {
|
||||
return request({
|
||||
url: '/iot/scene',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改场景联动
|
||||
export function updateScene(data) {
|
||||
return request({
|
||||
url: '/iot/scene',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除场景联动
|
||||
export function delScene(sceneId) {
|
||||
return request({
|
||||
url: '/iot/scene/' + sceneId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/iot/template.js
Normal file
44
vue/src/api/iot/template.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询通用物模型列表
|
||||
export function listTemplate(query) {
|
||||
return request({
|
||||
url: '/iot/template/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询通用物模型详细
|
||||
export function getTemplate(templateId) {
|
||||
return request({
|
||||
url: '/iot/template/' + templateId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增通用物模型
|
||||
export function addTemplate(data) {
|
||||
return request({
|
||||
url: '/iot/template',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改通用物模型
|
||||
export function updateTemplate(data) {
|
||||
return request({
|
||||
url: '/iot/template',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除通用物模型
|
||||
export function delTemplate(templateId) {
|
||||
return request({
|
||||
url: '/iot/template/' + templateId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
39
vue/src/api/iot/tool.js
Normal file
39
vue/src/api/iot/tool.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
import axios from 'axios'
|
||||
import { Message } from 'element-ui'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { blobValidate } from "@/utils/ruoyi";
|
||||
|
||||
const baseURL = process.env.VUE_APP_BASE_API;
|
||||
|
||||
// 注册方法
|
||||
export function register(data) {
|
||||
return request({
|
||||
url: '/iot/tool/register',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 下载文件
|
||||
export function download(resource) {
|
||||
var url = baseURL + "/iot/tool/download?fileName=" + encodeURI(resource);
|
||||
axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||
}).then(async (res) => {
|
||||
const isLogin = await blobValidate(res.data);
|
||||
if (isLogin) {
|
||||
const blob = new Blob([res.data])
|
||||
saveAs(blob, decodeURI(res.headers['download-filename']))
|
||||
} else {
|
||||
Message.error('无效的会话,或者会话已过期,请重新登录。');
|
||||
}
|
||||
})
|
||||
}
|
||||
59
vue/src/api/login.js
Normal file
59
vue/src/api/login.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 登录方法
|
||||
export function login(username, password, code, uuid) {
|
||||
const data = {
|
||||
username,
|
||||
password,
|
||||
code,
|
||||
uuid
|
||||
}
|
||||
return request({
|
||||
url: '/login',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 注册方法
|
||||
export function register(data) {
|
||||
return request({
|
||||
url: '/register',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户详细信息
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: '/getInfo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 退出方法
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/logout',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
export function getCodeImg() {
|
||||
return request({
|
||||
url: '/captchaImage',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'get',
|
||||
timeout: 20000
|
||||
})
|
||||
}
|
||||
9
vue/src/api/menu.js
Normal file
9
vue/src/api/menu.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取路由
|
||||
export const getRouters = () => {
|
||||
return request({
|
||||
url: '/getRouters',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
9
vue/src/api/monitor/cache.js
Normal file
9
vue/src/api/monitor/cache.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询缓存详细
|
||||
export function getCache() {
|
||||
return request({
|
||||
url: '/monitor/cache',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
71
vue/src/api/monitor/job.js
Normal file
71
vue/src/api/monitor/job.js
Normal file
@@ -0,0 +1,71 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询定时任务调度列表
|
||||
export function listJob(query) {
|
||||
return request({
|
||||
url: '/monitor/job/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询定时任务调度详细
|
||||
export function getJob(jobId) {
|
||||
return request({
|
||||
url: '/monitor/job/' + jobId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增定时任务调度
|
||||
export function addJob(data) {
|
||||
return request({
|
||||
url: '/monitor/job',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改定时任务调度
|
||||
export function updateJob(data) {
|
||||
return request({
|
||||
url: '/monitor/job',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除定时任务调度
|
||||
export function delJob(jobId) {
|
||||
return request({
|
||||
url: '/monitor/job/' + jobId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export function changeJobStatus(jobId, status) {
|
||||
const data = {
|
||||
jobId,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/monitor/job/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 定时任务立即执行一次
|
||||
export function runJob(jobId, jobGroup) {
|
||||
const data = {
|
||||
jobId,
|
||||
jobGroup
|
||||
}
|
||||
return request({
|
||||
url: '/monitor/job/run',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
26
vue/src/api/monitor/jobLog.js
Normal file
26
vue/src/api/monitor/jobLog.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询调度日志列表
|
||||
export function listJobLog(query) {
|
||||
return request({
|
||||
url: '/monitor/jobLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除调度日志
|
||||
export function delJobLog(jobLogId) {
|
||||
return request({
|
||||
url: '/monitor/jobLog/' + jobLogId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 清空调度日志
|
||||
export function cleanJobLog() {
|
||||
return request({
|
||||
url: '/monitor/jobLog/clean',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
26
vue/src/api/monitor/logininfor.js
Normal file
26
vue/src/api/monitor/logininfor.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询登录日志列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/monitor/logininfor/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除登录日志
|
||||
export function delLogininfor(infoId) {
|
||||
return request({
|
||||
url: '/monitor/logininfor/' + infoId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 清空登录日志
|
||||
export function cleanLogininfor() {
|
||||
return request({
|
||||
url: '/monitor/logininfor/clean',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
18
vue/src/api/monitor/online.js
Normal file
18
vue/src/api/monitor/online.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询在线用户列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/monitor/online/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 强退用户
|
||||
export function forceLogout(tokenId) {
|
||||
return request({
|
||||
url: '/monitor/online/' + tokenId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
26
vue/src/api/monitor/operlog.js
Normal file
26
vue/src/api/monitor/operlog.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询操作日志列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/monitor/operlog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除操作日志
|
||||
export function delOperlog(operId) {
|
||||
return request({
|
||||
url: '/monitor/operlog/' + operId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 清空操作日志
|
||||
export function cleanOperlog() {
|
||||
return request({
|
||||
url: '/monitor/operlog/clean',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
9
vue/src/api/monitor/server.js
Normal file
9
vue/src/api/monitor/server.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取服务信息
|
||||
export function getServer() {
|
||||
return request({
|
||||
url: '/monitor/server',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
60
vue/src/api/system/config.js
Normal file
60
vue/src/api/system/config.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询参数列表
|
||||
export function listConfig(query) {
|
||||
return request({
|
||||
url: '/system/config/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询参数详细
|
||||
export function getConfig(configId) {
|
||||
return request({
|
||||
url: '/system/config/' + configId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据参数键名查询参数值
|
||||
export function getConfigKey(configKey) {
|
||||
return request({
|
||||
url: '/system/config/configKey/' + configKey,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增参数配置
|
||||
export function addConfig(data) {
|
||||
return request({
|
||||
url: '/system/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改参数配置
|
||||
export function updateConfig(data) {
|
||||
return request({
|
||||
url: '/system/config',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除参数配置
|
||||
export function delConfig(configId) {
|
||||
return request({
|
||||
url: '/system/config/' + configId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新参数缓存
|
||||
export function refreshCache() {
|
||||
return request({
|
||||
url: '/system/config/refreshCache',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
68
vue/src/api/system/dept.js
Normal file
68
vue/src/api/system/dept.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询部门列表
|
||||
export function listDept(query) {
|
||||
return request({
|
||||
url: '/system/dept/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门列表(排除节点)
|
||||
export function listDeptExcludeChild(deptId) {
|
||||
return request({
|
||||
url: '/system/dept/list/exclude/' + deptId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门详细
|
||||
export function getDept(deptId) {
|
||||
return request({
|
||||
url: '/system/dept/' + deptId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门下拉树结构
|
||||
export function treeselect() {
|
||||
return request({
|
||||
url: '/system/dept/treeselect',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据角色ID查询部门树结构
|
||||
export function roleDeptTreeselect(roleId) {
|
||||
return request({
|
||||
url: '/system/dept/roleDeptTreeselect/' + roleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增部门
|
||||
export function addDept(data) {
|
||||
return request({
|
||||
url: '/system/dept',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改部门
|
||||
export function updateDept(data) {
|
||||
return request({
|
||||
url: '/system/dept',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除部门
|
||||
export function delDept(deptId) {
|
||||
return request({
|
||||
url: '/system/dept/' + deptId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
52
vue/src/api/system/dict/data.js
Normal file
52
vue/src/api/system/dict/data.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典数据列表
|
||||
export function listData(query) {
|
||||
return request({
|
||||
url: '/system/dict/data/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典数据详细
|
||||
export function getData(dictCode) {
|
||||
return request({
|
||||
url: '/system/dict/data/' + dictCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getDicts(dictType) {
|
||||
return request({
|
||||
url: '/system/dict/data/type/' + dictType,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典数据
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/system/dict/data',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典数据
|
||||
export function updateData(data) {
|
||||
return request({
|
||||
url: '/system/dict/data',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典数据
|
||||
export function delData(dictCode) {
|
||||
return request({
|
||||
url: '/system/dict/data/' + dictCode,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
60
vue/src/api/system/dict/type.js
Normal file
60
vue/src/api/system/dict/type.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典类型列表
|
||||
export function listType(query) {
|
||||
return request({
|
||||
url: '/system/dict/type/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典类型详细
|
||||
export function getType(dictId) {
|
||||
return request({
|
||||
url: '/system/dict/type/' + dictId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典类型
|
||||
export function addType(data) {
|
||||
return request({
|
||||
url: '/system/dict/type',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典类型
|
||||
export function updateType(data) {
|
||||
return request({
|
||||
url: '/system/dict/type',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典类型
|
||||
export function delType(dictId) {
|
||||
return request({
|
||||
url: '/system/dict/type/' + dictId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新字典缓存
|
||||
export function refreshCache() {
|
||||
return request({
|
||||
url: '/system/dict/type/refreshCache',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取字典选择框列表
|
||||
export function optionselect() {
|
||||
return request({
|
||||
url: '/system/dict/type/optionselect',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
60
vue/src/api/system/menu.js
Normal file
60
vue/src/api/system/menu.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询菜单列表
|
||||
export function listMenu(query) {
|
||||
return request({
|
||||
url: '/system/menu/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询菜单详细
|
||||
export function getMenu(menuId) {
|
||||
return request({
|
||||
url: '/system/menu/' + menuId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询菜单下拉树结构
|
||||
export function treeselect() {
|
||||
return request({
|
||||
url: '/system/menu/treeselect',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据角色ID查询菜单下拉树结构
|
||||
export function roleMenuTreeselect(roleId) {
|
||||
return request({
|
||||
url: '/system/menu/roleMenuTreeselect/' + roleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增菜单
|
||||
export function addMenu(data) {
|
||||
return request({
|
||||
url: '/system/menu',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改菜单
|
||||
export function updateMenu(data) {
|
||||
return request({
|
||||
url: '/system/menu',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除菜单
|
||||
export function delMenu(menuId) {
|
||||
return request({
|
||||
url: '/system/menu/' + menuId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/system/notice.js
Normal file
44
vue/src/api/system/notice.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询公告列表
|
||||
export function listNotice(query) {
|
||||
return request({
|
||||
url: '/system/notice/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询公告详细
|
||||
export function getNotice(noticeId) {
|
||||
return request({
|
||||
url: '/system/notice/' + noticeId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增公告
|
||||
export function addNotice(data) {
|
||||
return request({
|
||||
url: '/system/notice',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改公告
|
||||
export function updateNotice(data) {
|
||||
return request({
|
||||
url: '/system/notice',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公告
|
||||
export function delNotice(noticeId) {
|
||||
return request({
|
||||
url: '/system/notice/' + noticeId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
vue/src/api/system/post.js
Normal file
44
vue/src/api/system/post.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询岗位列表
|
||||
export function listPost(query) {
|
||||
return request({
|
||||
url: '/system/post/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询岗位详细
|
||||
export function getPost(postId) {
|
||||
return request({
|
||||
url: '/system/post/' + postId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增岗位
|
||||
export function addPost(data) {
|
||||
return request({
|
||||
url: '/system/post',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改岗位
|
||||
export function updatePost(data) {
|
||||
return request({
|
||||
url: '/system/post',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除岗位
|
||||
export function delPost(postId) {
|
||||
return request({
|
||||
url: '/system/post/' + postId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
111
vue/src/api/system/role.js
Normal file
111
vue/src/api/system/role.js
Normal file
@@ -0,0 +1,111 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询角色列表
|
||||
export function listRole(query) {
|
||||
return request({
|
||||
url: '/system/role/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询角色详细
|
||||
export function getRole(roleId) {
|
||||
return request({
|
||||
url: '/system/role/' + roleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增角色
|
||||
export function addRole(data) {
|
||||
return request({
|
||||
url: '/system/role',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改角色
|
||||
export function updateRole(data) {
|
||||
return request({
|
||||
url: '/system/role',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 角色数据权限
|
||||
export function dataScope(data) {
|
||||
return request({
|
||||
url: '/system/role/dataScope',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 角色状态修改
|
||||
export function changeRoleStatus(roleId, status) {
|
||||
const data = {
|
||||
roleId,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/system/role/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除角色
|
||||
export function delRole(roleId) {
|
||||
return request({
|
||||
url: '/system/role/' + roleId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询角色已授权用户列表
|
||||
export function allocatedUserList(query) {
|
||||
return request({
|
||||
url: '/system/role/authUser/allocatedList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询角色未授权用户列表
|
||||
export function unallocatedUserList(query) {
|
||||
return request({
|
||||
url: '/system/role/authUser/unallocatedList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 取消用户授权角色
|
||||
export function authUserCancel(data) {
|
||||
return request({
|
||||
url: '/system/role/authUser/cancel',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 批量取消用户授权角色
|
||||
export function authUserCancelAll(data) {
|
||||
return request({
|
||||
url: '/system/role/authUser/cancelAll',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 授权用户选择
|
||||
export function authUserSelectAll(data) {
|
||||
return request({
|
||||
url: '/system/role/authUser/selectAll',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
127
vue/src/api/system/user.js
Normal file
127
vue/src/api/system/user.js
Normal file
@@ -0,0 +1,127 @@
|
||||
import request from '@/utils/request'
|
||||
import { praseStrEmpty } from "@/utils/ruoyi";
|
||||
|
||||
// 查询用户列表
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户详细
|
||||
export function getUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + praseStrEmpty(userId),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
export function delUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + userId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd(userId, password) {
|
||||
const data = {
|
||||
userId,
|
||||
password
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/resetPwd',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus(userId, status) {
|
||||
const data = {
|
||||
userId,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) {
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/avatar',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询授权角色
|
||||
export function getAuthRole(userId) {
|
||||
return request({
|
||||
url: '/system/user/authRole/' + userId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 保存授权角色
|
||||
export function updateAuthRole(data) {
|
||||
return request({
|
||||
url: '/system/user/authRole',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
76
vue/src/api/tool/gen.js
Normal file
76
vue/src/api/tool/gen.js
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询生成表数据
|
||||
export function listTable(query) {
|
||||
return request({
|
||||
url: '/tool/gen/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询db数据库列表
|
||||
export function listDbTable(query) {
|
||||
return request({
|
||||
url: '/tool/gen/db/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询表详细信息
|
||||
export function getGenTable(tableId) {
|
||||
return request({
|
||||
url: '/tool/gen/' + tableId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改代码生成信息
|
||||
export function updateGenTable(data) {
|
||||
return request({
|
||||
url: '/tool/gen',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导入表
|
||||
export function importTable(data) {
|
||||
return request({
|
||||
url: '/tool/gen/importTable',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export function previewTable(tableId) {
|
||||
return request({
|
||||
url: '/tool/gen/preview/' + tableId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除表数据
|
||||
export function delTable(tableId) {
|
||||
return request({
|
||||
url: '/tool/gen/' + tableId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 生成代码(自定义路径)
|
||||
export function genCode(tableName) {
|
||||
return request({
|
||||
url: '/tool/gen/genCode/' + tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 同步数据库
|
||||
export function synchDb(tableName) {
|
||||
return request({
|
||||
url: '/tool/gen/synchDb/' + tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user