Explorar el Código

记录拍照结果数据至数据库修复

844184169 hace 6 meses
padre
commit
9be42ce86b
Se han modificado 1 ficheros con 7 adiciones y 3 borrados
  1. 7 3
      TeamAAS-VM/Services/RemoteCommandService.cs

+ 7 - 3
TeamAAS-VM/Services/RemoteCommandService.cs

@@ -2072,11 +2072,15 @@ namespace TeamAAS_VP.Services
                 }
                 //获取当前的产品SN
                 string productSN = _productService.CurrentProductCode;
-                //如果产品SN存在非法字符,则替换为下划线
-                foreach (char c in System.IO.Path.GetInvalidFileNameChars())
+                if (!string.IsNullOrEmpty(productSN))
                 {
-                    productSN = productSN.Replace(c, '_');
+                    //如果产品SN存在非法字符,则替换为下划线
+                    foreach (char c in System.IO.Path.GetInvalidFileNameChars())
+                    {
+                        productSN = productSN.Replace(c, '_');
+                    }
                 }
+
                 //当前用户
                 string currentUser = _systemDatabaseService.GetCurrentUser()?.UserName;