uniapp 小程序低功耗蓝牙配网 blefi配网 物联网

1.获取蓝牙列表  bleList.vue

<template>
  <view>
    <button @touchstart="startSearch">获取蓝牙列表</button>
    <scroll-view :scroll-top="scrollTop" scroll-y class="content-pop">
      <view
        class="bluetoothItem"
        v-for="(item, index) in bluetoohList"
        :key="index"
        @click="openControl(item)"
      >
        <view class="textItem">蓝牙:{{ item.name }}</view>
        <view>{{ item.deviceId }}</view>
      </view>
    </scroll-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      bluetoohList: [],
    };
  },
  onLoad: function (options) {
    this.startSearch();
  },
  methods: {
    // 连接蓝牙
    startSearch() {
      var that = this;
      uni.openBluetoothAdapter({
        success: (res) => {
          uni.getBluetoothAdapterState({
            success: (res) => {
              if (res.available) {
                if (res.discovering) {
                  uni.stopBluetoothDevicesDiscovery({
                    success: (res) => {},
                  });
                } else {
                  that.getBluetoothDevices();
                }
                that.checkPemission();
              } else {
                uni.showToast({
                  title: "本机蓝牙不可用",
                  mask: true,
                });
              }
            },
          });
        },
        fail: (err) => {
          that.openSetting();
        },
      });
    },
    openSetting() {
      uni.showModal({
        title: "检测到您没打开蓝牙权限,是否去设置打开?",
        confirmText: "确认",
        cancelText: "取消",
        cancelColor: "#999999", //取消按钮颜色
        confirmColor: "#00A0E9", //确定按钮颜色
        success: (res) => {
          if (res.confirm) {
            uni.openSetting({
              //opensetting是调起设置页面的
              success: (res) => {
                if (res.authSetting == true) {
                  //判断res.authsetting的值是true还是false
                  uni.openBluetoothAdapter({
                    success: (res) => {
                      this.startSearch();
                    },
                  });
                }
              },
            });
          } else {
            // 取消
            return false;
          }
        },
      });
    },
    checkPemission() {
      //android 6.0以上需授权地理位置权限
      var that = this;
      const sys = uni.getSystemInfoSync();
      if (sys.platform == "ios") {
        that.getBluetoothDevices();
      } else if (sys.platform == "android") {
        console.log(
          app
            .getSystem()
            .substring(
              app.getSystem().length - (app.getSystem().length - 8),
              app.getSystem().length - (app.getSystem().length - 8) + 1
            )
        );
        if (
          app.globalData
            .getSystem()
            .substring(
              app.globalData.getSystem().length -
                (app.globalData.getSystem().length - 8),
              app.globalData.getSystem().length -
                (app.globalData.getSystem().length - 8) +
                1
            ) > 5
        ) {
          uni.getSetting({
            success: (res) => {
              console.log(res);
              if (!res.authSetting["scope.userLocation"]) {
                uni.authorize({
                  scope: "scope.userLocation",
                  complete: (res) => {
                    that.getBluetoothDevices();
                  },
                });
              } else {
                that.getBluetoothDevices();
              }
            },
          });
        }
      }
    },
    //获取蓝牙设备信息
    getBluetoothDevices() {
      var that = this;
      uni.showLoading({
        title: "蓝牙搜索中",
        mask: true,
      });
      // 开始搜寻附近的蓝牙外围设备
      uni.startBluetoothDevicesDiscovery({
        success: (res) => {
          setTimeout(() => {
            // 获取搜索到的设备信息
            uni.getBluetoothDevices({
              success: (res) => {
                that.bluetoohList = [];
                var num = 0;
                for (var i = 0; i < res.devices.length; ++i) {
                  if (res.devices[i].name != "未知设备") {
                    that.bluetoohList[num] = res.devices[i];
                    num++;
                  }
                }
                uni.stopPullDownRefresh(); // 停止当前页面下拉刷新
                uni.stopBluetoothDevicesDiscovery({
                  // 停止搜索蓝牙设备
                  success: (res) => {
                    uni.hideLoading();
                  },
                });
              },
            });
          }, 5000);
        },
      });
    },
    // 连接蓝牙 跳转到连接页面
    openControl(item) {
      let params = {
        list: this.bluetoohList,
        info: item,
      };

      uni.redirectTo({
        url:
          "/pages/blefi/blefi?info=" +
          encodeURIComponent(JSON.stringify(params)),
      });
    },
  },
};
</script>

<style scoped>
.content-pop {
  width: 100vw;
  max-height: 55vh;
  padding: 0 30rpx;
}
.bluetoothItem {
  padding: 20rpx 0;
  font-weight: 400;
  font-size: 28rpx;
  border-bottom: 1rpx solid #f4f4f4;
  text-align: left;
}
.textItem {
  display: block;
  margin-bottom: 10rpx;
}
</style>

2.选择蓝牙进行连接  blefi.vue

<template>
  <text>打印机正在连接中...</text>
</template>

<script>
export default {
  data() {
    return {
      bluInfo: {},
      services: [],
      serviceId: 0,
      writeCharacter: false,
      readCharacter: false,
      notifyCharacter: false,
      deviceId: "",
      notifyCharaterId: "",
      notifyServiceId: "",
      writeCharaterId: "",
      writeServiceId: "",
      readCharaterId: "",
      readServiceId: "",
    };
  },
  onLoad(option) {
    // 接收页面传递的数据
    this.bluInfo = JSON.parse(decodeURIComponent(option.info));
    this.bluetooh(this.bluInfo.info.deviceId);
    this.deviceId = this.bluInfo.info.deviceId;
  },
  methods: {
    bluetooh(deviceId) {
      var that = this;
      uni.stopBluetoothDevicesDiscovery({
        success: (res) => {},
      });
      uni.createBLEConnection({
        deviceId: deviceId,
        success: (res) => {
          that.getSeviceId();
        },
        fail: (e) => {
          that.bluetoothFail();
        },
        complete: (e) => {},
      });
    },
    // 连接成功后保存连接状态
    getSeviceId() {
      var that = this;
      uni.getBLEDeviceServices({
        deviceId: this.deviceId,
        success: (res) => {
          that.services = res.services;
          that.getCharacteristics();
        },
        fail: (e) => {
          that.bluetoothFail();
        },
        complete: (e) => {},
      });
    },
    getCharacteristics() {
      var that = this;
      var list = that.services;
      var num = that.serviceId;
      var write = that.writeCharacter;
      var read = that.readCharacter;
      var notify = that.notifyCharacter;
      uni.getBLEDeviceCharacteristics({
        deviceId: this.deviceId,
        serviceId: list[num].uuid,
        success: (res) => {
          for (var i = 0; i < res.characteristics.length; ++i) {
            var properties = res.characteristics[i].properties;
            var item = res.characteristics[i].uuid;
            if (!notify) {
              if (properties.notify) {
                this.notifyCharaterId = item;
                this.notifyServiceId = list[num].uuid;
                notify = true;
              }
            }
            if (!write) {
              if (properties.write) {
                this.writeCharaterId = item;
                this.writeServiceId = list[num].uuid;
                write = true;
              }
            }
            if (!read) {
              if (properties.read) {
                readServiceId.readCharaterId = item;
                readServiceId.readServiceId = list[num].uuid;
                read = true;
              }
            }
          }
          if (!write || !notify || !read) {
            num++;
            (that.writeCharacter = write),
              (that.readCharacter = read),
              (that.notifyCharacter = notify),
              (that.serviceId = num);
            if (num == list.length) {
              // console.log("找不到该读写的特征值")
              that.bluetoothFail();
            } else {
              that.getCharacteristics();
            }
          } else {
            that.bluetoothSuccess(res);
          }
        },
        fail: (e) => {
          that.bluetoothFail();
        },
      });
    },
    // 蓝牙连接打印机
    bluetoothSuccess(res) {
      let info = {
        deviceId: this.deviceId,
        notifyCharaterId: thid.notifyCharaterId,
        notifyServiceId: thid.notifyServiceId,
        writeCharaterId: thid.writeCharaterId,
        writeServiceId: thid.writeServiceId,
        readCharaterId: thid.readCharaterId,
        readServiceId: thid.readServiceId,
      };
      uni.setStorageSync("blefiInfo", info);
      uni.showModal({
        title: "连接成功",
        confirmText: "继续",
        confirmColor: "#00A0E9", //确定按钮颜色
        showCancel: false, //没有取消按钮的弹框
        success: (res) => {
          if (res.confirm) {
            // 蓝牙连接成功,跳转到下一页面
            uni.redirectTo({
              url: "/pages/blefi/blefiWifi",
            });
          }
        },
      });
    },
    bluetoothFail() {
      // 蓝牙连接失败,跳转到失败页面
      uni.redirectTo({
        url: "/pages/blefi/blefiFail",
      });
    },
  },
};
</script>

3. 低功耗蓝牙连接WiFi  blefiWifi.vue

<template>
  <view>
    <text>{{ wifiSSID }}</text>
    <input type="text" placeholder="请输入WLAN密码" v-model="password" />
    <button @click="settiing">连接</button>
  </view>
</template>

<script>
export default {
  data() {
    return {
      bleInfo: {},
      wifiSSID: "your SSID",
      password: "",
      bleSendSequence: 0,
      connected: true,
      wifiCountDown: 0,
      wifiCountInterval: null, // 定时器
      dataEnum: {
        PACKAGE_VALUE: 0x01,
        SUBTYPE_NEG: 0x00,
        SUBTYPE_STA_WIFI_BSSID: 0x01,
        SUBTYPE_STA_WIFI_SSID: 0x02,
        SUBTYPE_STA_WIFI_PASSWORD: 0x03,
        SUBTYPE_SOFTAP_WIFI_SSID: 0x04,
        SUBTYPE_SOFTAP_WIFI_PASSWORD: 0x05,
        SUBTYPE_SOFTAP_MAX_CONNECTION_COUNT: 0x06,
        SUBTYPE_SOFTAP_AUTH_MODE: 0x07,
        SUBTYPE_SOFTAP_CHANNEL: 0x08,
        SUBTYPE_USERNAME: 0x09,
        SUBTYPE_CA_CERTIFICATION: 0x0a,
        SUBTYPE_CLIENT_CERTIFICATION: 0x0b,
        SUBTYPE_SERVER_CERTIFICATION: 0x0c,
        SUBTYPE_CLIENT_PRIVATE_KEY: 0x0d,
        SUBTYPE_SERVER_PRIVATE_KEY: 0x0e,
        SUBTYPE_WIFI_CONNECTION_STATE: 0x0f,
        SUBTYPE_VERSION: 0x10,
        SUBTYPE_WIFI_LIST: 0x11,
        SUBTYPE_ERROR: 0x12,
        SUBTYPE_CUSTOM_DATA: 0x13,
      },
      controllEnum: {
        PACKAGE_VALUE: 0x00,
        SUBTYPE_ACK: 0x00,
        SUBTYPE_SET_SEC_MODE: 0x01,
        SUBTYPE_SET_OP_MODE: 0x02,
        SUBTYPE_CONNECT_WIFI: 0x03,
        SUBTYPE_DISCONNECT_WIFI: 0x04,
        SUBTYPE_GET_WIFI_STATUS: 0x05,
        SUBTYPE_DEAUTHENTICATE: 0x06,
        SUBTYPE_GET_VERSION: 0x07,
        SUBTYPE_CLOSE_CONNECTION: 0x08,
        SUBTYPE_GET_WIFI_LIST: 0x09,
      },
    };
  },
  // 二级页面清除
  onUnload() {
    wx.offBLEConnectionStateChange();
    if (this.wifiCountInterval) {
      clearInterval(this.wifiCountInterval);
      this.wifiCountInterval = null;
    }
  },
  onLoad(options) {
    this.bleInfo = uni.getStorageSync("blefiInfo");
    var that = this;
    wx.getBLEDeviceServices({
      deviceId: this.bleInfo.deviceId,
      success: function (res) {
        wx.getBLEDeviceCharacteristics({
          deviceId: this.bleInfo.deviceId,
          serviceId: this.bleInfo.notifyServiceId,
          success: function (res) {
            wx.notifyBLECharacteristicValueChange({
              state: true,
              deviceId: this.bleInfo.deviceId,
              serviceId: this.bleInfo.notifyServiceId,
              characteristicId: this.bleInfo.notifyCharaterId,
              success: function (res) {
                console.log("启用notify成功");
              },
            });
          },
        });
      },
    });
    wx.onBLEConnectionStateChange((res) => {
      that.connected = res.connected;
      if (!res.connected) {
        uni.hideLoading();
        // 蓝牙连接失败,跳转到失败页面
        uni.redirectTo({
          url: "/pages/blefi/blefiFail",
        });
      }
    });
    // 接收配网打印机回传的数据
    wx.onBLECharacteristicValueChange(function (res) {
      uni.hideLoading();
      var receive = that.ab2strt(res.value);
      console.log("接收到数据 receive : " + receive);
      // 处理接收的数据........
    });
  },
  methods: {
    // 将 ArrayBuffer 转换为16进度字符串
    ab2strt(buff) {
      var hexArr = Array.prototype.map.call(
        new Uint8Array(buff),
        function (bit) {
          return ("00" + bit.toString(16)).slice(-2);
        }
      );
      return hexArr.join(" ");
    },
    settiing() {
      // 取消wifi连接成功/失败页面
      this.wifiCountDown = 30;
      this.startSMSTimer();
      uni.showLoading({
        title: "连接中",
        mask: true,
      });
      if (this.connected) {
        this.sendSSID();
        this.sendPASSWORD();
        this.notifyConnect();
      } else {
        uni.hideLoading();
        // 蓝牙连接失败,跳转到失败页面
        uni.redirectTo({
          url: "/pages/blefi/blefiFail",
        });
      }
    },
    startSMSTimer() {
      this.wifiCountInterval = setInterval(() => {
        this.wifiCountDown--;
        if (this.wifiCountDown <= 0) {
          clearInterval(this.wifiCountInterval);
          this.wifiCountInterval = null;
          uni.hideLoading();
          // 蓝牙连接wifi失败
          uni.redirectTo({
            url: "/pages/blefi/wifiFile",
          });
        }
      }, 1000);
    },
    sendSSID() {
      // SSID转UTF-8
      let password = this.utf16to8(this.wifiSSID);

      let u8buffer = new Uint8Array(password.length);
      for (var i = 0; i < password.length; i++) {
        u8buffer[i] = password.charCodeAt(i);
      }
      this.bleSendCMD(
        this.dataEnum.PACKAGE_VALUE,
        this.dataEnum.SUBTYPE_STA_WIFI_SSID,
        0,
        u8buffer
      );
    },
    utf16to8(str) {
      var out, i, len, c;
      out = "";
      len = str.length;
      for (i = 0; i < len; i++) {
        c = str.charCodeAt(i);
        if (c >= 0x0001 && c <= 0x007f) {
          out += str.charAt(i);
        } else if (c > 0x07ff) {
          out += String.fromCharCode(0xe0 | ((c >> 12) & 0x0f));
          out += String.fromCharCode(0x80 | ((c >> 6) & 0x3f));
          out += String.fromCharCode(0x80 | ((c >> 0) & 0x3f));
        } else {
          out += String.fromCharCode(0xc0 | ((c >> 6) & 0x1f));
          out += String.fromCharCode(0x80 | ((c >> 0) & 0x3f));
        }
      }
      return out;
    },
    sendPASSWORD() {
      let password = this.password;
      let u8buffer = new Uint8Array(password.length);
      for (var i = 0; i < password.length; i++) {
        u8buffer[i] = password.charCodeAt(i);
      }
      this.bleSendCMD(
        this.dataEnum.PACKAGE_VALUE,
        this.dataEnum.SUBTYPE_STA_WIFI_PASSWORD,
        0,
        u8buffer
      );
    },
    notifyConnect() {
      let password = this.password;
      let u8buffer = new Uint8Array(password.length);
      for (var i = 0; i < password.length; i++) {
        u8buffer[i] = password.charCodeAt(i);
      }
      this.bleSendCMD(
        this.controllEnum.PACKAGE_VALUE,
        this.controllEnum.SUBTYPE_CONNECT_WIFI,
        0,
        u8buffer
      );
    },
    //ESP32的蓝牙配网命令接口
    bleSendCMD(CMD, subCMD, frameControl, payload) {
      var newValue = new ArrayBuffer(payload.length + 6);
      var u8array = new Uint8Array(newValue);
      var LSB_Type = ((subCMD & 0x3f) << 2) | (CMD & 0x03);

      u8array[0] = LSB_Type;
      u8array[1] = frameControl;
      u8array[2] = this.bleSendSequence;
      u8array[3] = payload.length;
      for (let i = 0; i < payload.length; i++) {
        u8array[4 + i] = payload[i];
      }
      this.bleSendSequence++;

      if (this.connected) {
        wx.writeBLECharacteristicValue({
          deviceId: this.bleInfo.deviceId,
          serviceId: this.bleInfo.writeServiceId,
          characteristicId: this.bleInfo.writeCharaterId,
          value: newValue,
        });
      }
    },
  },
};
</script>

4. 手机连接蓝牙失败、蓝牙连接WiFi成功/失败(关闭蓝牙连接)

<script>
export default {
  onLoad() {
   let deviceId = uni.getStorageSync("blefiInfo").deviceId
    uni.closeBLEConnection({
      deviceId: deviceId,
    });
  },
};
</script>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/605186.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【大数据】分布式数据库HBase下载安装教程

目录 1.下载安装 2.配置 2.1.启动hadoop 2.2.单机模式 2.3.伪分布式集群 1.下载安装 HBase和Hadoop之间有版本对应关系&#xff0c;之前用的hadoop是3.1.3&#xff0c;选择的HBase的版本是2.2.X。 下载地址&#xff1a; Index of /dist/hbase 配置环境变量&#xff1a…

红米1s 刷入魔趣 (Mokee)ROM(Android 7.1)

目录 背景准备工具硬件&#xff08;自己准备&#xff09;软件&#xff08;我会在文末提供链接&#xff09; 刷机步骤1. 重启电脑2. 安装驱动3. 刷入TWRP4. 清空数据5. 刷入魔趣6. 开机 结尾下载链接 本文由Jzwalliser原创&#xff0c;发布在CSDN平台上&#xff0c;遵循CC 4.0 B…

LeetCode 138. 随机链表的复制

目录 1.原题链接&#xff1a; 2.结点拆分&#xff1a; 代码实现&#xff1a; 3.提交结果&#xff1a; 4.读书分享&#xff1a; 1.原题链接&#xff1a; 138. 随机链表的复制 2.结点拆分&#xff1a; ①.拷贝各个结点&#xff0c;连接在原结点后面&#xff1b; ②.处…

Lora基础炼丹学习笔记

1、收集数据集 20-30张人物各个角度、各个姿势的图片 2、图片预处理 裁剪 打标签 裁剪必须也要512 * 512 &#xff0c;因为sd1.5就是用这个尺寸训练的&#xff0c;可以使用后期处理 打标可以勾选这个&#xff0c;Deepbooru对二次元画风更友好 打标也可以使用wb14-tagger的…

Centos7 安装 MySQL5.7 使用 RPM 方式

1 访问网站 https://downloads.mysql.com/archives/community/ 选择合适的版本&#xff0c;点击 Download。 2 上传下载好的 mysql-5.7.44-1.el7.x86_64.rpm-bundle.tar 文件到 Centos7 机器&#xff0c;这里放到了 下载 目录。 3 解压 mysql-5.7.44-1.el7.x86_64.rpm-bundle.…

力扣每日一题119:杨辉三角||

题目 简单 给定一个非负索引 rowIndex&#xff0c;返回「杨辉三角」的第 rowIndex 行。 在「杨辉三角」中&#xff0c;每个数是它左上方和右上方的数的和。 示例 1: 输入: rowIndex 3 输出: [1,3,3,1]示例 2: 输入: rowIndex 0 输出: [1]示例 3: 输入: rowIndex 1 输出…

如何用多个高斯泼溅合成新的场景【3DGS】

3D高斯泼溅&#xff08;3D Gaussian Splatting&#xff09;作为一种突破性摄影测量和可视化技术作为 SIGGRAPH 2023 上发表的研究论文的一部分发布。我相信3DGS是允许像你我这样的日常用户扫描 3D 的最佳现代方法并保留有机材料的精细细节&#xff0c;尤其是植物、树木、花卉和…

【青龙面板教程】保姆级拉库 Faker库 以及依赖安装教程

青龙面板最新版拉库教程 新版青龙&#xff08;订阅&#xff09;拉库教程 拉库前请打开青龙面板-配置文件 第18行 GithubProxyUrl"" 双引号中的内容清空复制以下拉库命令即可。Faker2 助力池版【安全本地sign防CK泄漏】使用助力池请在群里发"助力池" 机器…

初阶数据结构之单链表详解

目录 一&#xff1a;单链表概念 二&#xff1a;单链表的基本操作 1.定义结点 2.创建链表&#xff08;初始化链表&#xff09; 3:新增结点 4.单链表尾插 5.单链表头插 6.单链表尾删 7&#xff1a;单链表头删 8.打印单链表 9.查找单链表结点 10.单链表删除指定结点 1…

【C语言】static关键字用法

目录 一、static修饰局部变量 二、static修饰全局变量 三、static修饰函数 一、static修饰局部变量 首先我们来看两段代码: 代码1&#xff08;不加static&#xff09; #include <stdio.h> void test() {int i 0;i;printf("%d ", i); } int main() {int i…

UE5材质基础(2)——数学节点篇

UE5材质基础&#xff08;2&#xff09;——数学节点篇1 目录 UE5材质基础&#xff08;2&#xff09;——数学节点篇1 Add节点 Append节点 Abs节点 Subtract节点 Multiply节点 Divide节点 Clamp节点 Time节点 Lerp节点 Add节点 快捷键&#xff1a;A鼠标左键 值相加…

C++学习第十二天(继承)

1、继承的概念以及定义 继承的概念 继承机制是面向对象程序设计使代码可以复用的最重要的手段&#xff0c;它允许程序员在保持原有类特性的基础上进行拓展&#xff0c;增加功能&#xff0c;这样产生新的类&#xff0c;称派生类。继承呈现了面向对象程序设计的层次结构&#x…

EditReady for Mac激活版:专业视频转码工具

对于视频专业人员来说&#xff0c;一款高效的视频转码工具是不可或缺的。EditReady for Mac正是这样一款强大的工具&#xff0c;它拥有简洁直观的操作界面和强大的功能&#xff0c;让您的视频处理工作事半功倍。 EditReady for Mac支持多种视频格式的转码&#xff0c;并且支持常…

多线程学习Day09

10.Tomcat线程池 LimitLatch 用来限流&#xff0c;可以控制最大连接个数&#xff0c;类似 J.U.C 中的 Semaphore 后面再讲 Acceptor 只负责【接收新的 socket 连接】 Poller 只负责监听 socket channel 是否有【可读的 I/O 事件】 一旦可读&#xff0c;封装一个任务对象&#x…

阿里云VOD视频点播流程(2)

二、视频点播 1、入门代码 基于OSS原生SDK上传 &#xff0c;参考文档&#xff1a;https://help.aliyun.com/zh/vod/user-guide/upload-media-files-by-using-oss-sdks?spma2c4g.11186623.0.0.1f02273fj4lxNJ 视频点播面向开发者提供了丰富的上传方式&#xff0c;其中上传SDK&…

软件测试实战项目(含电商、银行、APP等)

&#x1f345; 视频学习&#xff1a;文末有免费的配套视频可观看 &#x1f345; 关注公众号【互联网杂货铺】&#xff0c;回复 1 &#xff0c;免费获取软件测试全套资料&#xff0c;资料在手&#xff0c;涨薪更快 今天给大家带来几个软件测试项目的实战总结及经验&#xff0c;适…

ps5电玩计时收费系统软件教程,电玩店适合的计时器,电脑定时语音提醒

ps5电玩计时收费系统软件教程&#xff0c;电玩店适合的计时器&#xff0c;电脑定时语音提醒 一、前言 以下软件操作教程以&#xff0c;佳易王电玩计时计费管理软件为例说明 软件文件下载可以点击最下方官网卡片——软件下载——试用版软件下载 1、计时计费功能&#xff1a;只…

PHPStudy 访问网页 403 Forbidden禁止访问

涉及靶场 upload-labd sqli-labs pikachu dvwa 以及所有部署在phpstudy中的靶场 注意&#xff1a;一定要安装解压软件 很多同学解压靶场代码以后访问报错的原因是&#xff1a;电脑上没有解压软件。 这个时候压缩包看起来就是黄色公文包的样子&#xff0c;右键只有“全部提取…

SpringCloud Alibaba Sentinel 修改Dashboard用户名和密码

目录 一、下载Sentinel的Jar包 二、在启动时修改用户名和密码的命令 三、测试登录成功 在网上找到了一大堆文章&#xff0c;没一个有用的&#xff0c;最终还是通过不断测试找到了这个方法。 一、下载Sentinel的Jar包 Releases alibaba/Sentinel GitHub 二、在启动时修改…

设计模式:命令模式

文章目录 一、什么是命令模式二、命令模式结构三、命令模式实现步骤四、命令模式应用场景 一、什么是命令模式 它允许将请求封装为对象&#xff0c;一个请求对应于一个命令&#xff0c;将发出命令的责任和执行命令的责任分割开。每一个命令都是一个操作&#xff1a;请求的一方…
最新文章