thirdpayment
elf 11 months ago
parent 05a22e0654
commit 6f6dbdc34c

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<!-- import CSS --> <!-- 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> <title>我的账户</title>
</head> </head>
<body> <body>
@ -27,11 +27,11 @@
</el-container> </el-container>
</div> </div>
</body> </body>
<!-- import Vue before Element --> <!-- 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 --> <!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/index.min.js"></script>
<script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.5.0/axios.min.js"></script>
<script> <script>
new Vue({ new Vue({
el: '#app', el: '#app',

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

Loading…
Cancel
Save