From 70356c08d2d3167fd0250b4a7d63176bed2c7d00 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Mon, 7 Jul 2025 16:17:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BD=E6=A0=87?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E9=80=9A=E9=81=93=E5=8F=91=E9=80=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java index 4159c8ca7..8a6a1313f 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java @@ -243,7 +243,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { if (sendAfterResponse) { // 默认按照收到200回复后发送下一条, 如果超时收不到回复,就以30毫秒的间隔直接发送。 sipSender.transmitRequest(parentPlatform.getDeviceIp(), request, eventResult -> { - if (eventResult.type.equals(SipSubscribe.EventResultType.timeout)) { + if (eventResult.statusCode == -1024) { // 消息发送超时, 以30毫秒的间隔直接发送 int indexNext = index + parentPlatform.getCatalogGroup(); try { From 4765d0efa6adb84fa070a2a47629b479fce4d62f Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Mon, 7 Jul 2025 17:56:06 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BD=E6=A0=87?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E9=80=9A=E9=81=93=E5=8F=91=E9=80=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java index 8a6a1313f..037d9332e 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderForPlatform.java @@ -266,8 +266,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform { }); }else { sipSender.transmitRequest(parentPlatform.getDeviceIp(), request, eventResult -> { - log.error("[目录推送失败] 国标级联 platform : {}, code: {}, msg: {}, 停止发送", parentPlatform.getServerGBId(), eventResult.statusCode, eventResult.msg); - dynamicTask.stop(timeoutTaskKey); + log.error("[目录推送失败] 国标级联 platform : {}, code: {}, msg: {}", parentPlatform.getServerGBId(), eventResult.statusCode, eventResult.msg); }, null); dynamicTask.startDelay(timeoutTaskKey, ()->{ int indexNext = index + parentPlatform.getCatalogGroup(); From 8f2b107eabda8c86332e4e468db265857b81e8d9 Mon Sep 17 00:00:00 2001 From: CDCDDCDC <792192820@qq.com> Date: Tue, 8 Jul 2025 19:46:17 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0github=20action=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..ae47a8318 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,63 @@ +name: release-ubuntu + +on: + push: + tags: + - "v*.*.*" # 触发条件是推送标签 如git tag v2.7.4 git push origin v2.7.4 + +jobs: + build-ubuntu: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64, arm64] + max-parallel: 1 # 最大并行数 这样amd和arm的打包不会互相影响 + steps: + - name: Checkout + uses: actions/checkout@v4 # github action运行环境 + + - name: Create release # 创建文件夹 + run: | + rm -rf release + mkdir release + echo ${{ github.sha }} > Release.txt + cp Release.txt LICENSE release/ + cat Release.txt + + - name: Set up JDK 1.8 + uses: actions/setup-java@v4 + with: + # Eclipse基金会维护的开源Java发行版 因为github action参考java的用这个 所以用这个 + # 还有microsoft(微软维护的openjdk发行版) oracle(商用SDK)等 + distribution: 'temurin' + java-version: '8' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' # Node.js版本 20系列的最新稳定版 + + - name: Compile backend + run: | + mvn package + mvn package -P war + + - name: Compile frontend + run: | + cd ./web + npm install + npm run build:prod + cd ../ + + - name: Package Files + run: | + cp -r ./src/main/resources/static release/ # 复制前端文件 + cp ./target/*.jar release/ # 复制 JAR 文件 + cp ./src/main/resources/application-dev.yml release + zip -r release-ubuntu-${{ matrix.arch }}.zip release + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: release-ubuntu-${{ matrix.arch }}.zip \ No newline at end of file From 67ef8ed8f074490047175b6bb053e2cac6b55585 Mon Sep 17 00:00:00 2001 From: CDCDDCDC <792192820@qq.com> Date: Wed, 9 Jul 2025 12:46:31 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9github=20action=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=8E=8B=E7=BC=A9=E5=8C=85=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae47a8318..b20761e90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - arch: [amd64, arm64] - max-parallel: 1 # 最大并行数 这样amd和arm的打包不会互相影响 + arch: [amd64] + max-parallel: 1 # 最大并行数 steps: - name: Checkout uses: actions/checkout@v4 # github action运行环境 @@ -54,10 +54,23 @@ jobs: cp -r ./src/main/resources/static release/ # 复制前端文件 cp ./target/*.jar release/ # 复制 JAR 文件 cp ./src/main/resources/application-dev.yml release - zip -r release-ubuntu-${{ matrix.arch }}.zip release + + BRANCH=${{ github.event.base_ref }} + BRANCH_NAME=$(echo "$BRANCH" | grep -oP 'refs/heads/\K.*') + echo "BRANCH_NAME= ${BRANCH_NAME}" + # 如果无法获取,使用默认分支 + if [[ -z "BRANCH_NAME" ]]; then + BRANCH_NAME="${{ github.event.repository.default_branch }}" + fi + + TAG_NAME="${GITHUB_REF#refs/tags/}" + DATE=$(date +%Y%m%d) + ZIP_FILE_NAME="${BRANCH_NAME}-${TAG_NAME}-${DATE}.zip" + zip -r "$ZIP_FILE_NAME" release + echo "ZIP_FILE_NAME=$ZIP_FILE_NAME" >> $GITHUB_ENV - name: Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - files: release-ubuntu-${{ matrix.arch }}.zip \ No newline at end of file + files: ${{ env.ZIP_FILE_NAME }} \ No newline at end of file From 9c2c727c8c3ac556c7360e5a0436b6e506a3c0a0 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Wed, 9 Jul 2025 20:17:38 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=97=B6=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b20761e90..2fb34d36a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: run: | cp -r ./src/main/resources/static release/ # 复制前端文件 cp ./target/*.jar release/ # 复制 JAR 文件 - cp ./src/main/resources/application-dev.yml release + cp ./src/main/resources/application-dev.yml release/application.yml BRANCH=${{ github.event.base_ref }} BRANCH_NAME=$(echo "$BRANCH" | grep -oP 'refs/heads/\K.*') From 16fd1db833314c346d5e098def47f1adcd42082e Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 9 Jul 2025 22:43:36 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=93=E5=8C=85?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fb34d36a..ab696e4f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: TAG_NAME="${GITHUB_REF#refs/tags/}" DATE=$(date +%Y%m%d) - ZIP_FILE_NAME="${BRANCH_NAME}-${TAG_NAME}-${DATE}.zip" + ZIP_FILE_NAME="${BRANCH_NAME}-${TAG_NAME}.zip" zip -r "$ZIP_FILE_NAME" release echo "ZIP_FILE_NAME=$ZIP_FILE_NAME" >> $GITHUB_ENV From 569b361a4343bbbeb85c53e33566750aeb93ca3a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 9 Jul 2025 22:51:24 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=93=E5=8C=85?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab696e4f0..5e41eeb5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,6 @@ jobs: fi TAG_NAME="${GITHUB_REF#refs/tags/}" - DATE=$(date +%Y%m%d) ZIP_FILE_NAME="${BRANCH_NAME}-${TAG_NAME}.zip" zip -r "$ZIP_FILE_NAME" release echo "ZIP_FILE_NAME=$ZIP_FILE_NAME" >> $GITHUB_ENV From 305c8ec8d7b1df0a62da248aebb17738ceb82900 Mon Sep 17 00:00:00 2001 From: meqbyte Date: Fri, 25 Jul 2025 15:59:59 +0800 Subject: [PATCH 8/8] =?UTF-8?q?jwt=E5=89=A9=E4=BD=99=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/genersoft/iot/vmp/conf/security/JwtUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/JwtUtils.java b/src/main/java/com/genersoft/iot/vmp/conf/security/JwtUtils.java index 37a3307e5..3fa12e869 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/JwtUtils.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/security/JwtUtils.java @@ -231,7 +231,7 @@ public class JwtUtils implements InitializingBean { if (expirationTime != null) { // 判断是否即将过期, 默认剩余时间小于5分钟未即将过期 // 剩余时间 (秒) - long timeRemaining = LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)) - expirationTime.getValue(); + long timeRemaining = expirationTime.getValue() - LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)); if (timeRemaining < 5 * 60) { jwtUser.setStatus(JwtUser.TokenStatus.EXPIRING_SOON); } else {