From 9eebc328c231c64f3e4cd25d1c8e0ee422fa9773 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Wed, 4 Sep 2024 15:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E5=86=8C=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policeManagement/src/global.d.ts | 12 ++ .../src/stores/modules/userStore.ts | 8 +- policeManagement/src/views/register.vue | 189 +++++++++++------- 3 files changed, 131 insertions(+), 78 deletions(-) diff --git a/policeManagement/src/global.d.ts b/policeManagement/src/global.d.ts index d977a79..98e6ca2 100644 --- a/policeManagement/src/global.d.ts +++ b/policeManagement/src/global.d.ts @@ -8,3 +8,15 @@ interface JsonResult { message: string; data?: T; } +interface dataStatus { + account: string; + password: string; + remark: string; + checkStatus: { + extData: { + color: string; + }; + label: string; + value: number; + }; +} \ No newline at end of file diff --git a/policeManagement/src/stores/modules/userStore.ts b/policeManagement/src/stores/modules/userStore.ts index f52f0f5..5bc4b67 100644 --- a/policeManagement/src/stores/modules/userStore.ts +++ b/policeManagement/src/stores/modules/userStore.ts @@ -1,5 +1,5 @@ -import {defineStore} from "pinia"; -import {TokenInfo, UserStore} from "@/types/stores/userStore.ts"; +import { defineStore } from "pinia"; +import { TokenInfo, UserStore } from "@/types/stores/userStore.ts"; export const useUserStore = defineStore({ id: 'useUserStore', @@ -19,6 +19,10 @@ export const useUserStore = defineStore({ getters: { getTokenInfo: (state): TokenInfo => state.tokenInfo as TokenInfo, }, + + // persist 是 Pinia 的一个插件 pinia-plugin-persistedstate 提供的功能 + // 用来让状态数据在页面刷新或重新加载时保存在浏览器的存储中 + // 通过这个插件,你可以让 Pinia store 的状态持久化,即即使页面刷新,数据也不会丢失 persist: { key: "useUserStore", storage: window.localStorage, diff --git a/policeManagement/src/views/register.vue b/policeManagement/src/views/register.vue index 14b1ff7..e691b91 100644 --- a/policeManagement/src/views/register.vue +++ b/policeManagement/src/views/register.vue @@ -32,21 +32,21 @@ - + - + - - + + - - + + @@ -60,13 +60,14 @@
- -
账户:{{ account }}
-
密码:{{ password }}
-
- - 查询审核状态 - 去登录 + + + + + + 确认 + +
@@ -78,24 +79,25 @@