|
|
@@ -5,7 +5,7 @@
|
|
|
* @param {*} key
|
|
|
* @returns
|
|
|
*/
|
|
|
-export const getSetting = async (that, module, key) => {
|
|
|
+export const getSetting = async (that, module = '', key = '') => {
|
|
|
try {
|
|
|
const org = that.$store.getters.level.first || ''
|
|
|
const sql = `select setting from t_ipcc where org_ = '${org}' limit 1`
|
|
|
@@ -13,7 +13,14 @@ export const getSetting = async (that, module, key) => {
|
|
|
if (data.length > 0 && data[0]?.setting) {
|
|
|
const setting = data[0].setting?.replace(/\n/g, '')
|
|
|
const res = JSON.parse(setting)
|
|
|
- return res?.[module]?.[key]
|
|
|
+ // 根据module和key的存在情况返回不同的结果
|
|
|
+ if (module !== '') {
|
|
|
+ if (key !== '') {
|
|
|
+ return res?.[module]?.[key]
|
|
|
+ }
|
|
|
+ return res?.[module]
|
|
|
+ }
|
|
|
+ return res
|
|
|
}
|
|
|
return null
|
|
|
} catch (error) {
|