直播添加标签
This commit is contained in:
@@ -9,15 +9,16 @@
|
||||
<view class="title">账号登录</view>
|
||||
<view class="labales">
|
||||
<image src=""></image>
|
||||
<input type="tel" placeholder="请输入账号" />
|
||||
<input v-model="zhanghao" type="tel" placeholder="请输入账号" />
|
||||
</view>
|
||||
<view class="labales">
|
||||
<image src=""></image>
|
||||
<input type="password" placeholder="请输入密码" />
|
||||
<input v-model="mima" type="password" placeholder="请输入密码" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- denglu QQ weixin -->
|
||||
<u-button>{{login}}</u-button>
|
||||
<u-button @click="logins">{{login}}</u-button>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -32,6 +33,8 @@
|
||||
value: '',
|
||||
login: '登录',
|
||||
show: false,
|
||||
zhanghao:"",
|
||||
mima:""
|
||||
|
||||
};
|
||||
},
|
||||
@@ -54,6 +57,34 @@
|
||||
},
|
||||
loading(){
|
||||
|
||||
},
|
||||
logins(){
|
||||
this.$u.api.login({member_name:this.zhanghao,member_password:this.mima}).then((res)=>{
|
||||
console.log(res)
|
||||
if(res.errCode != 0){
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
}else{
|
||||
uni.setStorageSync("token",res.data.token)
|
||||
uni.setStorageSync("userinfo",res.data)
|
||||
this.$u.route({
|
||||
url:"/pages/index/index",
|
||||
type:"switchTab"
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
let token = uni.getStorageSync('token');
|
||||
|
||||
if(token != undefined && token){
|
||||
this.$u.route({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user