wuheng 1 year ago
parent
commit
d730f72fa7
2 changed files with 11 additions and 7 deletions
  1. 3 3
      Jenkinsfile
  2. 8 4
      src/plugins/fast-crud/index.tsx

+ 3 - 3
Jenkinsfile

@@ -7,9 +7,9 @@ pipeline {
         stage('Build') {
             steps {
                 nodejs('20.6.0') {
-										sh 'npm install -g yarn --registry https://registry.npm.taobao.org'
-                    sh 'yarn install --registry https://registry.npm.taobao.org'
-                    sh 'yarn run build:dev'
+										sh 'npm install -g pnpm --registry https://registry.npm.taobao.org'
+                    sh 'pnpm install --registry https://registry.npm.taobao.org'
+                    sh 'pnpm build:dev'
                 }
                 sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
             }

+ 8 - 4
src/plugins/fast-crud/index.tsx

@@ -75,10 +75,14 @@ function install(app: App, options: FsSetupOpts = {}) {
           // 查询参数转换
           transformQuery: (query: PageQuery) => {
             const { page, form, sort } = query;
-            const limit = page.pageSize;
-            const currentPage = page.currentPage ?? 1;
-            const offset = limit * (currentPage - 1);
-
+						let limit = 0;
+						let currentPage = 0;
+						let offset = 0;
+						if ( page &&  page.pageSize) {
+							limit = page.pageSize;
+							currentPage = page.currentPage ?? 1;
+							offset = limit * (currentPage - 1);
+						}
             return {
               page: {
                 limit,