|
|
|
@ -13,32 +13,32 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-tabs v-model="activeName">
|
|
|
|
|
<el-tab-pane label="注册" name="register">
|
|
|
|
|
<el-form ref="registerForm" :model="registerForm" label-width="80px">
|
|
|
|
|
<el-tab-pane label="登录" name="login">
|
|
|
|
|
<el-form ref="loginForm" :model="loginForm" label-width="80px">
|
|
|
|
|
<el-form-item label="账号">
|
|
|
|
|
<el-input v-model="registerForm.username"></el-input>
|
|
|
|
|
<el-input v-model="loginForm.username"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="密码">
|
|
|
|
|
<el-input show-password v-model="registerForm.password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="确认密码">
|
|
|
|
|
<el-input show-password v-model="registerForm.confirm_password"></el-input>
|
|
|
|
|
<el-input show-password v-model="loginForm.password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="register">注册</el-button>
|
|
|
|
|
<el-button type="primary" @click="login">登录</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="登录" name="login">
|
|
|
|
|
<el-form ref="loginForm" :model="loginForm" label-width="80px">
|
|
|
|
|
<el-tab-pane label="注册" name="register">
|
|
|
|
|
<el-form ref="registerForm" :model="registerForm" label-width="80px">
|
|
|
|
|
<el-form-item label="账号">
|
|
|
|
|
<el-input v-model="loginForm.username"></el-input>
|
|
|
|
|
<el-input v-model="registerForm.username"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="密码">
|
|
|
|
|
<el-input show-password v-model="loginForm.password"></el-input>
|
|
|
|
|
<el-input show-password v-model="registerForm.password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="确认密码">
|
|
|
|
|
<el-input show-password v-model="registerForm.confirm_password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="login">登录</el-button>
|
|
|
|
|
<el-button type="primary" @click="register">注册</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
@ -59,7 +59,7 @@
|
|
|
|
|
el: '#app',
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
activeName: 'register',
|
|
|
|
|
activeName: 'login',
|
|
|
|
|
loginForm: {
|
|
|
|
|
username: '',
|
|
|
|
|
password: ''
|
|
|
|
@ -103,6 +103,7 @@
|
|
|
|
|
return this.$message.error(response.data.message);
|
|
|
|
|
}
|
|
|
|
|
window.sessionStorage.setItem('token', result.data.token)
|
|
|
|
|
window.location.href = '/account.html';
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
this.$message.error('请求错误');
|
|
|
|
|