From f56e474c81bb25845b46cf99c85bd313dbfcd3b5 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期六, 31 一月 2026 19:26:25 +0800
Subject: [PATCH] 项目初始化+首页+公告详情页面
---
src/views/login/components/password.vue | 93 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 93 insertions(+), 0 deletions(-)
diff --git a/src/views/login/components/password.vue b/src/views/login/components/password.vue
new file mode 100644
index 0000000..0ba1cbb
--- /dev/null
+++ b/src/views/login/components/password.vue
@@ -0,0 +1,93 @@
+<template>
+ <div class="login-form-content">
+ <p>璐﹀彿瀵嗙爜鐧诲綍</p>
+ <el-form ref="accountForm" :model="form" :rules="rules" style="width: 100%;">
+ <el-form-item prop="username">
+ <el-input
+ v-model="form.username"
+ placeholder="璇疯緭鍏ヨ处鍙�"
+ style="width: 100%" size="large"
+ />
+ </el-form-item>
+ <el-form-item prop="password">
+ <el-input
+ v-model="form.password"
+ placeholder="璇疯緭鍏ュ瘑鐮�"
+ style="width: 100%" size="large"
+ type="password"
+ show-password
+ />
+ </el-form-item>
+ </el-form>
+ <el-button type="primary" style="width: 100%" size="large" @click="login()">鐧� 褰�</el-button>
+ <el-row align="middle">
+ <el-text class="text-primary cursor-p" @click="resetDialog()">蹇樿瀵嗙爜</el-text>
+ <el-divider style="height: 20px;margin:0 14px" direction="vertical"></el-divider>
+ <el-text class="text-primary cursor-p" @click="changeLoginType('mobile')">鎵嬫満鍙烽獙璇佺爜鐧诲綍</el-text>
+ <el-divider style="height: 20px;margin:0 14px" direction="vertical"></el-divider>
+ <el-text @click="changeLoginType('qrCode')" class="text-primary cursor-p">寰俊鎵爜鐧诲綍</el-text>
+ </el-row>
+ </div>
+</template>
+
+<script>
+import { tokenUtils } from '@/utils/axios.js';
+export default {
+ data() {
+ return {
+ form: {
+ username: this.$route.query.target=='tenant' ? '13030003000' : 'admin',
+ password: this.$route.query.target=='tenant' ? '123456' : 'admin123',
+ },
+ rules: {
+ username: [ this.$rules.required('璐﹀彿涓嶈兘涓虹┖') ],
+ password: [ this.$rules.required('瀵嗙爜涓嶈兘涓虹┖') ]
+ }
+ }
+ },
+ methods: {
+ changeLoginType(type) {
+ this.$emit('changeLoginType', type)
+ },
+ resetDialog() {
+
+ },
+ async login() {
+ const validate = await this.$refs.accountForm.validate()
+ if (validate) {
+ const data = {
+ ...this.form
+ }
+ this.$axios.post('/system/auth/login', data).then(res => {
+ if (res.data.code == 0 && res.data.data) {
+ const resData = res.data.data
+ tokenUtils.setTokens(resData.accessToken, resData.refreshToken)
+ this.$message.success('鐧诲綍鎴愬姛')
+ this.$router.push('/console')
+ } else {
+ this.$message.error(res.data.msg || '鐧诲綍澶辫触')
+ }
+ })
+ }
+ }
+ }
+}
+</script>
+
+<style>
+.login-form-content {
+ width: 100%;
+ height: 350px;
+ padding: 20px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
+ align-items: center;
+}
+.login-form-content p{
+ font-size: 22px;
+ font-weight: bold;
+ color: black;
+ letter-spacing: 10px;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0