页面接口推介
This commit is contained in:
@@ -87,3 +87,26 @@ export const queryTopologyDiagram = (devId) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 设备扫码移交
|
||||
|
||||
export const transferDevice = (id) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/deviceUser/transfer',
|
||||
method: 'POST',
|
||||
data: {
|
||||
eid:id,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 设备删除
|
||||
|
||||
export const deleteDevice = (id) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/deviceUser/delete',
|
||||
method: 'POST',
|
||||
data: {
|
||||
eid:id,
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import request from '../js/request';
|
||||
import config from '../js/config';
|
||||
import request from '../js/request'
|
||||
import config from '../js/config'
|
||||
|
||||
export function addEngineering(params) {
|
||||
return request({
|
||||
@@ -9,10 +9,9 @@ export function addEngineering(params) {
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function auditEngineering(params) {
|
||||
return request({
|
||||
url: '/cs-device-boot/engineering/auditEngineering',
|
||||
@@ -21,7 +20,7 @@ export function auditEngineering(params) {
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function queryEngineering(params) {
|
||||
@@ -32,5 +31,20 @@ export function queryEngineering(params) {
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工程
|
||||
export function deleteEngineering(id) {
|
||||
return request({
|
||||
url: '/cs-device-boot/engineering/auditEngineering',
|
||||
method: 'post',
|
||||
data: {
|
||||
id: id,
|
||||
status: 0,
|
||||
},
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,6 +11,17 @@ export function addAppProject(params, files) {
|
||||
formData: params,
|
||||
})
|
||||
}
|
||||
// 修改项目
|
||||
export function updateAppProject(params, files) {
|
||||
return uni.uploadFile({
|
||||
url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
|
||||
files: files,
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('access_token'),
|
||||
},
|
||||
formData: params,
|
||||
})
|
||||
}
|
||||
|
||||
export function getProjectList(params) {
|
||||
return request({
|
||||
@@ -23,6 +34,18 @@ export function getProjectList(params) {
|
||||
})
|
||||
}
|
||||
|
||||
// 删除项目
|
||||
export function deleteProject(id) {
|
||||
return request({
|
||||
url: '/cs-device-boot/project/auditAppProject',
|
||||
method: 'post',
|
||||
data: {
|
||||
id,
|
||||
status: 0,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 查询拓扑图
|
||||
|
||||
export function queryTopologyDiagramPage(params) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const debug = false // true 是连地服务端本地,false 是连接线上
|
||||
|
||||
const development = {
|
||||
domain: 'http://192.168.1.139:10215',
|
||||
domain: 'http://192.168.1.115:10215',
|
||||
}
|
||||
|
||||
const production = {
|
||||
|
||||
@@ -200,25 +200,42 @@ const prePage = () => {
|
||||
}
|
||||
|
||||
const loginSuccess = (data) => {
|
||||
console.log(data);
|
||||
console.log(data)
|
||||
uni.setStorageSync('access_token', data.token_type + ' ' + data.access_token)
|
||||
uni.setStorageSync('refresh_token', data.refresh_token)
|
||||
let strings = data.access_token.split('.') //截取token,获取载体
|
||||
console.log(escape,atob);
|
||||
console.log(escape, atob)
|
||||
var userInfo = JSON.parse(decodeURIComponent(escape(atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
|
||||
userInfo.authorities = userInfo.authorities[0]
|
||||
uni.setStorageSync('userInfo', userInfo)
|
||||
console.log('reLaunch');
|
||||
console.log('reLaunch')
|
||||
queryDictDataCache().then((res) => {
|
||||
uni.setStorageSync(cacheKey.dictData, res.data)
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
fail: (err) => {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(err)
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 只针对列表页的刷新
|
||||
* @param {*} number
|
||||
* @param {*} time
|
||||
*/
|
||||
const refreshPrePage = (number = 1, time = 1500) => {
|
||||
let pages = getCurrentPages()
|
||||
let prePage = pages[pages.length - number - 1]
|
||||
if (prePage && time) {
|
||||
prePage.$vm.store.reload()
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: number,
|
||||
})
|
||||
}, time)
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
validatePhoneNumber,
|
||||
@@ -230,4 +247,5 @@ export default {
|
||||
loadConfig,
|
||||
prePage,
|
||||
loginSuccess,
|
||||
refreshPrePage,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user