From 19a098481efceb70badba8069b17ba8da8130254 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 6 May 2021 11:34:33 +0800 Subject: [PATCH] * adjust demo sql and fix ls gitlib. --- db/demo.sql | 12 ++++++------ db/endemo.sql | 12 ++++++------ lib/scm/gitlab.class.php | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/db/demo.sql b/db/demo.sql index b8f56c1164..40eb8728df 100644 --- a/db/demo.sql +++ b/db/demo.sql @@ -663,12 +663,12 @@ REPLACE INTO `zt_user` (`company`, `dept`, `account`, `type`, `password`, `role` (0, 5, 'productManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'po', '产品经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '192.168.0.8', 1338866083, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), (0, 6, 'projectManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'pm', '项目经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 4, '10.0.2.2', 1619580798, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), (0, 2, 'dev1', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发甲', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '10.0.2.2', 1619586993, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 2, 'dev2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587173, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 2, 'dev3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587220, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 3, 'tester1', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试甲', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '192.168.0.8', 1338865739, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 3, 'tester2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '192.168.0.8', 1338865450, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 3, 'tester3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 1, '192.168.0.8', 1338865125, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 1, 'testManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qd', '测试经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 6, '192.168.0.8', 1338865842, 0, '0000-00-00 00:00:00', '', 0, 0, '0'); +(0, 2, 'dev2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587173, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 2, 'dev3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587220, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 3, 'tester1', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试甲', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '192.168.0.8', 1338865739, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 3, 'tester2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '192.168.0.8', 1338865450, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 3, 'tester3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 1, '192.168.0.8', 1338865125, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 1, 'testManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qd', '测试经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 6, '192.168.0.8', 1338865842, 0, '0000-00-00 00:00:00', '', 0, 0, '1'); INSERT INTO `zt_usergroup` (`account`, `group`, `project`) VALUES ('productManager', 5, ''), ('projectManager', 4, ''), diff --git a/db/endemo.sql b/db/endemo.sql index b8f56c1164..40eb8728df 100644 --- a/db/endemo.sql +++ b/db/endemo.sql @@ -663,12 +663,12 @@ REPLACE INTO `zt_user` (`company`, `dept`, `account`, `type`, `password`, `role` (0, 5, 'productManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'po', '产品经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '192.168.0.8', 1338866083, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), (0, 6, 'projectManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'pm', '项目经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 4, '10.0.2.2', 1619580798, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), (0, 2, 'dev1', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发甲', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '10.0.2.2', 1619586993, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 2, 'dev2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587173, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 2, 'dev3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587220, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 3, 'tester1', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试甲', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '192.168.0.8', 1338865739, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 3, 'tester2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '192.168.0.8', 1338865450, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 3, 'tester3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 1, '192.168.0.8', 1338865125, 0, '0000-00-00 00:00:00', '', 0, 0, '0'), -(0, 1, 'testManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qd', '测试经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 6, '192.168.0.8', 1338865842, 0, '0000-00-00 00:00:00', '', 0, 0, '0'); +(0, 2, 'dev2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587173, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 2, 'dev3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'dev', '开发丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '10.0.2.2', 1619587220, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 3, 'tester1', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试甲', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 3, '192.168.0.8', 1338865739, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 3, 'tester2', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试乙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 2, '192.168.0.8', 1338865450, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 3, 'tester3', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qa', '测试丙', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 1, '192.168.0.8', 1338865125, 0, '0000-00-00 00:00:00', '', 0, 0, '1'), +(0, 1, 'testManager', 'inside', 'e10adc3949ba59abbe56e057f20f883e', 'qd', '测试经理', '', '', '', '0000-00-00', 'm', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0000-00-00', 6, '192.168.0.8', 1338865842, 0, '0000-00-00 00:00:00', '', 0, 0, '1'); INSERT INTO `zt_usergroup` (`account`, `group`, `project`) VALUES ('productManager', 5, ''), ('projectManager', 4, ''), diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index f96b21c420..814de73491 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -37,7 +37,7 @@ class gitlab $api = "tree"; $param = new stdclass(); - $param->path = urlencode(ltrim($path, '/')); + $param->path = ltrim($path, '/'); $param->ref = $revision; $param->recursive = 0; @@ -69,7 +69,7 @@ class gitlab if(empty($commits)) continue; $commit = $commits[0]; - $info->name = $file->path; + $info->name = $file->name; $info->kind = 'dir'; $info->revision = $commit->id; $info->account = $commit->committer_name;