diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue index fb622ab..1187e65 100644 --- a/src/views/system/tenant/index.vue +++ b/src/views/system/tenant/index.vue @@ -226,10 +226,13 @@ const resetQuery = (formEl: FormInstance | undefined) => { }; // 解析城市名称 -const getCityName = (cityArr: string[]) => { - if (!cityArr || cityArr.length === 0) return ''; - // 这里简单模拟,实际可以用 cityOptions 递归查找 - return cityArr.join(' / '); +const getCityName = (cityName: string | string[]) => { + if (!cityName) return ''; + // 如果是数组则用 / 连接,如果是字符串直接返回 + if (Array.isArray(cityName)) { + return cityName.join(' / '); + } + return cityName; }; onMounted(() => {