thirdpayment
elf 11 months ago
parent 05a22e0654
commit 6f6dbdc34c

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/theme-chalk/index.min.css">
<title>我的账户</title>
</head>
<body>
@ -28,10 +28,10 @@
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/index.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/1.5.0/axios.min.js"></script>
<script>
new Vue({
el: '#app',

@ -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('请求错误');

Loading…
Cancel
Save