|
|
|
@ -3,7 +3,6 @@ import { airPortStore } from '@/store/modules/airport';
|
|
|
|
|
import errorCode from './error_code.json';
|
|
|
|
|
|
|
|
|
|
const airPortStoreVal = airPortStore();
|
|
|
|
|
const gateway = airPortStoreVal.getGateway;
|
|
|
|
|
export const debug_mode_openOptions = {
|
|
|
|
|
canceled: '取消或终止',
|
|
|
|
|
failed: '失败',
|
|
|
|
@ -35,39 +34,40 @@ export const errorName = (code) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export const servicesTopic = (data) => {
|
|
|
|
|
console.log(airPortStoreVal.getGateway);
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/services', data);
|
|
|
|
|
clientPublish('thing/product/' + airPortStoreVal.getGateway + '/services', data);
|
|
|
|
|
};
|
|
|
|
|
export const services_replyTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/services_reply');
|
|
|
|
|
clientSubscribe('thing/product/' + airPortStoreVal.getGateway + '/services_reply');
|
|
|
|
|
};
|
|
|
|
|
export const eventsTopic = (data) => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/events', data);
|
|
|
|
|
clientPublish('thing/product/' + airPortStoreVal.getGateway + '/events', data);
|
|
|
|
|
};
|
|
|
|
|
export const events_replyTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/events_reply');
|
|
|
|
|
clientSubscribe('thing/product/' + airPortStoreVal.getGateway + '/events_reply');
|
|
|
|
|
};
|
|
|
|
|
export const drcDownTopic = (data) => {
|
|
|
|
|
// 发送消息thing/product/{gateway_sn}/drc/down
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/drc/down', data);
|
|
|
|
|
clientPublish('thing/product/' + airPortStoreVal.getGateway + '/drc/down', data);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const eventsTopicSubscribe = () => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/events');
|
|
|
|
|
clientSubscribe('thing/product/' + airPortStoreVal.getGateway + '/events');
|
|
|
|
|
};
|
|
|
|
|
export const drcUpTopic = () => {
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/drc/up');
|
|
|
|
|
clientSubscribe('thing/product/' + airPortStoreVal.getGateway + '/drc/up');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setTopic = (data) => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/property/set', data);
|
|
|
|
|
clientPublish('thing/product/' + airPortStoreVal.getGateway + '/property/set', data);
|
|
|
|
|
};
|
|
|
|
|
export const set_replyTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/services_reply');
|
|
|
|
|
clientSubscribe('thing/product/' + airPortStoreVal.getGateway + '/services_reply');
|
|
|
|
|
};
|
|
|
|
|