代码提交
This commit is contained in:
parent
1f04491f70
commit
a722270b89
|
@ -3071,17 +3071,20 @@ export default {
|
|||
if (val == 1) {
|
||||
this.xianShow = true;
|
||||
this.yiciSrc =
|
||||
"http://221.226.19.85:10123/info.html?primaryGraphId=1874E7D1D0D0AE1F";
|
||||
// "http://221.226.19.85:10123/info.html?primaryGraphId=1874E7D1D0D0AE1F";
|
||||
"http://223.112.17.26:12301/info.html?primaryGraphId=1874E7D1D0D0AE1F";
|
||||
} else if (val == 2) {
|
||||
this.xianShow = true;
|
||||
this.yiciSrc =
|
||||
"http://221.226.19.85:10123/info.html?primaryGraphId=12640A6DD8E2DAEE";
|
||||
// "http://221.226.19.85:10123/info.html?primaryGraphId=12640A6DD8E2DAEE";
|
||||
"http://223.112.17.26:12301/info.html?primaryGraphId=12640A6DD8E2DAEE";
|
||||
}
|
||||
},
|
||||
handleXian1() {
|
||||
this.xianShow = true;
|
||||
this.yiciSrc =
|
||||
"http://221.226.19.85:10123/info.html?primaryGraphId=2CD496643A1EB7D5";
|
||||
// "http://221.226.19.85:10123/info.html?primaryGraphId=2CD496643A1EB7D5";
|
||||
"http://223.112.17.26:12301/info.html?primaryGraphId=2CD496643A1EB7D5";
|
||||
},
|
||||
handleXianfalse() {
|
||||
this.xianShow = false;
|
||||
|
|
|
@ -9,8 +9,15 @@
|
|||
</div>
|
||||
<div class="loginForm">
|
||||
<div class="welcome">欢迎登录</div>
|
||||
<el-form :model="loginForm" :rules="rules" status-icon label-position="left" label-width="70px" class="form"
|
||||
ref="loginForm">
|
||||
<el-form
|
||||
:model="loginForm"
|
||||
:rules="rules"
|
||||
status-icon
|
||||
label-position="left"
|
||||
label-width="70px"
|
||||
class="form"
|
||||
ref="loginForm"
|
||||
>
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input type="text" v-model="loginForm.account"></el-input>
|
||||
</el-form-item>
|
||||
|
@ -30,8 +37,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { doLogin } from '../../api/api'
|
||||
import JSEncrypt from 'jsencrypt'
|
||||
import { doLogin } from "../../api/api";
|
||||
import JSEncrypt from "jsencrypt";
|
||||
export default {
|
||||
name: "login",
|
||||
data() {
|
||||
|
@ -52,38 +59,42 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
mounted() { },
|
||||
mounted() {},
|
||||
methods: {
|
||||
//登录事件
|
||||
submitForm() {
|
||||
const jsRsa = new JSEncrypt()
|
||||
const jsRsa = new JSEncrypt();
|
||||
// console.log(jsRsa);
|
||||
// 公钥
|
||||
const publicKeyStr = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKxh6IUqXHZWWUt2DgbU9/52E5eIoi1Cd3jRPSNyL5NeDOq9JmALTPPZKB2LL2XmZY+rJ9GrXbJsLuocQKcIv6ECAwEAAQ=='
|
||||
const publicKeyStr =
|
||||
"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKxh6IUqXHZWWUt2DgbU9/52E5eIoi1Cd3jRPSNyL5NeDOq9JmALTPPZKB2LL2XmZY+rJ9GrXbJsLuocQKcIv6ECAwEAAQ==";
|
||||
// 设置公钥
|
||||
jsRsa.setPublicKey(publicKeyStr)
|
||||
jsRsa.setPublicKey(publicKeyStr);
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
// 通过jsRsa加密
|
||||
let accountA = jsRsa.encrypt(this.loginForm.account)
|
||||
let passwordA = jsRsa.encrypt(this.loginForm.password)
|
||||
let accountA = jsRsa.encrypt(this.loginForm.account);
|
||||
let passwordA = jsRsa.encrypt(this.loginForm.password);
|
||||
let data = {
|
||||
account:accountA,
|
||||
password:passwordA
|
||||
}
|
||||
doLogin({data}).then(res => {
|
||||
console.log(res.data,'-===================');
|
||||
account: accountA,
|
||||
password: passwordA,
|
||||
};
|
||||
doLogin({ data }).then((res) => {
|
||||
console.log(res.data, "-===================");
|
||||
if (res.data.code == 200) {
|
||||
// 存储token
|
||||
sessionStorage.setItem('tokenStr', res.data.data.token)
|
||||
sessionStorage.setItem("tokenStr", res.data.data.token);
|
||||
// 存储用户名
|
||||
sessionStorage.setItem('account', res.data.data.account)
|
||||
sessionStorage.setItem('roleId', res.data.data.roleId)
|
||||
sessionStorage.setItem("account", res.data.data.account);
|
||||
sessionStorage.setItem("roleId", res.data.data.roleId);
|
||||
this.$message.success("登录成功");
|
||||
this.$router.push("/index");
|
||||
this.$router.push("/index");
|
||||
} else {
|
||||
this.$message.error("请输入正确的账号和密码");
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请输入正确的账号和密码");
|
||||
console.log("error submit!!");
|
||||
|
@ -94,9 +105,9 @@ export default {
|
|||
//清空
|
||||
empty() {
|
||||
this.$message.success("用户名已重置");
|
||||
this.loginForm.userName = ''
|
||||
this.loginForm.password = ''
|
||||
}
|
||||
this.loginForm.userName = "";
|
||||
this.loginForm.password = "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue