Browse Source

nameRule的parse调整,返回一个index给前端进行光标固定

kely 4 months ago
parent
commit
5dde3805ff
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/Http/Controllers/API/NameRuleController.php

+ 2 - 0
app/Http/Controllers/API/NameRuleController.php

@@ -184,10 +184,12 @@ class NameRuleController extends Controller
         $namingRuleCheck = new NamingRuleCheck();
 
         $items = [];
+        $index=1;
         foreach ($request->names as $name) {
             $pathInfo = pathinfo($name);
             $filename=$pathInfo['filename'];
             $items[] = [
+                'index'=>$index++,
                 'name' => $name,
                 ...$namingRuleCheck->checkByName($filename, $namingRule, $code)
             ];