zhangzengfei
2022-05-20 4eae57c864cabf05f8739838c964e505811b65ef
修复ip配置后提示链接
1个文件已修改
63 ■■■■■ 已修改文件
src/pages/settings/views/NetSettings.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/settings/views/NetSettings.vue
@@ -17,7 +17,7 @@
          <!-- <span v-if="showStatus && i == 2" class="status">已连接</span> -->
        </div>
      </div>
      <div class="net-right">
      <div class="net-right" v-loading="configLoading">
        <div class="net-set" v-if="activePage == 0">
          <div class="title">网络设置</div>
          <el-form :model="ruleForm" :rules="rules" ref="joinForm" class="join-form">
@@ -374,7 +374,8 @@
      ],
      value: "",
      IPV4_hid: false,
      IPV6_hid: false
      IPV6_hid: false,
      configLoading: false
    }
  },
  mounted() {
@@ -462,24 +463,6 @@
      this.activePage = i
    },
    saveWire(ifname) {
      // let data = {
      //   ip: this.wireForm.ip,
      //   gateway: this.wireForm.gateway,
      //   dns: this.wireForm.dns,
      //   subMask: this.wireForm.subMask,
      //   ifname: this.activeWireItem.name,
      // };
      // setNetWorkCard(data).then(
      //   (res) => {
      //     if (res && res.success) {
      //       this.$message.success(res.data);
      //     }
      //   },
      //   (err) => {
      //     this.$message.error("保存失败:" + err.msg);
      //   }
      // );
      this.$refs["wireForm"].validate((valid) => {
        if (valid) {
          let data = {
@@ -490,24 +473,7 @@
            ifname: this.activeWireItem.name
          }
          let newUri = location.protocol + "//" + data.ip + location.port == 80 ? "" : ":" + location.port
          if (this.wireForm.ip !== this.originalConfig.ip) {
            var changeIPTimer = setTimeout(() => {
              this.$alert(
                '<strong>您已修改了服务器ip, 请重新登录</strong><a target="_parent" href="' +
                  newUri +
                  '"> ' +
                  newUri +
                  "<a/>",
                "提示",
                {
                  dangerouslyUseHTMLString: true,
                  customClass: "noticeBox"
                }
              )
            }, 10000)
          }
          let newUri = location.protocol + "//" + data.ip + (location.port == 80 ? "" : ":" + location.port)
          this.$confirm("确认需要修改服务器配置吗?", {
            center: true,
@@ -515,8 +481,28 @@
            confirmButtonClass: "comfirm-class-sure"
          })
            .then(() => {
              this.configLoading = true
              if (this.wireForm.ip !== this.originalConfig.ip) {
                this.configLoading = false
                var changeIPTimer = setTimeout(() => {
                  this.$alert(
                    '<strong>您已修改了服务器ip, 请重新登录</strong><a target="_parent" href="' +
                      newUri +
                      '"> ' +
                      newUri +
                      "<a/>",
                    "提示",
                    {
                      dangerouslyUseHTMLString: true,
                      customClass: "noticeBox"
                    }
                  )
                }, 10000)
              }
              setNetWorkCard(data)
                .then((rsp) => {
                  this.configLoading = false
                  if (rsp && rsp.success) {
                    this.$notify({
                      type: "success",
@@ -526,6 +512,7 @@
                })
                .catch((err) => {
                  clearTimeout(changeIPTimer)
                  this.configLoading = false
                  this.$notify({
                    type: "error",
                    message: "保存失败"