From 26e8f8ac14602e1652f3cf9330b79e4eec5c9252 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= <877617829@qq.com>
Date: Sun, 3 Nov 2024 22:16:39 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?=
=?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8E=A7=E5=88=B6=E5=8F=B0=20touchstart=20?=
=?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=AD=A6=E5=91=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
index.html | 11 +++++++++--
main.js | 3 ++-
package.json | 3 ++-
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index d650d19..84950c4 100644
--- a/index.html
+++ b/index.html
@@ -4,8 +4,15 @@
diff --git a/main.js b/main.js
index 6431d81..80331db 100644
--- a/main.js
+++ b/main.js
@@ -4,7 +4,8 @@ import { createSSRApp } from 'vue'
import store from './store'
import XEUtils from '@/plugins/xe-utils'
import snowy from '@/plugins/snowy'
-
+//解决控制台 touchstart 事件警告
+import 'default-passive-events'
export function createApp() {
const app = createSSRApp(App)
app.use(store)
diff --git a/package.json b/package.json
index 558438e..0d480bc 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"keywords": [],
"author": "xiaonuo-Team",
"dependencies": {
+ "default-passive-events": "^2.0.0",
"sm-crypto": "^0.3.11"
}
-}
\ No newline at end of file
+}
--
Gitee
From ab1bd9980fe9e94a73c7da61658f63ea23ef371f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= <877617829@qq.com>
Date: Sun, 3 Nov 2024 22:31:44 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BC=93=E5=AD=98=E9=80=9A=E7=94=A8=E5=8F=82?=
=?UTF-8?q?=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
store/getters.js | 1 +
store/modules/global.js | 11 ++++++++++-
utils/constant.js | 1 +
utils/storage.js | 1 +
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/store/getters.js b/store/getters.js
index 8095db3..a3bc822 100644
--- a/store/getters.js
+++ b/store/getters.js
@@ -12,5 +12,6 @@ const getters = {
refreshKey: state => state.global.refreshKey,
refreshFlag: state => state.global.refreshFlag,
refreshParam: state => state.global.refreshParam,
+ commonParam: state => state.global.commonParam,
}
export default getters
\ No newline at end of file
diff --git a/store/modules/global.js b/store/modules/global.js
index 9d4ff87..b87ce39 100644
--- a/store/modules/global.js
+++ b/store/modules/global.js
@@ -33,7 +33,9 @@ export default {
// 刷新标记
refreshFlag: storage.get(constant.refreshFlag) || false,
// 刷新参数
- refreshParam: storage.get(constant.refreshParam) || null
+ refreshParam: storage.get(constant.refreshParam) || null,
+ // 通用参数
+ commonParam: storage.get(constant.refreshParam) || null,
},
mutations: {
SET_envKey: (state, envKey) => {
@@ -84,6 +86,10 @@ export default {
state.refreshParam = refreshParam
storage.set(constant.refreshParam, refreshParam)
},
+ SET_commonParam: (state, commonParam) => {
+ state.commonParam = commonParam
+ storage.set(constant.commonParam, commonParam)
+ },
// 清除缓存
CLEAR_cache: (state) => {
// 租户域清理
@@ -110,6 +116,9 @@ export default {
// 刷新参数
state.refreshParam = null
storage.remove(constant.refreshParam)
+ // 通用参数
+ state.commonParam = null
+ storage.remove(constant.commonParam)
// 配置信息
// state.sysBaseConfig = {}
// storage.remove(constant.sysBaseConfig)
diff --git a/utils/constant.js b/utils/constant.js
index 9fd8626..574578d 100644
--- a/utils/constant.js
+++ b/utils/constant.js
@@ -11,5 +11,6 @@ const constant = {
refreshKey: 'refreshKey',
refreshFlag: 'refreshFlag',
refreshParam: 'refreshParam',
+ commonParam: 'commonParam',
}
export default constant
\ No newline at end of file
diff --git a/utils/storage.js b/utils/storage.js
index 2ae717f..1aa8dbd 100644
--- a/utils/storage.js
+++ b/utils/storage.js
@@ -14,6 +14,7 @@ let storageNodeKeys = [
constant.refreshKey,
constant.refreshFlag,
constant.refreshParam,
+ constant.commonParam,
]
// 存储的数据
let storageData = uni.getStorageSync(storageKey) || {}
--
Gitee
From 621173a1e0f2dadbc73b2f7f43c12f0399d5b847 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= <877617829@qq.com>
Date: Sun, 3 Nov 2024 23:12:33 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?=
=?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E5=92=8C=E5=AF=86=E7=A0=81?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/mine/info/edit.vue | 4 ++++
pages/mine/pwd/index.vue | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/pages/mine/info/edit.vue b/pages/mine/info/edit.vue
index 7a85c6a..050e822 100644
--- a/pages/mine/info/edit.vue
+++ b/pages/mine/info/edit.vue
@@ -52,6 +52,10 @@
userCenterApi.userUpdateUserInfo(formData.value).then(data => {
// 更新缓存
store.commit('SET_userInfo', formData.value)
+ uni.$snowy.modal.showToast('修改成功')
+ uni.navigateBack({
+ delta: 1
+ })
})
})
}
diff --git a/pages/mine/pwd/index.vue b/pages/mine/pwd/index.vue
index 1e3eeb9..9d1feeb 100644
--- a/pages/mine/pwd/index.vue
+++ b/pages/mine/pwd/index.vue
@@ -60,6 +60,10 @@
password: user.oldPassword,
newPassword: user.newPassword
}).then(data => {
+ uni.$snowy.modal.showToast('修改成功')
+ uni.navigateBack({
+ delta: 1
+ })
})
})
}
--
Gitee
From b8e4294cd4713de2d27e58515659094bf1b47cca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= <877617829@qq.com>
Date: Sun, 3 Nov 2024 23:58:34 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?=
=?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BA=BA=E5=91=98?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/snowy/snowy-user-picker/snowy-user-picker.vue | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/components/snowy/snowy-user-picker/snowy-user-picker.vue b/components/snowy/snowy-user-picker/snowy-user-picker.vue
index 23dc669..bc5e62b 100644
--- a/components/snowy/snowy-user-picker/snowy-user-picker.vue
+++ b/components/snowy/snowy-user-picker/snowy-user-picker.vue
@@ -1,5 +1,5 @@
-
+
@@ -25,6 +25,11 @@
const getOptData = (param, callback) => {
emits('getOptData', param, callback)
}
+ const confirm = ({ curSelDataKey, curSelData }) => {
+ // 更新数据
+ emits('update:modelValue', curSelDataKey)
+ emits('confirm', { curSelDataKey, curSelData })
+ }
\ No newline at end of file
--
Gitee
From 32e6eac8b535afb283e2daf42faad1dd1531cdc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= <877617829@qq.com>
Date: Tue, 5 Nov 2024 20:59:19 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98key?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
utils/constant.js => enum/store-key.js | 5 +-
store/modules/global.js | 68 +++++++++++++-------------
utils/storage.js | 19 ++-----
3 files changed, 40 insertions(+), 52 deletions(-)
rename utils/constant.js => enum/store-key.js (79%)
diff --git a/utils/constant.js b/enum/store-key.js
similarity index 79%
rename from utils/constant.js
rename to enum/store-key.js
index 574578d..eedfddd 100644
--- a/utils/constant.js
+++ b/enum/store-key.js
@@ -1,4 +1,4 @@
-const constant = {
+export const STORE_KEY_ENUM = {
envKey: "envKey",
allEnv: "allEnv",
tenantDomain: 'tenantDomain',
@@ -13,4 +13,5 @@ const constant = {
refreshParam: 'refreshParam',
commonParam: 'commonParam',
}
-export default constant
\ No newline at end of file
+
+export const STORE_KEY_OPTS = [...Object.values(STORE_KEY_ENUM)]
\ No newline at end of file
diff --git a/store/modules/global.js b/store/modules/global.js
index b87ce39..6f299cd 100644
--- a/store/modules/global.js
+++ b/store/modules/global.js
@@ -1,6 +1,6 @@
import config from '@/config'
import storage from '@/utils/storage'
-import constant from '@/utils/constant'
+import { STORE_KEY_ENUM } from '@/enum/store-key'
import smCrypto from '@/utils/sm-crypto'
import loginApi from '@/api/auth/login-api'
import userCenterApi from '@/api/sys/user-center-api'
@@ -11,44 +11,44 @@ import env from '@/env'
export default {
state: {
// 环境key
- envKey: storage.get(constant.envKey) || env.DEFAULT_ENV_KEY,
+ envKey: storage.get(STORE_KEY_ENUM.envKey) || env.DEFAULT_ENV_KEY,
// 所有环境
- allEnv: storage.get(constant.allEnv) || env.DEFAULT_ALL_ENV,
+ allEnv: storage.get(STORE_KEY_ENUM.allEnv) || env.DEFAULT_ALL_ENV,
// 当前租户域
- tenantDomain: storage.get(constant.tenantDomain) || env.DEFAULT_ALL_ENV[env.DEFAULT_ENV_KEY].tenantDomain,
+ tenantDomain: storage.get(STORE_KEY_ENUM.tenantDomain) || env.DEFAULT_ALL_ENV[env.DEFAULT_ENV_KEY].tenantDomain,
// token信息
token: getToken(),
// 首页配置
- homeConfigs: storage.get(constant.homeConfigs) || config.HOME_CONFIGS,
+ homeConfigs: storage.get(STORE_KEY_ENUM.homeConfigs) || config.HOME_CONFIGS,
// 用户移动端菜单(用户菜单处理后的结果)
- userMobileMenus: storage.get(constant.userMobileMenus),
+ userMobileMenus: storage.get(STORE_KEY_ENUM.userMobileMenus),
// 用户信息
- userInfo: storage.get(constant.userInfo),
+ userInfo: storage.get(STORE_KEY_ENUM.userInfo),
// 系统配置
- sysBaseConfig: storage.get(constant.sysBaseConfig) || config.SYS_BASE_CONFIG,
+ sysBaseConfig: storage.get(STORE_KEY_ENUM.sysBaseConfig) || config.SYS_BASE_CONFIG,
// 字典数据
- dictTypeTreeData: storage.get(constant.dictTypeTreeData),
+ dictTypeTreeData: storage.get(STORE_KEY_ENUM.dictTypeTreeData),
// 刷新KEY
- refreshKey: storage.get(constant.refreshKey) || 'page',
+ refreshKey: storage.get(STORE_KEY_ENUM.refreshKey) || 'page',
// 刷新标记
- refreshFlag: storage.get(constant.refreshFlag) || false,
+ refreshFlag: storage.get(STORE_KEY_ENUM.refreshFlag) || false,
// 刷新参数
- refreshParam: storage.get(constant.refreshParam) || null,
+ refreshParam: storage.get(STORE_KEY_ENUM.refreshParam) || null,
// 通用参数
- commonParam: storage.get(constant.refreshParam) || null,
+ commonParam: storage.get(STORE_KEY_ENUM.refreshParam) || null,
},
mutations: {
SET_envKey: (state, envKey) => {
state.envKey = envKey
- storage.set(constant.envKey, envKey)
+ storage.set(STORE_KEY_ENUM.envKey, envKey)
},
SET_allEnv: (state, allEnv) => {
state.allEnv = allEnv
- storage.set(constant.allEnv, allEnv)
+ storage.set(STORE_KEY_ENUM.allEnv, allEnv)
},
SET_tenantDomain: (state, tenantDomain) => {
state.tenantDomain = tenantDomain
- storage.set(constant.tenantDomain, tenantDomain)
+ storage.set(STORE_KEY_ENUM.tenantDomain, tenantDomain)
},
SET_token: (state, token) => {
state.token = token
@@ -56,72 +56,72 @@ export default {
},
SET_homeConfigs: (state, homeConfigs) => {
state.homeConfigs = homeConfigs
- storage.set(constant.homeConfigs, homeConfigs)
+ storage.set(STORE_KEY_ENUM.homeConfigs, homeConfigs)
},
SET_userMobileMenus: (state, userMobileMenus) => {
state.userMobileMenus = userMobileMenus
- storage.set(constant.userMobileMenus, userMobileMenus)
+ storage.set(STORE_KEY_ENUM.userMobileMenus, userMobileMenus)
},
SET_userInfo: (state, userInfo) => {
state.userInfo = userInfo
- storage.set(constant.userInfo, userInfo)
+ storage.set(STORE_KEY_ENUM.userInfo, userInfo)
},
SET_sysBaseConfig: (state, sysBaseConfig) => {
state.sysBaseConfig = sysBaseConfig
- storage.set(constant.sysBaseConfig, sysBaseConfig)
+ storage.set(STORE_KEY_ENUM.sysBaseConfig, sysBaseConfig)
},
SET_dictTypeTreeData: (state, dictTypeTreeData) => {
state.dictTypeTreeData = dictTypeTreeData
- storage.set(constant.dictTypeTreeData, dictTypeTreeData)
+ storage.set(STORE_KEY_ENUM.dictTypeTreeData, dictTypeTreeData)
},
SET_refreshKey: (state, refreshKey) => {
state.refreshKey = refreshKey
- storage.set(constant.refreshKey, refreshKey)
+ storage.set(STORE_KEY_ENUM.refreshKey, refreshKey)
},
SET_refreshFlag: (state, refreshFlag) => {
state.refreshFlag = refreshFlag
- storage.set(constant.refreshFlag, refreshFlag)
+ storage.set(STORE_KEY_ENUM.refreshFlag, refreshFlag)
},
SET_refreshParam: (state, refreshParam) => {
state.refreshParam = refreshParam
- storage.set(constant.refreshParam, refreshParam)
+ storage.set(STORE_KEY_ENUM.refreshParam, refreshParam)
},
SET_commonParam: (state, commonParam) => {
state.commonParam = commonParam
- storage.set(constant.commonParam, commonParam)
+ storage.set(STORE_KEY_ENUM.commonParam, commonParam)
},
// 清除缓存
CLEAR_cache: (state) => {
// 租户域清理
// state.tenantDomain = ''
- // storage.remove(constant.tenantDomain)
+ // storage.remove(STORE_KEY_ENUM.tenantDomain)
// token
state.token = ''
removeToken()
// 移动端用户菜单
state.userMobileMenus = {}
- storage.remove(constant.userMobileMenus)
+ storage.remove(STORE_KEY_ENUM.userMobileMenus)
// 用户信息
state.userInfo = {}
- storage.remove(constant.userInfo)
+ storage.remove(STORE_KEY_ENUM.userInfo)
// 字典信息
state.dictTypeTreeData = {}
- storage.remove(constant.dictTypeTreeData)
+ storage.remove(STORE_KEY_ENUM.dictTypeTreeData)
// 刷新标识
state.refreshKey = null
- storage.remove(constant.refreshKey)
+ storage.remove(STORE_KEY_ENUM.refreshKey)
// 刷新标识
state.refreshFlag = false
- storage.remove(constant.refreshFlag)
+ storage.remove(STORE_KEY_ENUM.refreshFlag)
// 刷新参数
state.refreshParam = null
- storage.remove(constant.refreshParam)
+ storage.remove(STORE_KEY_ENUM.refreshParam)
// 通用参数
state.commonParam = null
- storage.remove(constant.commonParam)
+ storage.remove(STORE_KEY_ENUM.commonParam)
// 配置信息
// state.sysBaseConfig = {}
- // storage.remove(constant.sysBaseConfig)
+ // storage.remove(STORE_KEY_ENUM.sysBaseConfig)
// storage.clean()
},
},
diff --git a/utils/storage.js b/utils/storage.js
index 1aa8dbd..d2ed545 100644
--- a/utils/storage.js
+++ b/utils/storage.js
@@ -1,21 +1,8 @@
-import constant from './constant'
+import { STORE_KEY_ENUM } from '@/enum/store-key'
// 存储变量名
-let storageKey = 'storage_data'
+let storageKey = 'snowy-mobile-unitui'
// 存储节点变量名
-let storageNodeKeys = [
- constant.envKey,
- constant.allEnv,
- constant.sysBaseConfig,
- constant.homeConfigs,
- constant.userInfo,
- constant.userMobileMenus,
- constant.dictTypeTreeData,
- constant.tenantDomain,
- constant.refreshKey,
- constant.refreshFlag,
- constant.refreshParam,
- constant.commonParam,
-]
+let storageNodeKeys = [...Object.values(STORE_KEY_ENUM)]
// 存储的数据
let storageData = uni.getStorageSync(storageKey) || {}
const storage = {
--
Gitee