From ad4928108a77fa11f37ff0088a2c53a338d1c526 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Wed, 19 Mar 2025 18:10:09 +0800
Subject: [PATCH] 增加 cursor rules 工具,创建系统链接

---
 forms/chinaArea/ChinaLocations.js |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/forms/chinaArea/ChinaLocations.js b/forms/chinaArea/ChinaLocations.js
index ff1efb2..ee602ce 100644
--- a/forms/chinaArea/ChinaLocations.js
+++ b/forms/chinaArea/ChinaLocations.js
@@ -27,7 +27,7 @@
     success: response => {
         locationRes = response.data;
         readyCallbacks.forEach(callback => callback());
-    }
+    },
 });
 
 export class ChinaLocations {
@@ -213,8 +213,16 @@
             if (typeof regions === 'string') {
                 regions = regions.split(',');
             }
-            if (!regions || regions.length === 0 || !regions[0]) {
+            if (!regions || regions.length === 0 || !regions[0] || !regions[1]) {
                 callback('');
+                return;
+            }
+            // 中文转编码
+            if (!/^\d+$/.test(regions[0])) {
+                this.getRegionCodes(regions, regionsCode => {
+                    this.getRegionsArea(regionsCode, callback);
+                });
+                return;
             }
             let area = '';
             // 省
@@ -238,6 +246,6 @@
             callback(area);
         });
     }
-};
+}
 
 export const $locations = new ChinaLocations();
\ No newline at end of file

--
Gitblit v1.9.1