login(){
? var url = "登錄地址"
? var param = {
? username:this.username,
? pwd:this.password
? }
? param=qs.stringify(param)
? this.axios.post(url,param).then((res)=>{
? if(this.username!==""&&this.password!==""){
? console.log(res.data.data)
? console.log(res.data.data.user_id)
cookies.set('token',res.data.data.user_id)
this.$router.push("/homepage")
this.username=""
this.password=""
? }else if(this.username==""){
? alert("賬號(hào)不能為空")
? }else if(this.password==""){
? alert("密碼不能為空")
? }else{
? alert("密碼和賬號(hào)不能為空")
? }
? })
? }