Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createComment() {
let that = this
if (!this.comment.content) {
Message.error('评论内容不能为空')
} else {
this.comment.name = this.user.username
this.comment.email = this.user.email
this.comment.httpCreate(function (response) {
that.$emit('success')
})
}
}
}
store.dispatch("fedLogout").then(() => {
Message.error("验证失败,请重新登录");
let redirect = to.fullPath;
store.dispatch("loginOut").then(() => {
next({
path: "/login",
query: { redirect: redirect }
});
});
});
});
changehostgroup(this.hostgroup).then(resp => {
if (resp.code === 0) {
Message.success(`修改主机组 ${name} 成功`);
this.getallhostgroup();
this.is_change = false;
} else {
Message.error(`修改主机组 ${name} 失败: ${resp.msg}`);
}
});
}
respone => {
Message.error('请求数据出错,请重新刷新页面')
}
)
* 500: '服务器发生错误,请检查服务器',
* 502: '网关错误',
* 503: '服务不可用,服务器暂时过载或维护',
* 504: '网关超时'
*
*/
var result;
try {
result = JSON.parse(response);
} catch (error) {
result = response;
}
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) {
store.dispatch('FedLogOut').then(() => {
Message.error(err || 'Verification failed, please login again')
next({ path: '/' })
})
})
admindeleteuser({ id: id }).then((resp) => {
if (resp.code === 0) {
Message.success(`删除用户 ${this.user.name} 成功`);
this.startgetallusers();
this.is_create = false;
} else {
Message.error(`删除用户 ${name} 失败: ${resp.msg}`);
}
});
},