WXL (wul)
2026-05-07 ecbcc059d43f64877551756de129c653d31d0032
src/components/CallButton/index.vue
@@ -51,13 +51,16 @@
      isRegistering: true, // 初始为注册中状态
      randomNum: randomNum,
      randomID: null,
      orgname: localStorage.getItem("orgname"),
      callStatus: "idle", // idle, calling, connected, ended
      sipStatus: "未连接",
      sipStatusClass: "status-disconnected",
      sipConfig: {
        wsUrl: "wss://192.168.10.124:7443",
        // 移除硬编码的wsUrl和domain
        wsUrl: "",
        sipUri: "",
        password: "Smartor@2023",
        password: "Smartor@2023", //丽水
        // password: "heskj@1234",//市一
        displayName: "Web 小龙",
        // realm: "9.208.5.18:8090",
      },
@@ -96,10 +99,23 @@
    },
  },
  created() {
    if (
      this.orgname == "第一人民医院湖滨院区" ||
      this.orgname == "第一人民医院吴山院区"
    ) {
      this.sipConfig.password = "heskj@1234";
    } else {
      this.sipConfig.password = "Smartor@2023";
    }
    // CallgetList();
  },
  async mounted() {
    const orgName = localStorage.getItem("orgname");
    if (orgName == "景宁畲族自治县人民医院") {
      return;
    }
    await this.CallgetList();
    this.isRegistering = true; // 开始注册
    sipService.init(this.sipConfig);
@@ -188,8 +204,18 @@
        const res = await CallgetList();
        this.randomNum = res.data[0].tel;
        this.randomID = res.data[0].id;
        // 正确设置 sipUri
        this.sipConfig.sipUri = `${this.randomNum}@192.168.10.124`;
        // 动态设置sipUri,域名部分会在sipService中动态处理
        const orgName = localStorage.getItem("orgname");
        if (orgName == "丽水市中医院") {
          this.sipConfig.sipUri = `${this.randomNum}@192.168.10.124`;
        } else if (orgName == "龙泉市人民医院") {
          this.sipConfig.sipUri = `${this.randomNum}@10.10.0.220`;
        } else if (
          orgName == "第一人民医院湖滨院区" ||
          orgName == "第一人民医院吴山院区"
        ) {
          this.sipConfig.sipUri = `${this.randomNum}@192.169.129.198`;
        }
      } catch (error) {
        console.error("获取分机号失败:", error);
        // this.updateStatus("failed", "获取分机号失败");