|
@@ -33,7 +33,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="loginbtn-box">
|
|
|
- <el-button @keyup.enter.native="Login()" @click="Login()" class="loginbtn" v-loading.fullscreen.lock="fullscreenLoading" round>登 录</el-button>
|
|
|
+ <el-button @keyup.enter.native="Login()" @click="Login()" class="loginbtn"
|
|
|
+ v-loading.fullscreen.lock="fullscreenLoading" round>登 录</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div></div>
|
|
@@ -57,7 +58,7 @@ export default {
|
|
|
usernum: '',
|
|
|
password: '',
|
|
|
msgs: false,
|
|
|
- fullscreenLoading:false
|
|
|
+ fullscreenLoading: false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -72,41 +73,41 @@ export default {
|
|
|
},
|
|
|
//登录
|
|
|
Login() {
|
|
|
- var homepage="";
|
|
|
- if(this.usernum==""||this.password==""){
|
|
|
+ var homepage = "";
|
|
|
+ if (this.usernum == "" || this.password == "") {
|
|
|
this.$message({
|
|
|
message: "请填写账号密码!",
|
|
|
type: 'warning'
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- this.fullscreenLoading=true;
|
|
|
- var url="/api/login"
|
|
|
- var that=this
|
|
|
+ this.fullscreenLoading = true;
|
|
|
+ var url = "/api/login"
|
|
|
+ var that = this
|
|
|
this.$axios({
|
|
|
method: 'post',
|
|
|
- url:url,
|
|
|
- data:{
|
|
|
+ url: url,
|
|
|
+ data: {
|
|
|
number: this.usernum,
|
|
|
password: this.password
|
|
|
}
|
|
|
- }).then(function(res){
|
|
|
+ }).then(function (res) {
|
|
|
console.log(res);
|
|
|
- if(res.data.code==200){
|
|
|
+ if (res.data.code == 200) {
|
|
|
localStorage.setItem('userinif', JSON.stringify(res.data.data));
|
|
|
- that.fullscreenLoading=false;
|
|
|
- for(var l=0;l<res.data.data.authData.length;l++){
|
|
|
- if(res.data.data.authData[l].modulName=='主页'){
|
|
|
- homepage=res.data.data.authData[l].pageList[0].webUrl
|
|
|
- localStorage.setItem("indexs",res.data.data.authData[l].modulid+'-'+res.data.data.authData[l].pageList[0].pageid);
|
|
|
- localStorage.setItem("innhtml",res.data.data.authData[l].pageList[0].pageName);
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ for (var l = 0; l < res.data.data.authData.length; l++) {
|
|
|
+ if (res.data.data.authData[l].modulName == '主页') {
|
|
|
+ homepage = res.data.data.authData[l].pageList[0].webUrl
|
|
|
+ localStorage.setItem("indexs", res.data.data.authData[l].modulid + '-' + res.data.data.authData[l].pageList[0].pageid);
|
|
|
+ localStorage.setItem("innhtml", res.data.data.authData[l].pageList[0].pageName);
|
|
|
}
|
|
|
}
|
|
|
- that.$router.push({ path: "/home"+homepage});
|
|
|
- console.log("/home"+homepage)
|
|
|
+ that.$router.push({ path: "/home" + homepage });
|
|
|
+ console.log("/home" + homepage)
|
|
|
// that.$router.push('/home/index');
|
|
|
- }else{
|
|
|
- that.fullscreenLoading=false;
|
|
|
+ } else {
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -117,14 +118,14 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
|
-console.log(process.env.API_HOST);
|
|
|
+ console.log(process.env.API_HOST);
|
|
|
|
|
|
document.querySelector(".login-all").style.height = window.innerHeight + "px";
|
|
|
let that = this
|
|
|
document.onkeydown = function (e) {
|
|
|
e = window.event || e
|
|
|
//保证是在登录页面发出的enter事件
|
|
|
- if (e.code === 'Enter' || e.code === 'enter'|| e.code === 'NumpadEnter') {
|
|
|
+ if (e.code === 'Enter' || e.code === 'enter' || e.code === 'NumpadEnter') {
|
|
|
//调用登录函数
|
|
|
that.Login();
|
|
|
}
|
|
@@ -340,4 +341,5 @@ body {
|
|
|
top: -10px;
|
|
|
background-color: rgba(42,53,88);
|
|
|
/*background-image: url("../assets/zhedang.png");
|
|
|
- }*/</style>
|
|
|
+ }*/
|
|
|
+</style>
|