Skip to content

Commit

Permalink
fix: migration failure caused by moments api changes (#39)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

将创建瞬间的接口由 `/apis/api.plugin.halo.run/v1alpha1/plugins/PluginMoments/moments` 更改为 `/apis/console.api.moment.halo.run/v1alpha1/moments`。 

由于此问题只会在瞬间 >= 1.5.0 版本中出现,因此将此插件版本依赖升级为 >=2.12.0

解决由于瞬间接口变更而引发的导入错误。

#### How to test it?

安装 >= 1.5.0 版本的瞬间

使用 1.5/1.6 版本的 Halo 备份文件进行数据导入。查看是否能够成功导入瞬间。

#### Which issue(s) this PR fixes:

Fixes #38 

#### Does this PR introduce a user-facing change?
```release-note
解决导入瞬间失败的问题
```
  • Loading branch information
LIlGG committed Apr 25, 2024
1 parent 384ccb1 commit bb9f076
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 48 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "com.github.node-gradle.node" version "5.0.0"
id "io.freefair.lombok" version "8.0.0-rc2"
id "run.halo.plugin.devtools" version "0.0.5"
id "run.halo.plugin.devtools" version "0.0.7"
id 'java'
}

Expand All @@ -14,7 +14,7 @@ repositories {
}

dependencies {
implementation platform('run.halo.tools.platform:plugin:2.5.0-SNAPSHOT')
implementation platform('run.halo.tools.platform:plugin:2.12.0-SNAPSHOT')
compileOnly 'run.halo.app:api'

testImplementation 'run.halo.app:api'
Expand All @@ -36,3 +36,7 @@ task buildFrontend(type: PnpmTask) {
build {
tasks.getByName('compileJava').dependsOn('buildFrontend')
}

halo {
version = '2.12'
}
6 changes: 3 additions & 3 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"@halo-dev/api-client": "^2.7.0",
"@halo-dev/components": "^1.6.0",
"@halo-dev/console-shared": "^2.7.0",
"@halo-dev/api-client": "^2.12.0",
"@halo-dev/components": "^2.12.0",
"@halo-dev/console-shared": "^2.12.0",
"@tanstack/vue-query": "^4.33.1",
"@vueuse/core": "^10.2.1",
"axios": "^1.4.0",
Expand Down
64 changes: 38 additions & 26 deletions console/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion console/src/composables/use-migrate-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class MomentTask implements MigrateRequestTask<MigrateMoment> {

run() {
return axios.post(
`/apis/api.plugin.halo.run/v1alpha1/plugins/PluginMoments/moments`,
`/apis/console.api.moment.halo.run/v1alpha1/moments`,
this.item
);
}
Expand Down
13 changes: 0 additions & 13 deletions src/main/resources/console/main.js

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/console/style.css

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ metadata:
name: PluginMigrate
spec:
enabled: true
version: 1.2.0
requires: ">=2.4.0"
requires: ">=2.12.0"
author:
name: Halo OSS Team
website: https://github.com/halo-dev
Expand Down

0 comments on commit bb9f076

Please sign in to comment.