var vm = new Vue({ el: '#app', data: function () { return { isLoading: false, phone: '', passwd: '', show: false, show2: false, value:"123" } }, mounted() { var that = this; if (typeof (Cookies.get('phone')) == "undefined") { } else { that.phone = Cookies.get('phone'); that.passwd = Cookies.get('passwd'); } }, methods: { onSubmit(name) { var that = this; that._userLogin(); }, _userLogin() { var that = this; that.isLoading = true; that.phone = "admin"; that.passwd = "123456"; that.AxiosHttp("post", 'login/login', { userID: that.phone, userPass: that.passwd, }, false) .then(function (res) { var json = res; if (json.status == 0) { var _userGuid = json.data.tbBillList.guid; var _userAccount = json.data.tbBillList.account; Cookies.set('loginGuid', _userGuid); Cookies.set('loginAccount', _userAccount); window.location.href = ("/H5/Default.aspx?userGuid=" + _userGuid + "&userAccount=" + _userAccount); } else { that.isLoading = false; that.$toast.fail(json.message); } }) .catch(function (error) { that.isLoading = false; that.$toast.fail("网络错误,请重试!"); console.log(error); }); }, } })