| | |
| | | if (valid) { |
| | | var url = this.$systemconfig.basePath + '/ffzf/user/login'; |
| | | this.$byutil.postData(this,url,this.ruleForm,res=>{ |
| | | if (res.code == 0) { |
| | | let data = res.data; |
| | | if (data) { |
| | | localStorage.userId = data.id; |
| | | localStorage.name = data.name; |
| | | localStorage.type = data.type; |
| | | // localStorage.userRouters = JSON.stringify(this.items) ; |
| | | this.SET_ROLES(data.type) |
| | | this.SET_ROLELISt(); // 筛选左侧菜单栏 |
| | | this.$router.push({'path': this.resultAsyncRoutes[0].children[0].indexUrl || '/home'}); |
| | | // 自动跳转当前权限路由的第一个页面 ,如果找不到就去跳home |
| | | // if (this._isMobile()) { |
| | | // this.$router.push({'path': '/index4'}); |
| | | // } else { |
| | | // this.$router.push({'path': '/index'}); |
| | | // } |
| | | } |
| | | if (data) { |
| | | localStorage.userId = data.id; |
| | | localStorage.name = data.name; |
| | | localStorage.type = data.type; |
| | | // localStorage.userRouters = JSON.stringify(this.items) ; |
| | | this.SET_ROLES(data.type) |
| | | this.SET_ROLELISt(); // 筛选左侧菜单栏 |
| | | this.$router.push({'path': this.resultAsyncRoutes[0].children[0].indexUrl || '/home'}); |
| | | // 自动跳转当前权限路由的第一个页面 ,如果找不到就去跳home |
| | | // if (this._isMobile()) { |
| | | // this.$router.push({'path': '/index4'}); |
| | | // } else { |
| | | // this.$router.push({'path': '/index'}); |
| | | // } |
| | | } |
| | | }else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | |
| | | }) |
| | | } else { |
| | | return false; |