Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
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("更新成功");
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)
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}`);
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);
};
queryinstallstatus().then(resp => {
if (resp.code === 10700) {
this.needinstall = true;
Message.warning(resp.msg);
}
});
},
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) {
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 => {
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 = "";
}
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 => {
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;
}
})