登录注册

This commit is contained in:
asd
2019-11-28 11:19:20 +08:00
parent fb2060b836
commit 319b6fb7e6
4 changed files with 275 additions and 8 deletions

View File

@@ -10,18 +10,18 @@
<input type="text" class="shuru" placeholder="输入手机号" />
</div>-->
<div class="tel yzm">
<input type="text" class="shuru tel1" placeholder="输入手机号或邮箱" />
<input type="text" class="shuru tel1" placeholder="输入手机号或邮箱" v-model="username"/>
<!-- <button class="getyzm">发送验证码</button> -->
</div>
<div class="tel yzm">
<input type="text" class="shuru tel1" placeholder="输入密码" />
<input type="password" class="shuru tel1" placeholder="输入密码" v-model="pwd"/>
<!-- <button class="getyzm">发送验证码</button> -->
</div>
<div class="ale">
<p class="alert">未注册手机验证后自动登录</p>
<p>注册即同意隐私保护指引</p>
</div>
<button class="submit">登录</button>
<button class="submit" @click="sub">登录</button>
<div class="other">
<p>密码登录</p>
<p @click="open">需要帮助</p>
@@ -52,7 +52,9 @@
export default {
data() {
return {
ifshow: false
ifshow: false,
username:"",
pwd:""
};
},
methods: {
@@ -61,6 +63,15 @@ export default {
},
off(){
this.ifshow=false
},
sub(){
let t=this;
this.axios.post("http://lawpro.earnest.pro/api/Main/login",{uname:t.username,password:t.pwd}).then((res)=>{
localStorage.setItem('token', res.data.data)
this.$router.push({
path: `/index`,
})
})
}
}
};