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