From 637706f298e640b12c541a4fea48dbb718ccbf4d Mon Sep 17 00:00:00 2001 From: zhanghuiyin Date: Fri, 21 Jun 2024 21:51:57 +0800 Subject: [PATCH] set registry --- Dockerfile | 2 +- src/pages/teacher/account/create.tsx | 3 +-- src/pages/teacher/device/index.tsx | 8 ++++++-- webpack/webpack.config.pro.js | 10 +++++----- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5d435c..755b78d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app COPY package.json pnpm-lock.yaml ./ -RUN npm install -g pnpm && pnpm install +RUN npm install -g pnpm && pnpm config set registry https://registry.npmmirror.com && pnpm install COPY . . diff --git a/src/pages/teacher/account/create.tsx b/src/pages/teacher/account/create.tsx index 41f7e9c..d71e28d 100644 --- a/src/pages/teacher/account/create.tsx +++ b/src/pages/teacher/account/create.tsx @@ -20,8 +20,7 @@ const CreateAccount = (props) => { } else if ( confirmPassword !== password && confirmPassword?.length > 0 && - password?.length > 0 && - type === 'confirm' + password?.length > 0 ) { return Promise.reject('两次密码不一致'); } diff --git a/src/pages/teacher/device/index.tsx b/src/pages/teacher/device/index.tsx index 38957b1..bd5ed56 100644 --- a/src/pages/teacher/device/index.tsx +++ b/src/pages/teacher/device/index.tsx @@ -38,7 +38,10 @@ const Data: React.FC = () => { for(let item of res.items){ if(!(item.spec.deviceStatus === 'Running' || item.spec.deviceStatus === 'default')){ setIsLoop(true); - intervalTime = setInterval(() => refreshCallBack(), 5000); + intervalTime = setInterval(() =>{ + refreshCallBack(); + refreshCallBackSum(); + } , 5000); break; } } @@ -48,7 +51,8 @@ const Data: React.FC = () => { /* Tips===使用情况 */ const { - data: sumupsData + data: sumupsData, + refresh: refreshCallBackSum, } = useRequest(() => DevicesServices.getDevicesSum()); /* 默认的设备类型 === 在菜单平台设置中进行配置的*/ diff --git a/webpack/webpack.config.pro.js b/webpack/webpack.config.pro.js index 4271cc7..80b0877 100644 --- a/webpack/webpack.config.pro.js +++ b/webpack/webpack.config.pro.js @@ -11,7 +11,7 @@ const BASE = require('./webpack.config.base.js'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // eslint-disable-next-line no-undef,@typescript-eslint/no-var-requires -// const CopyWebpackPlugin = require('copy-webpack-plugin'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = merge(BASE, { mode: 'production', @@ -36,10 +36,10 @@ module.exports = merge(BASE, { // more options: // https://github.com/kangax/html-minifier#options-quick-reference } - }) - // new CopyWebpackPlugin({ - // // patterns: [{ from: resolve(__dirname, '../public/externalLinkConfig.js'), to: resolve(__dirname, '../dist') }] - // }) //打包静态资源 + }), + new CopyWebpackPlugin({ + patterns: [{ from: resolve(__dirname, '../public/studentImg'), to: resolve(__dirname, '../dist/studentImg') }] + }) //打包静态资源 //暂时屏蔽,使用后导致css包导入有误,可能有冲突,后期再解决 // new PurgeCSSPlugin({ // 删除没有用到的css样式 // paths: glob.sync(`${PATHS.src}/**/*`, {nodir: true}),