From e6d0599b256866fc9fb0b06c1abbee50725d2d2c Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期二, 28 十一月 2023 12:36:30 +0800 Subject: [PATCH] 优化个人中心/基本资料修改时数据显示问题 --- ruoyi-ui/src/utils/ruoyi.js | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index f9f4eaf..44bf9c4 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -86,10 +86,13 @@ return actions.join(''); } -// 回显数据字典(字符串数组) +// 回显数据字典(字符串、数组) export function selectDictLabels(datas, value, separator) { - if (value === undefined) { + if (value === undefined || value.length ===0) { return ""; + } + if (Array.isArray(value)) { + value = value.join(","); } var actions = []; var currentSeparator = undefined === separator ? "," : separator; @@ -210,7 +213,7 @@ if (value !== null && value !== "" && typeof (value) !== "undefined") { if (typeof value === 'object') { for (const key of Object.keys(value)) { - if (value[key] !== null && value !== "" && typeof (value[key]) !== 'undefined') { + if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { let params = propName + '[' + key + ']'; var subPart = encodeURIComponent(params) + "="; result += subPart + encodeURIComponent(value[key]) + "&"; @@ -225,12 +228,6 @@ } // 验证是否为blob格式 -export async function blobValidate(data) { - try { - const text = await data.text(); - JSON.parse(text); - return false; - } catch (error) { - return true; - } +export function blobValidate(data) { + return data.type !== 'application/json' } -- Gitblit v1.9.2