Quellcode durchsuchen

feat(components): cicd5

Yi vor 5 Monaten
Ursprung
Commit
220db8296d
3 geänderte Dateien mit 6 neuen und 37 gelöschten Zeilen
  1. 5 2
      Dockerfile
  2. 1 2
      mock/api/index.ts
  3. 0 33
      mock/api/management.ts

+ 5 - 2
Dockerfile

@@ -1,10 +1,13 @@
-FROM node:latest as build
+FROM node:18.12-alpine as build
 WORKDIR /app/kpt-system-web
+ENV NODE_OPTIONS="--max-old-space-size=4096"
 COPY . .
+RUN ls -l && pwd
 RUN npm install -g pnpm
+RUN echo "declare module 'lodash-es';" > types.d.ts
+RUN npm install -g typescript@5.1.6
 RUN pnpm install
 RUN pnpm build 
-RUN ls -l && pwd
 
 FROM nginx:alpine as prod
 WORKDIR /app/kpt-system-web

+ 1 - 2
mock/api/index.ts

@@ -1,5 +1,4 @@
 import auth from './auth';
 import route from './route';
-import management from './management';
 
-export default [...auth, ...route, ...management];
+export default [...auth, ...route];

+ 0 - 33
mock/api/management.ts

@@ -1,33 +0,0 @@
-import { mock } from 'mockjs';
-import type { MockMethod } from 'vite-plugin-mock';
-
-const apis: MockMethod[] = [
-  {
-    url: '/mock/getAllUserList',
-    method: 'post',
-    response: (): Service.MockServiceResult<ApiUserManagement.User[]> => {
-      const data = mock({
-        'list|1000': [
-          {
-            id: '@id',
-            userName: '@cname',
-            'age|18-56': 56,
-            'gender|1': ['0', '1', null],
-            phone:
-              /^[1](([3][0-9])|([4][01456789])|([5][012356789])|([6][2567])|([7][0-8])|([8][0-9])|([9][012356789]))[0-9]{8}$/,
-            'email|1': ['@email("qq.com")', null],
-            'userStatus|1': ['1', '2', '3', '4', null]
-          }
-        ]
-      });
-
-      return {
-        code: 200,
-        message: 'ok',
-        data: data.list
-      };
-    }
-  }
-];
-
-export default apis;