【类 型】:docs
【原 因】:删除测试文件 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
0d76b301b9
commit
963813ec0b
@ -45,12 +45,6 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/demo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/main/login",
|
||||
"style": {
|
||||
|
@ -1,54 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="section">
|
||||
<text>MQTT 连接测试</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mqtt from 'mqtt'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
client: null, // mqtt连接 对象
|
||||
host: 'wxs://szdot.top', // mqtt服务器地址
|
||||
options: { // mqtt服务器 参数配置
|
||||
port: 8083,
|
||||
connectTimeout: 3000,
|
||||
clientId: 'uni_cl',
|
||||
clean: true,
|
||||
keepalive: 60,
|
||||
username: 'admin',
|
||||
password: '123456'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
try{
|
||||
this.client = mqtt.connect(this.host, this.options)
|
||||
setTimeout(()=> {
|
||||
this.client.publish('demo','hello world', {
|
||||
qos: 2
|
||||
})
|
||||
}, 3000);
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user