| | |
| | | methods: { |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | //this.$byutil.setUser({username:123}) |
| | | //this.$router.push({'path': '/'}); |
| | | if (valid) { |
| | | var url = this.$systemconfig.basePath + '/user/login'; |
| | | this.$byutil.postData(this,url,this.ruleForm,res=>{ |
| | | let data = res; |
| | | if (data) { |
| | | localStorage.userId = data.obj.id |
| | | localStorage.name = data.obj.name |
| | | localStorage.type = data.obj.type |
| | | let data = res.data; |
| | | if (data) { |
| | | localStorage.userId = data.id |
| | | localStorage.name = data.name |
| | | localStorage.type = data.type |
| | | this.$router.push({'path': '/home'}); |
| | | // if (this._isMobile()) { |
| | | // this.$router.push({'path': '/index4'}); |