|
|
|
@ -91,19 +91,26 @@ export default {
|
|
|
|
|
// identifyCodes: "1234567890abcdefjhijklinopqrsduvwxyz",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapMutations(["SET_TOKEN", "SET_USERINFO"]),
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs.loginForm.validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log(valid);
|
|
|
|
|
//console.log(this.userInfo.verificationCode);
|
|
|
|
|
//this.userInfo.password = this.$md5(this.userInfo.password); //密码加密
|
|
|
|
|
this.token = this.$md5(this.userInfo.password); //获取token
|
|
|
|
|
this.$store.commit("SET_TOKEN", this.token); //将token保存在vuex中
|
|
|
|
|
this.$store.commit("SET_USERINFO", this.userInfo.username); //将用户信息保存在vuex中
|
|
|
|
|
this.$router.push("/realTimeMonitor");
|
|
|
|
|
this.$message.success("登录成功");
|
|
|
|
|
// this.userInfo.password = this.$md5(this.userInfo.password); //密码加密
|
|
|
|
|
loginJoggle(this.userInfo)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.$store.commit("SET_TOKEN", res.data.sessionId); //将token保存在vuex中
|
|
|
|
|
this.$store.commit("SET_USERINFO", res.data); //将用户信息保存在vuex中
|
|
|
|
|
this.$router.push("/realTimeMonitor");
|
|
|
|
|
this.$message.success("登录成功");
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {});
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error("请输入账号和密码");
|
|
|
|
|
console.log("error submit!!");
|
|
|
|
|