当前位置: 首页 > news >正文

建立个人免费网站专门做简历的网站有哪些

建立个人免费网站,专门做简历的网站有哪些,seo策略,三星网上商城退款什么#xff1f;打包空白#xff1f;分享一下我的解决方法#xff01; 第一步 找大师算过了#xff0c;装4.1版本运气好#xff01; 所以根目录执行命令… npm install mqtt4.1.0第二步 自己封装一个mqtt文件方便后期开坛做法#xff01; // utils/mqtt.js import mqt…什么打包空白分享一下我的解决方法 第一步 找大师算过了装4.1版本运气好 所以根目录执行命令… npm install mqtt4.1.0第二步 自己封装一个mqtt文件方便后期开坛做法 // utils/mqtt.js import mqtt from mqtt/dist/mqttclass MQTTClient {constructor() {this.client nullthis.subscriptions new Map()this.reconnectTimer nullthis.config {host: mqtt://your-broker.com,options: {clientId: uni-app- Date.now(),keepalive: 60,clean: true,reconnectPeriod: 5000}}}init() {if (!this.client) {this.connect()}}connect() {this.client mqtt.connect(this.config.host, this.config.options)this.client.on(connect, () {console.log(MQTT Connected)this.resubscribe()})this.client.on(message, (topic, message) {this.handleMessage(topic, message)})this.client.on(error, (err) {console.error(MQTT Error:, err)})this.client.on(close, () {console.log(MQTT Connection closed)this.scheduleReconnect()})}subscribe(topic, callback) {if (!this.subscriptions.has(topic)) {this.subscriptions.set(topic, new Set())if (this.client?.connected) {this.client.subscribe(topic)}}this.subscriptions.get(topic).add(callback)}unsubscribe(topic, callback) {if (this.subscriptions.has(topic)) {const callbacks this.subscriptions.get(topic)callbacks.delete(callback)if (callbacks.size 0) {this.subscriptions.delete(topic)if (this.client?.connected) {this.client.unsubscribe(topic)}}}}handleMessage(topic, message) {if (this.subscriptions.has(topic)) {const callbacks this.subscriptions.get(topic)callbacks.forEach(cb cb(message.toString()))}}resubscribe() {if (this.client?.connected) {const topics Array.from(this.subscriptions.keys())if (topics.length 0) {this.client.subscribe(topics)}}}scheduleReconnect() {if (!this.reconnectTimer) {this.reconnectTimer setTimeout(() {this.reconnectTimer nullthis.connect()}, 5000)}}destroy() {if (this.client) {this.client.end()this.client null}this.subscriptions.clear()clearTimeout(this.reconnectTimer)} }export const mqttClient new MQTTClient()第三步 打开 main.js 文件 思量前后觉得还是全局挂载吧 import mqtt from /mqtt/dist/mqtt.js app.config.globalProperties.$mqtt mqtt;第四步 打开这个mqtt.js修改源码注意不是你自己创建的mqtt.js是安装的依赖库文件路径在根目的node_modules/mqtt/dist里面 然后把里面的代码修改看图要改2行源码使用的是 wx.connectSocket修改之后uni.connectSocket 最后要加上 complete:(){}, 别问为什么一问你就输了 第五步 到这里已经可以使用了不信你打包一下app试下自定义基座也是没问题的 下面是我的使用代码 templateview收到的MQTT内容{{msg}}/view /templatescriptexport default {name: wang-mqtt,data() {return {msg: 初始化mqtt}},created() {// 连接配置let myOptions {clientId: uni-app- Date.now(),keepalive: 60,clean: true,reconnectPeriod: 5000}let ip // #ifdef H5ip ws://你的IP:8083/mqtt// #endif// #ifdef APP-PLUSip wx://你的IP:8083/mqtt// #endif// 创建 MQTT 客户端const client this.$mqtt.connect(ip, myOptions);// 订阅主题client.subscribe(app_xxdg/topic, (err) {if (!err) console.log(成功已订阅主题);});// 监听消息client.on(message, (topic, message) {this.msg message.toString()console.log(收到消息, message.toString());});},methods: {}} /script style /style
http://www.w-s-a.com/news/424568/

相关文章:

  • 北京沙河教做网站的企业融资以什么为基础
  • 给网站添加百度地图绵阳做绵阳做网站网站
  • 用电脑做服务器制作网站东莞营销网站建设
  • 网站需要怎么做wordpress 重装
  • 做电影网站赚钱的方法世界500强企业排名2023
  • 领卷网站怎么做的西宁设计网站建设
  • 东莞网站建设价位软件开发税率是13%还是6
  • 企业网站建设一条龙如何在网上推广自己
  • 成品网站制作公司企梦网站建设
  • 网站开发微信授权登录ftp 如何 更新 wordpress
  • icp备案和网站不符查询公司的网站备案
  • 万江营销型网站建设泰安网站建设制作电话号码
  • 做网站是用ps还是ai服饰东莞网站建设
  • 只做一页的网站多少钱网站开发就业趋势
  • 陈村网站建设有哪些网站可以做店面设计
  • 查询网站注册信息wordpress 照片墙
  • 成都网站设计服务商室内设计设计师网站推荐
  • 企业建站系统cms百度网址ip
  • wordpress 代码编辑插件下载搜索引擎优化seo课程总结
  • 韩都衣舍网站建设的改进邯郸公众号小程序制作
  • 上海设计网站建设在线视频制作
  • 东营高端网站建设新建网站如何让百度收录
  • wordpress怎么生成网站地图微网站平台怎样做网站
  • 同安区建设局网站招投标公众号简介有趣的文案
  • 江苏州 网站制作网上宣传方法有哪些
  • 做网站时怎样申请域名郑州制作网站公司
  • 深圳 网站开发公司电话网站关键词快排名
  • 网站建设的工作总结seo同行网站
  • 网站需要兼容哪些浏览器sql数据库做的网站怎么发布
  • 营销型网站的建站步骤是什么意思广州门户网站建设公司