feat(SharePoster): 使用html-to-image生成海报并优化资源加载
重构海报生成逻辑,使用html-to-image替代canvas手动绘制,提升生成稳定性 添加生成中状态提示,优先使用base64资源避免跨域问题 优化封面和二维码加载逻辑,移除冗余canvas代码
Showing
3 changed files
with
9 additions
and
0 deletions
| ... | @@ -34,6 +34,7 @@ | ... | @@ -34,6 +34,7 @@ |
| 34 | "@vue-office/pptx": "^1.0.1", | 34 | "@vue-office/pptx": "^1.0.1", |
| 35 | "browser-md5-file": "^1.1.1", | 35 | "browser-md5-file": "^1.1.1", |
| 36 | "dayjs": "^1.11.13", | 36 | "dayjs": "^1.11.13", |
| 37 | + "html-to-image": "^1.11.13", | ||
| 37 | "html2canvas": "^1.4.1", | 38 | "html2canvas": "^1.4.1", |
| 38 | "lodash": "^4.17.21", | 39 | "lodash": "^4.17.21", |
| 39 | "pdf-vue3": "^1.0.12", | 40 | "pdf-vue3": "^1.0.12", | ... | ... |
| ... | @@ -47,6 +47,9 @@ importers: | ... | @@ -47,6 +47,9 @@ importers: |
| 47 | dayjs: | 47 | dayjs: |
| 48 | specifier: ^1.11.13 | 48 | specifier: ^1.11.13 |
| 49 | version: 1.11.19 | 49 | version: 1.11.19 |
| 50 | + html-to-image: | ||
| 51 | + specifier: ^1.11.13 | ||
| 52 | + version: 1.11.13 | ||
| 50 | html2canvas: | 53 | html2canvas: |
| 51 | specifier: ^1.4.1 | 54 | specifier: ^1.4.1 |
| 52 | version: 1.4.1 | 55 | version: 1.4.1 |
| ... | @@ -1167,6 +1170,9 @@ packages: | ... | @@ -1167,6 +1170,9 @@ packages: |
| 1167 | resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} | 1170 | resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} |
| 1168 | engines: {node: '>= 0.4'} | 1171 | engines: {node: '>= 0.4'} |
| 1169 | 1172 | ||
| 1173 | + html-to-image@1.11.13: | ||
| 1174 | + resolution: {integrity: sha512-cuOPoI7WApyhBElTTb9oqsawRvZ0rHhaHwghRLlTuffoD1B2aDemlCruLeZrUIIdvG7gs9xeELEPm6PhuASqrg==} | ||
| 1175 | + | ||
| 1170 | html2canvas@1.4.1: | 1176 | html2canvas@1.4.1: |
| 1171 | resolution: {integrity: sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==} | 1177 | resolution: {integrity: sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==} |
| 1172 | engines: {node: '>=8.0.0'} | 1178 | engines: {node: '>=8.0.0'} |
| ... | @@ -3036,6 +3042,8 @@ snapshots: | ... | @@ -3036,6 +3042,8 @@ snapshots: |
| 3036 | dependencies: | 3042 | dependencies: |
| 3037 | function-bind: 1.1.2 | 3043 | function-bind: 1.1.2 |
| 3038 | 3044 | ||
| 3045 | + html-to-image@1.11.13: {} | ||
| 3046 | + | ||
| 3039 | html2canvas@1.4.1: | 3047 | html2canvas@1.4.1: |
| 3040 | dependencies: | 3048 | dependencies: |
| 3041 | css-line-break: 2.1.0 | 3049 | css-line-break: 2.1.0 | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment