码迷,mamicode.com
首页 > 其他好文 > 详细

qwerqwerw

时间:2018-12-26 14:28:47      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:notify   regex   router   ack   isp   deletion   wrap   tor   ready   

checkPassword(password) {
      // 检查密码 获取加密表单数据
      if (password === "") {
        this.$notify.warning({
          title: "密码错误!",
          message: "密码不能为空!!!",
          offset: 100
        });
      } else {
        let uuid = this.$route.params["uuid"],
          url =
            this.$http.defaults.url +
            "map/userid/map/getshare/" +
            uuid +
            "/code",
          prams = encodeURI("data=" + JSON.stringify({ code: password }));

        this.loading = true;
        this.$http
          .post(url, prams)
          .then(res => {
            this.loading = false;
            if (res && res.data.result) {
              this.showMap(res);
            } else {
              this.$message.error(res.data.message || "验证错误");
              this.sharePassword = "";
            }
          })
          .catch(err => {
            this.$message.error("密码错误");
          });
      }
    },

    initData() {
      let uuid = this.$route.params["uuid"], // 030bd7d9-8cbe-4777-aba8-5deff9a33247
        url = this.$http.defaults.url + "map/userid/map/getshare/" + uuid;
      this.$http
        .get(url)
        .then(res => {
          this.loading = false;
          if (res.data.result) {
            this.showMap(res);
          } else {
            if (res.data.message === "分享加密,需要密码") {
              // 加密
              this.isPassword = true;
              this.ready = false;
            } else {
              // uuid 错误
              this.$alert("未找到指定分享的内容!", "加载失败", {
                confirmButtonText: "再去试试",
                callback: action => {
                  this.$router.replace({ name: "main" });
                }
              });
            }
          }
        })
        .catch(err => {
          this.$alert("未找到分享的内容!", "加载失败", {
            confirmButtonText: "再去试试",
            callback: action => {
              this.$router.replace({ name: "main" });
            }
          });
        });
    },

    showMap(res) {
      this.mapData = res.data.data;
      this.mapData.option = JSON.parse(res.data.data.option);
      this.__extendMapInfo(this.mapData);
      // this.__setMapInfoOption(this.mapData);
      this.ready = true;
      this.isPassword = false;
      this.loading = false;
      this.hideLoading();
    },

    hideLoading() {
      this.shareLoading = false;
    }
/*
 代码高亮开始,使用了一个叫Monokai Sublime的黑色主题皮肤,直接拿过来还不行,有一些样式冲突,还要自己稍微改一些地方
Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
*/
pre {
/*控制代码不换行*/
    white-space: pre;
    word-wrap: normal;
}
.cnblogs-markdown .hljs {
    display: block;
    overflow-x: auto;
    padding: 0.5em;
    background: #23241f !important;
    color: #FFF;
    white-space: pre;
    word-break: normal;
}

.hljs,
.hljs-tag,
.hljs-subst {
  color: #f8f8f2;
}

.hljs-strong,
.hljs-emphasis {
  color: #a8a8a2;
}

.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal,
.hljs-link {
  color: #ae81ff;
}

.hljs-code,
.hljs-title,
.hljs-section,
.hljs-selector-class {
  color: #a6e22e;
}

.hljs-strong {
  font-weight: bold;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-name,
.hljs-attr {
  color: #f92672;
}

.hljs-symbol,
.hljs-attribute {
  color: #66d9ef;
}

.hljs-params,
.hljs-class .hljs-title {
  color: #f8f8f2;
}

.hljs-string,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-variable {
  color: #e6db74;
}

.hljs-comment,
.hljs-deletion,
.hljs-meta {
  color: #75715e;
}

/*黑色主题皮肤结束*/

qwerqwerw

标签:notify   regex   router   ack   isp   deletion   wrap   tor   ready   

原文地址:https://www.cnblogs.com/twodog/p/10178889.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!