master
fanluyan 2 years ago
parent b84abc4256
commit 176a3d89c1

@ -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); //tokenvuex
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); //tokenvuex
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!!");

@ -434,8 +434,8 @@ export default {
},
handleWarn() {
console.log("声光报警");
console.log(this.newTermId);
alarmMarkJoggle({ termid: this.newTermId })
console.log(this.cmdid);
alarmMarkJoggle({ cmdId: this.cmdid, ctrl: 1 })
.then((res) => {
console.log(res);
if (res.code == 200) {

Loading…
Cancel
Save