From e7529fbb8ff56bddef9cbf9b2b712d2c185cacf2 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期五, 25 八月 2023 12:58:52 +0800
Subject: [PATCH] update 优化 登录页面redirect重定向功能
---
src/store/modules/dict.ts | 138 +++++++++++++++++++++++-----------------------
1 files changed, 69 insertions(+), 69 deletions(-)
diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts
index 50b8871..2f937b9 100644
--- a/src/store/modules/dict.ts
+++ b/src/store/modules/dict.ts
@@ -1,78 +1,78 @@
export const useDictStore = defineStore('dict', () => {
- const dict = ref<
- Array<{
- key: string;
- value: DictDataOption[];
- }>
- >([]);
+ const dict = ref<
+ Array<{
+ key: string;
+ value: DictDataOption[];
+ }>
+ >([]);
- /**
- * 鑾峰彇瀛楀吀
- * @param _key 瀛楀吀key
- */
- const getDict = (_key: string): DictDataOption[] | null => {
- if (_key == null && _key == '') {
- return null;
- }
- try {
- for (let i = 0; i < dict.value.length; i++) {
- if (dict.value[i].key == _key) {
- return dict.value[i].value;
- }
- }
- } catch (e) {
- return null;
- }
- return null;
- };
+ /**
+ * 鑾峰彇瀛楀吀
+ * @param _key 瀛楀吀key
+ */
+ const getDict = (_key: string): DictDataOption[] | null => {
+ if (_key == null && _key == '') {
+ return null;
+ }
+ try {
+ for (let i = 0; i < dict.value.length; i++) {
+ if (dict.value[i].key == _key) {
+ return dict.value[i].value;
+ }
+ }
+ } catch (e) {
+ return null;
+ }
+ return null;
+ };
- /**
- * 璁剧疆瀛楀吀
- * @param _key 瀛楀吀key
- * @param _value 瀛楀吀value
- */
- const setDict = (_key: string, _value: DictDataOption[]) => {
- if (_key !== null && _key !== '') {
- dict.value.push({
- key: _key,
- value: _value
- });
- }
- };
+ /**
+ * 璁剧疆瀛楀吀
+ * @param _key 瀛楀吀key
+ * @param _value 瀛楀吀value
+ */
+ const setDict = (_key: string, _value: DictDataOption[]) => {
+ if (_key !== null && _key !== '') {
+ dict.value.push({
+ key: _key,
+ value: _value
+ });
+ }
+ };
- /**
- * 鍒犻櫎瀛楀吀
- * @param _key
- */
- const removeDict = (_key: string): boolean => {
- let bln = false;
- try {
- for (let i = 0; i < dict.value.length; i++) {
- if (dict.value[i].key == _key) {
- dict.value.splice(i, 1);
- return true;
- }
- }
- } catch (e) {
- bln = false;
- }
- return bln;
- };
+ /**
+ * 鍒犻櫎瀛楀吀
+ * @param _key
+ */
+ const removeDict = (_key: string): boolean => {
+ let bln = false;
+ try {
+ for (let i = 0; i < dict.value.length; i++) {
+ if (dict.value[i].key == _key) {
+ dict.value.splice(i, 1);
+ return true;
+ }
+ }
+ } catch (e) {
+ bln = false;
+ }
+ return bln;
+ };
- /**
- * 娓呯┖瀛楀吀
- */
- const cleanDict = (): void => {
- dict.value = [];
- };
+ /**
+ * 娓呯┖瀛楀吀
+ */
+ const cleanDict = (): void => {
+ dict.value = [];
+ };
- return {
- dict,
- getDict,
- setDict,
- removeDict,
- cleanDict
- };
+ return {
+ dict,
+ getDict,
+ setDict,
+ removeDict,
+ cleanDict
+ };
});
export default useDictStore;
--
Gitblit v1.9.3