How to use the element-ui.Message.warning function in element-ui

To help you get started, we’ve selected a few element-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github labulaka521 / crocodile / web / src / views / profile / index.vue View on Github external
}
              if (this.pass.password1.length < 8) {
                Message.warning("密码最少8位");
                return;
              }
              this.userinfo.password = this.pass.password1;
            }
          } else {
            return false;
          }
        });
      }
      try {
        window.btoa(`${this.userinfo.name}`);
      } catch (error) {
        Message.warning("用户名只能使用字母、数字、符号");
        return;
      }
      changeselfinfo(this.userinfo).then((resp) => {
        if (resp.code === 0) {
          Message.success("更新成功");
          this.changepasswd = false;
          this.password1 = "";
          this.password2 = "";
        } else {
          Message.error(`更新失败 ${resp.msg}`);
        }
      });
      //  else {
      //   changeselfinfo(this.userinfo).then((resp) => {
      //     if (resp.code === 0) {
      //       Message.success("更新成功");
github labulaka521 / crocodile / web / src / views / login / index.vue View on Github external
this.$refs["loginForm"].validate(valid => {
        if (valid) {
          if (this.loginForm.password !== this.password2) {
            Message.warning("两次密码输入不相同");
            return;
          }
          try {
            window.btoa(
              `${this.loginForm.username}:${this.loginForm.password}`
            );
          } catch (error) {
            Message.warning("用户名和密码只能使用字母、数字、符号");
            return;
          }
          if (this.loginForm.password.length < 8) {
            Message.warning("密码最少8位");
            return;
          }
          this.installloading = true;
          startinstall(this.loginForm)
github labulaka521 / crocodile / web / src / views / user / index.vue View on Github external
submituser(formName) {
      if (this.changepasswd || this.is_create) {
        if (this.password1 === "" || this.password2 === "") {
          Message.warning("密码不能为空,请重新输入");
          return;
        }
        if (this.password1 !== this.password2) {
          Message.warning("两次输入密码不一致,请重新输入");
          return;
        }
        try {
          window.btoa(`${this.password1}`);
        } catch (error) {
          Message.warning("密码只能使用字母、数字、符号");
          return;
        }
        if (this.password1.length < 8) {
          Message.warning("密码最少8位");
          return;
        }
        this.user.password = this.password1;
      }
      try {
        window.btoa(`${this.user.name}`);
github chenxingyuoo / SmallRecord / app / src / module / admin / common / require.js View on Github external
const requireCatch = (res) => {
  if ((typeof res === 'number' && !isOk(res)) || (res.response && !isOk(res.response.status))) {
    Message.error({ message: '系统出现错误了~' + res });
  }
  if (typeof res.code !== 'undefined' && res.code !== SUCCESS_CODE) {
    Message.warning({ message: res.message });
  }
  return Promise.reject(res);
};
github labulaka521 / crocodile / web / src / views / login / index.vue View on Github external
queryinstallstatus().then(resp => {
        if (resp.code === 10700) {
          this.needinstall = true;
          Message.warning(resp.msg);
        }
      });
    },
github labulaka521 / crocodile / web / src / views / user / index.vue View on Github external
delete this.user.name;
        if (this.changepasswd === false) {
          this.user.password = "";
        }
        adminchangeinfo(this.user).then((resp) => {
          if (resp.code === 0) {
            Message.success(`修改用户 ${name} 成功`);
            this.startgetallusers();
            this.is_change = false;
          } else {
            Message.error(`修改用户 ${name} 失败: ${resp.msg}`);
          }
        });
      } else {
        if (this.password1 === "" || this.password2 === "") {
          Message.warning("密码不能为空,请重新输入");
          return;
        }
        if (this.password1 !== this.password2) {
          Message.warning("两次输入密码不一致,请重新输入");
          return;
        }
        try {
          window.btoa(`${this.password1}`);
        } catch (error) {
          Message.warning("密码只能使用字母、数字、符号");
          return;
        }

        this.$refs[formName].validate((valid) => {
          if (valid) {
            if (this.is_create === true) {
github Brickies / vue-template / template / src / utils / api.ts View on Github external
res => {
    const { code, message } = res.data
    if (code === 401) {
      redirectLogin()
    }
    if (code !== 200) {
      Message.warning(`${message}`)
      return Promise.reject(res.data)
    } else {
      return res.data
    }
  },
  error => {
github labulaka521 / crocodile / web / src / views / user / index.vue View on Github external
if (this.password1 === "" || this.password2 === "") {
          Message.warning("密码不能为空,请重新输入");
          return;
        }
        if (this.password1 !== this.password2) {
          Message.warning("两次输入密码不一致,请重新输入");
          return;
        }
        try {
          window.btoa(`${this.password1}`);
        } catch (error) {
          Message.warning("密码只能使用字母、数字、符号");
          return;
        }
        if (this.password1.length < 8) {
          Message.warning("密码最少8位");
          return;
        }
        this.user.password = this.password1;
      }
      try {
        window.btoa(`${this.user.name}`);
      } catch (error) {
        Message.warning("用户名只能使用字母、数字、符号");
        return;
      }
      if (this.is_change === true) {
        var name = this.user.name;
        delete this.user.name;
        if (this.changepasswd === false) {
          this.user.password = "";
        }
github mojowork / admin-lite / src / utils / request.js View on Github external
if (result.code < 0 ) {
          if (result.code == -2 || result.code == -10) {
            Message.error({
              message: result.msg
            });
            Promise.reject(result);
          }else{
            Promise.reject(result);
          }
        } else {
          if (result.code == 2) {
            Message.success({
              message: result.msg
            });
          } else if (result.code == 3) {
            Message.warning({
              message: result.msg
            });
          } else if (result.code == 4) {
            MessageBox.alert(result.msg, '提示', {
              confirmButtonText: '确定',
              type:'warning'
            });
          }
          Promise.resolve(result.data);
        }
    },
    error => {
github labulaka521 / crocodile / web / src / views / login / index.vue View on Github external
this.$refs["loginForm"].validate(valid => {
        if (valid) {
          if (this.loginForm.password !== this.password2) {
            Message.warning("两次密码输入不相同");
            return;
          }
          try {
            window.btoa(
              `${this.loginForm.username}:${this.loginForm.password}`
            );
          } catch (error) {
            Message.warning("用户名和密码只能使用字母、数字、符号");
            return;
          }
          if (this.loginForm.password.length < 8) {
            Message.warning("密码最少8位");
            return;
          }
          this.installloading = true;
          startinstall(this.loginForm)
            .then(resp => {
              if (resp.code === 0) {
                this.startqueryinstallstatus();
                this.installloading = false;
                this.needinstall = false;
                Message.success("恭喜你已经安装成功🎉");
              } else {
                Message.error(resp.msg);
                this.installloading = false;
                this.needinstall = false;
              }
            })