去掉默认展示username

This commit is contained in:
扈兆增 2026-04-27 13:43:34 +08:00
parent e9318c6466
commit 7707ea90f7
5 changed files with 12 additions and 54 deletions

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="qgc-buji-web" /> <meta name="description" content="qgc-buji-web" />
<meta name="keywords" content="qgc-buji-web" /> <meta name="keywords" content="qgc-buji-web" />
<title>水电水利建设项目全过程数据填报系统</title> <title>水电水利建设项目全过程环境管理信息平台数据填报系统</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -7,7 +7,7 @@ export default {
// 登录页面国际化 // 登录页面国际化
login: { login: {
title: '水电水利建设项目全过程环境管理信息平台', title: '水电水利建设项目全过程环境管理信息平台',
titleSjtb: '水电水利建设项目全过程数据填报系统', titleSjtb: '水电水利建设项目全过程环境管理信息平台数据填报系统',
username: '用户名', username: '用户名',
rulesUsername: '用户账号/身份证号/手机号 不能为空', rulesUsername: '用户账号/身份证号/手机号 不能为空',
password: '密码', password: '密码',

View File

@ -159,11 +159,6 @@
> >
<span>登录</span> <span>登录</span>
</a-button> </a-button>
<div class="flex justify-center items-center mt-[10px]">
<a-button type="link" size="small">
<span>注册</span>
</a-button>
</div>
<!-- <a-button <!-- <a-button
type="link" type="link"
size="mini" size="mini"
@ -177,7 +172,6 @@
type="link" type="link"
size="mini" size="mini"
block block
@click="goRegister"
:style="{ marginTop: '10px', border: 'none' }" :style="{ marginTop: '10px', border: 'none' }"
> >
注册 注册
@ -263,7 +257,6 @@ import { setPath } from "@/utils/auth";
// //
import router from "@/router"; import router from "@/router";
import Cookies from "js-cookie";
// API // API
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { LoginData } from "@/api/auth/types"; import { LoginData } from "@/api/auth/types";
@ -302,8 +295,8 @@ const state = reactive({
redirect: "", redirect: "",
loginData: { loginData: {
uuid: "", uuid: "",
username: "admin", username: "",
password: "123456", password: "",
code: "", code: "",
} as LoginData, } as LoginData,
loginRules: { loginRules: {
@ -378,7 +371,6 @@ function onFinish() {
userStore userStore
.login(user) .login(user)
.then(() => { .then(() => {
Cookies.set("username", user.username);
setPath("/login-sjtb"); setPath("/login-sjtb");
router.push({ path: "/" }); router.push({ path: "/" });
state.loading = false; state.loading = false;
@ -412,22 +404,6 @@ function getOtherQuery(query: any) {
return acc; return acc;
}, {}); }, {});
} }
function getCookie() {
const username = Cookies.get("username");
let password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
rememberMe == "true" ? (remember.value = Boolean(rememberMe)) : false;
// cookie
state.cookiePass = password === undefined ? "" : password;
password = password === undefined ? state.loginData.password : password;
state.loginData = {
username: username === undefined ? state.loginData.username : username,
password: decrypt(password),
code: "",
uuid: "",
};
remember.value = rememberMe === undefined ? false : Boolean(rememberMe);
}
function getCode() { function getCode() {
getCaptcha().then((result: any) => { getCaptcha().then((result: any) => {
codeUrl.value = result.data.img; codeUrl.value = result.data.img;
@ -573,7 +549,6 @@ const handleResetPassword = async () => {
}; };
onMounted(() => { onMounted(() => {
getCookie();
getCode(); getCode();
}); });
</script> </script>
@ -643,8 +618,8 @@ onMounted(() => {
.slogan { .slogan {
position: absolute; position: absolute;
top: 20%; top: 20%;
left: 18%; left: 16%;
width: 700px; width: 780px;
height: 112px; height: 112px;
color: #040504; color: #040504;
font-size: 40px; font-size: 40px;

View File

@ -288,8 +288,8 @@ const state = reactive({
redirect: "", redirect: "",
loginData: { loginData: {
uuid: "", uuid: "",
username: "admin", username: "",
password: "123456", password: "",
code: "", code: "",
} as LoginData, } as LoginData,
loginRules: { loginRules: {
@ -359,11 +359,9 @@ function onFinish() {
if (user.password !== state.cookiePass) { if (user.password !== state.cookiePass) {
user.password = encrypt(user.password); user.password = encrypt(user.password);
} }
console.log(user);
userStore userStore
.login(user) .login(user)
.then(() => { .then(() => {
Cookies.set("username", user.username);
router.push({ path: "/" }); router.push({ path: "/" });
setPath('/login') setPath('/login')
state.loading = false; state.loading = false;
@ -396,22 +394,6 @@ function getOtherQuery(query: any) {
return acc; return acc;
}, {}); }, {});
} }
function getCookie() {
const username = Cookies.get("username");
let password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
rememberMe == "true" ? (remember.value = Boolean(rememberMe)) : false;
// cookie
state.cookiePass = password === undefined ? "" : password;
password = password === undefined ? state.loginData.password : password;
state.loginData = {
username: username === undefined ? state.loginData.username : username,
password: decrypt(password),
code: "",
uuid: "",
};
remember.value = rememberMe === undefined ? false : Boolean(rememberMe);
}
function getCode() { function getCode() {
getCaptcha().then((result: any) => { getCaptcha().then((result: any) => {
codeUrl.value = result.data.img; codeUrl.value = result.data.img;
@ -554,7 +536,6 @@ const handleResetPassword = async () => {
}; };
onMounted(() => { onMounted(() => {
getCookie();
getCode(); getCode();
}); });
</script> </script>

View File

@ -115,7 +115,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, h } from "vue"; import { reactive, ref, onMounted, h } from "vue";
import { UserOutlined, LockOutlined, MobileOutlined } from "@ant-design/icons-vue"; import { UserOutlined, LockOutlined, MobileOutlined } from "@ant-design/icons-vue";
import { getCaptcha, registerUser } from "@/api/auth"; import { getCaptcha,
// registerUser
} from "@/api/auth";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import router from "@/router"; import router from "@/router";
import { encrypt } from "@/utils/rsaEncrypt"; import { encrypt } from "@/utils/rsaEncrypt";
@ -225,7 +227,7 @@ const onRegister = async () => {
}; };
// //
await registerUser(registerParams); // await registerUser(registerParams);
message.success("注册成功,等待管理员审核"); message.success("注册成功,等待管理员审核");