mirror of
https://github.com/Molunerfinn/PicGo.git
synced 2026-09-20 03:16:37 +00:00
Compare commits
7
Commits
v2.4.1
...
v2.4.2-beta.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b881161bcd | ||
|
|
a1d22e5742 | ||
|
|
f7f580412f | ||
|
|
25f86a69e1 | ||
|
|
840c33bfa5 | ||
|
|
ee6ca02da7 | ||
|
|
9269f969b8 |
@@ -11,6 +11,21 @@ on:
|
||||
required: true
|
||||
default: false
|
||||
type: boolean
|
||||
build_os:
|
||||
description: "Build for specific OS: Windows, macOS, Linux, All"
|
||||
required: true
|
||||
default: "All"
|
||||
type: choice
|
||||
options:
|
||||
- Windows
|
||||
- macOS
|
||||
- Linux
|
||||
- All
|
||||
skip_notarize:
|
||||
description: "Skip Notarization (true/false)"
|
||||
required: true
|
||||
default: false
|
||||
type: boolean
|
||||
env:
|
||||
NODE_VERSION: 22.x
|
||||
|
||||
@@ -38,7 +53,7 @@ jobs:
|
||||
cache: pnpm
|
||||
cache-dependency-path: pnpm-lock.yaml
|
||||
- name: Clean workspace on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: runner.os == 'Windows' && (github.event.inputs.build_os == 'Windows' || github.event.inputs.build_os == 'All' || startsWith(github.ref, 'refs/tags/v'))
|
||||
run: |
|
||||
if (Test-Path dist) { Remove-Item -Recurse -Force dist }
|
||||
if (Test-Path dist_electron) { Remove-Item -Recurse -Force dist_electron }
|
||||
@@ -51,27 +66,39 @@ jobs:
|
||||
Remove-Item "$env:LOCALAPPDATA\electron" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
- name: Clean workspace on macOS & Linux
|
||||
if: runner.os == 'macOS' || runner.os == 'Linux'
|
||||
if: runner.os == 'macOS' || runner.os == 'Linux' && (github.event.inputs.build_os == 'macOS' || github.event.inputs.build_os == 'Linux' || github.event.inputs.build_os == 'All' || startsWith(github.ref, 'refs/tags/v'))
|
||||
run: |
|
||||
rm -rf dist dist_electron node_modules ~/.cache/electron-builder ~/.cache/electron
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Ubuntu Update with sudo
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update
|
||||
if: runner.os == 'Linux' && (github.event.inputs.build_os == 'Linux' || github.event.inputs.build_os == 'All' || startsWith(github.ref, 'refs/tags/v'))
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libfuse2
|
||||
- name: Build Windows x64 & ARM64 App
|
||||
if: runner.os == 'Windows'
|
||||
if: runner.os == 'Windows' && (github.event.inputs.build_os == 'Windows' || github.event.inputs.build_os == 'All' || startsWith(github.ref, 'refs/tags/v'))
|
||||
run: pnpm run build:win || true
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
- name: Build macOS x64 & ARM64 App
|
||||
if: runner.os == 'macOS'
|
||||
if: runner.os == 'macOS' && (github.event.inputs.build_os == 'macOS' || github.event.inputs.build_os == 'All' || startsWith(github.ref, 'refs/tags/v'))
|
||||
run: pnpm run build:mac || true
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
# macOS Code Signing
|
||||
# p12 证书的 Base64 字符串
|
||||
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
|
||||
# p12 证书密码
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
|
||||
# macOS Notarization (公证所需变量)
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
SKIP_NOTARIZE: ${{ inputs.skip_notarize }}
|
||||
- name: Build Linux x64 & ARM64 App
|
||||
if: runner.os == 'Linux'
|
||||
if: runner.os == 'Linux' && (github.event.inputs.build_os == 'Linux' || github.event.inputs.build_os == 'All' || startsWith(github.ref, 'refs/tags/v'))
|
||||
run: pnpm run build:linux || true
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
@@ -4,6 +4,7 @@ dist/web/*
|
||||
build/*
|
||||
!build/icons
|
||||
!build/installer.nsh
|
||||
!build/entitlements.mac.plist
|
||||
coverage
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
|
||||
@@ -25,4 +25,7 @@ Place renderer unit specs in `test/unit/specs` with the `.spec.js` suffix; Karma
|
||||
Commits follow the PicGo conventional preset enforced by Husky (`pnpm lint:dpdm` + Commitlint). Stage your changes and run `pnpm cz` to craft messages that pass CI. Pull requests should explain the change, link related issues, and attach UI screenshots or recordings. Note how you validated the work (dev server, build, Karma, Spectron) and call out migration or configuration steps reviewers must perform.
|
||||
|
||||
## Internationalization Tips
|
||||
Add locales by creating `public/i18n/<locale>.yml`, exposing its `LANG_DISPLAY_LABEL`, and registering it in `src/universal/i18n/index.ts`. Finish with `pnpm gen-i18n` so the generated typings stay in sync.
|
||||
Add locales by creating `public/i18n/<locale>.yml`, exposing its `LANG_DISPLAY_LABEL`, and registering it in `src/universal/i18n/index.ts`. After editing `public/i18n/*.yml`, run `pnpm gen-i18n` to regenerate TS typings and keep them in sync.
|
||||
|
||||
## Serena MCP & Context7 Tools
|
||||
When starting work or if you hit issues, try checking MCP for Serena or Context7 tooling. If available, use those tools to navigate, edit, or fetch docs efficiently.
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
## :tada: 2.4.2-beta.0 (2025-12-31)
|
||||
|
||||
|
||||
### :sparkles: Features
|
||||
|
||||
* **config:** add copy config \&\& add double confirm before copy \& delete config ([25f86a6](https://github.com/Molunerfinn/PicGo/commit/25f86a6))
|
||||
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
* **icon:** app icon too large in macOS 15.x ([840c33b](https://github.com/Molunerfinn/PicGo/commit/840c33b)), closes [#1367](https://github.com/Molunerfinn/PicGo/issues/1367)
|
||||
|
||||
|
||||
### :package: Chore
|
||||
|
||||
* electron builder not publish with build command ([9269f96](https://github.com/Molunerfinn/PicGo/commit/9269f96))
|
||||
* fix workflow build ([a1d22e5](https://github.com/Molunerfinn/PicGo/commit/a1d22e5))
|
||||
* **signature:** add signature \& notarization process ([ee6ca02](https://github.com/Molunerfinn/PicGo/commit/ee6ca02))
|
||||
* update FAQ \&\& plugin filter logic ([f7f5804](https://github.com/Molunerfinn/PicGo/commit/f7f5804))
|
||||
|
||||
|
||||
|
||||
## :tada: 2.4.1 (2025-12-23)
|
||||
|
||||
|
||||
|
||||
@@ -1,28 +1,55 @@
|
||||
## 常见问题
|
||||
## Frequently Asked Questions / 常见问题
|
||||
|
||||
> While using PicGo you may run into various issues. Many of them have already been asked and resolved, so please check the [documentation](https://picgo.github.io/PicGo-Doc/guide/getting-started.html#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B), this FAQ, and closed [issues](https://github.com/Molunerfinn/PicGo/issues?q=is%3Aissue+is%3Aclosed) first — you will likely find the answer there.
|
||||
>
|
||||
> 在使用 PicGo 期间你会遇到很多问题,不过很多问题其实之前就有人提问过,也被解决,所以你可以先看看 [使用文档](https://picgo.github.io/PicGo-Doc/guide/getting-started.html#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B),这份 FAQ,以及那些被关闭的 [issues](https://github.com/Molunerfinn/PicGo/issues?q=is%3Aissue+is%3Aclosed),应该能找到答案。
|
||||
|
||||
## 1. 七牛图床上传图片成功后,相册里无法显示或图片无`http://`前缀
|
||||
## 1. Qiniu image host: upload succeeds but images don’t show in Album, or the URL has no `http://` prefix / 七牛图床上传图片成功后,相册里无法显示或图片无`http://`前缀
|
||||
|
||||
This is usually because the `Set URL` (access URL) in your Qiniu image host configuration does not include the `http://` or `https://` scheme.
|
||||
|
||||
Reference: [issue#79](https://github.com/Molunerfinn/PicGo/issues/79)
|
||||
|
||||
通常是你的七牛图床配置里的`设定访问网址`没有加上`http://`或者`https//`头。
|
||||
|
||||
参考:[issue#79](https://github.com/Molunerfinn/PicGo/issues/79)
|
||||
|
||||
## 2. 能否支持图床远端同步删除
|
||||
## 2. Can PicGo delete images on the remote image host after upload? / 能否支持图床远端同步删除
|
||||
|
||||
Not at the moment. Some image hosts (e.g. Weibo image host, SM.MS, Imgur, etc.) don’t provide a backend management API, so PicGo does not support remote deletion for the sake of a consistent architecture.
|
||||
|
||||
暂时不支持。有些图床(比如微博图床、SM.MS、Imgur 等)不支持后台管理,为了架构统一不支持远端删除。
|
||||
|
||||
## 3. 能否支持上传视频文件
|
||||
## 3. Can PicGo upload video files? / 能否支持上传视频文件
|
||||
|
||||
Some image hosts support uploading video files, but not all. Please follow the capabilities of the image host (and/or the plugin) you are actually using.
|
||||
|
||||
目前部分图床支持上传视频文件,但并非所有图床都支持,请以实际使用的图床以及插件为准。
|
||||
|
||||
## 4. 微博图床上传之后无法显示预览图
|
||||
## 4. Weibo image host: uploaded images don’t preview / 微博图床上传之后无法显示预览图
|
||||
|
||||
This is usually caused by having a global proxy enabled.
|
||||
|
||||
Reference: [issue36](https://github.com/Molunerfinn/PicGo/issues/36)
|
||||
|
||||
通常是挂了全局代理导致的。
|
||||
|
||||
参考:[issue36](https://github.com/Molunerfinn/PicGo/issues/36)
|
||||
|
||||
## 5. 能否支持某某某图床
|
||||
## 5. Can you add support for an image host? / 能否支持某某某图床
|
||||
|
||||
As of v1.6, PicGo supports the following built-in image hosts:
|
||||
|
||||
- `Weibo image host` v1.0
|
||||
- `Qiniu image host` v1.0
|
||||
- `Tencent Cloud COS v4/v5` v1.1 & v1.5.0
|
||||
- `Upyun` v1.2.0
|
||||
- `GitHub` v1.5.0
|
||||
- `SM.MS` v1.5.1
|
||||
- `Alibaba Cloud OSS` v1.6.0
|
||||
- `Imgur` v1.6.0
|
||||
|
||||
PicGo itself will not add support for additional third-party image hosts as built-in features. If you need other image hosts, please refer to existing third-party [plugins](https://github.com/PicGo/Awesome-PicGo). If the one you need doesn’t exist yet, you’re welcome to develop a plugin and share it with the community.
|
||||
|
||||
截止 v1.6,PicGo 支持了如下图床:
|
||||
|
||||
@@ -35,18 +62,29 @@
|
||||
- `阿里云 OSS` v1.6.0
|
||||
- `Imgur` v1.6.0
|
||||
|
||||
所以本体内将不会再支持其他图床。需要其他图床支持可以参考目前已有的三方 [插件](https://github.com/PicGo/Awesome-PicGo),如果还是没有你所需要的图床欢迎开发一个插件供大家使用。
|
||||
所以本体内将不会再支持其他第三方图床。需要其他图床支持可以参考目前已有的三方 [插件](https://github.com/PicGo/Awesome-PicGo),如果还是没有你所需要的图床欢迎开发一个插件供大家使用。
|
||||
|
||||
## 6. 一个图床设置多个信息
|
||||
## 6. GitHub image host uploads sometimes succeed and sometimes fail / GitHub 图床有时能上传,有时上传失败
|
||||
|
||||
不能。因为目前的架构只支持一个图床一份信息。
|
||||
|
||||
## 7. GitHub 图床有时能上传,有时上传失败
|
||||
1. The GitHub image host does not allow uploading files with the same name. If you upload a duplicate filename, you will get an error. Enable `Timestamp Rename` to avoid name collisions.
|
||||
2. Due to GitHub network conditions (and the Great Firewall in mainland China), uploads may sometimes succeed and sometimes fail — there is no universal fix. For stability, consider using a paid cloud storage service such as Alibaba Cloud or Tencent Cloud; they are usually inexpensive.
|
||||
|
||||
1. GitHub 图床不支持上传同名文件,如果有同名文件上传,会报错。建议开启 `时间戳重命名` 避免同名文件。
|
||||
2. GitHub 服务器和国内 GFW 的问题会导致有时上传成功,有时上传失败,无解。想要稳定请使用付费云存储,如阿里云、腾讯云等,价格也不会贵。
|
||||
|
||||
## 8. Mac 上无法打开 PicGo 的主窗口界面
|
||||
## 7. Can’t open PicGo’s main window on macOS / Mac 上无法打开 PicGo 的主窗口界面
|
||||
|
||||
On macOS, PicGo is a menu bar app, so it won’t show an icon in the Dock by default. To open the main window, right-click (or two-finger click) the PicGo menu bar icon and choose “Open Main Window”.
|
||||
|
||||
Starting from v2.4.1, PicGo lets you hide the Dock icon (`showDockIcon`) and the menu bar icon (`showMenubarIcon`) separately. If you turn both off (set both to `false`), you won’t be able to find the UI via either the Dock or the menu bar.
|
||||
|
||||
How to recover manually:
|
||||
|
||||
1. Locate and edit PicGo’s config file `data.json`.
|
||||
- If you can still open the settings page: PicGo Settings -> “Open Config File”.
|
||||
- If you can’t find the UI: the default location is usually `~/Library/Application Support/PicGo/data.json` (if you configured a custom path, follow `configPath`).
|
||||
2. Set either field below to `true` (it’s recommended to keep at least one of them `true`). Do not modify other fields.
|
||||
3. Save and restart PicGo.
|
||||
|
||||
PicGo 在 Mac 上是一个顶部栏应用,在 dock 栏是不会有图标的。要打开主窗口,请右键或者双指点按顶部栏 PicGo 图标,选择「打开详细窗口」即可打开主窗口。
|
||||
|
||||
@@ -71,29 +109,94 @@ PicGo 在 Mac 上是一个顶部栏应用,在 dock 栏是不会有图标的。
|
||||
|
||||
3. 保存后重启 PicGo。
|
||||
|
||||
## 9. 上传失败,或者是服务器出错
|
||||
## 8. Upload failed, or server returned an error / 上传失败,或者是服务器出错
|
||||
|
||||
1. PicGo 自带的图床都经过测试,上传出错一般都不是 PicGo 自身的原因。如果你用的是 GitHub 图床请参考上面的第 7 点。
|
||||
1. PicGo’s built-in image hosts are tested; upload errors are usually not caused by PicGo itself. If you are using the GitHub image host, see FAQ #6.
|
||||
2. Check PicGo logs (PicGo Settings -> Log File -> Open) and look for key information in `[PicGo Error]`.
|
||||
1. Search the error message first — you can often find the root cause via search engines without opening an issue.
|
||||
2. If you see `401`, `403`, or other `40X` status codes, it almost certainly means your configuration is wrong. Double-check for typos, trailing spaces, etc.
|
||||
3. If you see `HttpError`, `RequestError`, `socket hang up`, etc., that indicates a network issue. Please check your network, proxy, and DNS settings.
|
||||
3. Upload failures caused by network issues are often due to incorrect proxy settings. If you enabled a system proxy, it’s recommended to also configure the corresponding HTTP proxy in PicGo. See [#912](https://github.com/Molunerfinn/PicGo/issues/912)
|
||||
|
||||
1. PicGo 自带的图床都经过测试,上传出错一般都不是 PicGo 自身的原因。如果你用的是 GitHub 图床请参考上面的第 6 点。
|
||||
2. 检查 PicGo 的日志(报错日志可以在 PicGo 设置 -> 设置日志文件 -> 点击打开 后找到),看看 `[PicGo Error]` 的报错信息里有什么关键信息
|
||||
1. 先自行搜索 error 里的报错信息,往往你能百度或者谷歌出问题原因,不必开 issue。
|
||||
2. 如果有带有 `401` 、`403` 等 `40X` 状态码字样的,不用怀疑,就是你配置写错了,仔细检查配置,看看是否多了空格之类的。
|
||||
3. 如果带有 `HttpError`、`RequestError` 、 `socket hang up` 等字样的说明这是网络问题,我无法帮你解决网络问题,请检查你自己的网络,是否有代理,DNS 设置是否正常等。
|
||||
3. 通常网络问题引起的上传失败都是因为代理设置不当导致的。如果开启了系统代理,建议同时也在 PicGo 的代理设置中设置对应的HTTP代理。参考 [#912](https://github.com/Molunerfinn/PicGo/issues/912)
|
||||
|
||||
## 10. macOS版本安装完之后没有主界面
|
||||
## 9. Installed on macOS but there is no main UI window / macOS版本安装完之后没有主界面
|
||||
|
||||
Find the PicGo icon in the macOS menu bar, then right-click (two-finger click on trackpad) to open the menu and choose “Open Main Window”.
|
||||
|
||||
请找到PicGo在顶部栏的图标,然后右键(触摸板双指点按,或者鼠标右键),即可找到「打开详细窗口」的菜单。
|
||||
|
||||
## 11. 相册突然无法显示图片 或者 上传后相册不更新 或者 使用Typora+PicGo上传图片成功但是没有写回Typora
|
||||
## 10. Album suddenly can’t show images, or doesn’t refresh after upload, or Typora + PicGo upload succeeds but doesn’t write back / 相册突然无法显示图片 或者 上传后相册不更新 或者 使用Typora+PicGo上传图片成功但是没有写回Typora
|
||||
|
||||
This may be caused by a corrupted album database. Locate `picgo.db` under your PicGo config directory, delete it (backup first if needed), then restart PicGo.
|
||||
|
||||
Also check the log file for errors and open an issue if necessary. Versions >= 2.3.0 have addressed issues caused by a corrupted `picgo.db`, so upgrading is recommended.
|
||||
|
||||
这个原因可能是相册存储文件损坏导致的。可以找到 PicGo 配置文件所在路径下的 `picgo.db` ,将其删掉(删掉前建议备份一遍),再重启 PicGo 试试。
|
||||
注意同时看看日志文件里有没有什么error,必要时可以提issue。2.3.0以上的版本已经解决因为 `picgo.db` 损坏导致的上述问题,建议更新版本。
|
||||
|
||||
## 12. Gitee相关问题
|
||||
## 11. Gitee-related issues / Gitee相关问题
|
||||
|
||||
If you run into upload issues with the Gitee image host, PicGo cannot help because PicGo does not provide an official Gitee uploader. Please open an issue in the repository of the Gitee plugin you are using.
|
||||
|
||||
如果在使用 Gitee 图床的时候遇到上传的问题,由于 PicGo 并没有官方提供 Gitee 上传服务,无法帮你解决,请去你所使用的 Gitee 插件仓库发相关的issue。
|
||||
|
||||
## 13. macOS系统安装完PicGo显示「文件已损坏」或者安装完打开没有反应
|
||||
## 12. On macOS, PicGo shows “App is damaged”, or it doesn’t respond after installation / macOS系统安装完PicGo显示「文件已损坏」或者安装完打开没有反应
|
||||
|
||||
Because PicGo is not signed, it may be blocked by macOS Gatekeeper.
|
||||
|
||||
1. If you see “App is damaged” when opening after installation, do the following:
|
||||
|
||||
Trust the developer (password required):
|
||||
|
||||
```
|
||||
sudo spctl --master-disable
|
||||
```
|
||||
|
||||
Then remove quarantine attributes from PicGo:
|
||||
|
||||
```
|
||||
xattr -cr /Applications/PicGo.app
|
||||
```
|
||||
|
||||
If you see the following message:
|
||||
|
||||
```sh
|
||||
option -r not recognized
|
||||
|
||||
usage: xattr [-slz] file [file ...]
|
||||
xattr -p [-slz] attr_name file [file ...]
|
||||
xattr -w [-sz] attr_name attr_value file [file ...]
|
||||
xattr -d [-s] attr_name file [file ...]
|
||||
xattr -c [-s] file [file ...]
|
||||
|
||||
The first form lists the names of all xattrs on the given file(s).
|
||||
The second form (-p) prints the value of the xattr attr_name.
|
||||
The third form (-w) sets the value of the xattr attr_name to attr_value.
|
||||
The fourth form (-d) deletes the xattr attr_name.
|
||||
The fifth form (-c) deletes (clears) all xattrs.
|
||||
|
||||
options:
|
||||
-h: print this help
|
||||
-s: act on symbolic links themselves rather than their targets
|
||||
-l: print long format (attr_name: attr_value)
|
||||
-z: compress or decompress (if compressed) attribute value in zip format
|
||||
```
|
||||
|
||||
Run:
|
||||
|
||||
```
|
||||
sudo xattr -d com.apple.quarantine /Applications/PicGo.app/
|
||||
```
|
||||
|
||||
2. If PicGo doesn’t respond after installation, troubleshoot in this order:
|
||||
1. PicGo won’t automatically pop up a main window on macOS — it’s designed as a menu bar app. If you can see the PicGo icon in the menu bar, the installation succeeded; click it to open the menu bar window. See FAQ #7.
|
||||
2. If you’re on an Apple Silicon (M1) Mac and previously had the x64 build installed, then switched to the arm64 build and it doesn’t respond, reboot your Mac.
|
||||
|
||||
因为 PicGo 没有签名,所以会被 macOS 的安全检查所拦下。
|
||||
|
||||
@@ -143,5 +246,15 @@ sudo xattr -d com.apple.quarantine /Applications/PicGo.app/
|
||||
```
|
||||
|
||||
2. 如果安装打开后没有反应,请按下方顺序排查:
|
||||
1. macOS安装好之后,PicGo 是不会弹出主窗口的,因为 PicGo 在 macOS 系统里设计是个顶部栏应用。注意看你顶部栏的图标,如果有 PicGo 的图标,说明安装成功了,点击图标即可打开顶部栏窗口。参考上述[第八点](#8-mac-上无法打开-picgo-的主窗口界面)。
|
||||
1. macOS安装好之后,PicGo 是不会弹出主窗口的,因为 PicGo 在 macOS 系统里设计是个顶部栏应用。注意看你顶部栏的图标,如果有 PicGo 的图标,说明安装成功了,点击图标即可打开顶部栏窗口。参考上述第七点。
|
||||
2. 如果你是 M1 的系统,此前装过 PicGo 的 x64 版本,但是后来更新了 arm64 的版本发现打开后没反应,请重启电脑即可。
|
||||
|
||||
## 13. Are third-party plugins claiming to be “PicGo Official image host” trustworthy? / 所谓「PicGo 官方图床」的第三方插件是否可信
|
||||
|
||||
No. Any third-party plugin that claims to be a “PicGo Official image host” (including, but not limited to, www.picgo.net) is not an official PicGo image host or service. Please do not trust such claims.
|
||||
|
||||
An official PicGo image host (if any) would be built into PicGo out of the box — it would not require you to download and install a “third-party plugin”, and it would not direct you to an unknown website to purchase or configure a so-called “official image host”. If you choose to use third-party image hosts, please prefer community plugins from reputable sources and assess their safety yourself.
|
||||
|
||||
不可信。所有打着「PicGo 官方图床」旗号的第三方插件(包括不限于 www.picgo.net 等)都不是 PicGo 官方提供的图床或服务,请勿轻信。
|
||||
|
||||
PicGo 不会以“第三方插件”的形式要求你另外下载安装所谓的 PicGo 官方图床。如果 PicGo 真的做了官方图床,一定是开箱即用的内置在本体里的。如果你需要使用第三方图床,请优先参考 PicGo 官方维护的插件集合与社区仓库,并自行甄别来源与安全性。
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!-- 允许 JIT (Electron 必须) -->
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
|
||||
<!-- 允许加载未签名的动态库 (插件、原生模块必须) -->
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
|
||||
<!-- 允许执行内存中可写的页 (部分 Electron 版本需要) -->
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -1,9 +1,14 @@
|
||||
|
||||
import type { Configuration } from 'electron-builder'
|
||||
import dotenv from 'dotenv'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
const shouldNotarize = process.env.SKIP_NOTARIZE !== 'true';
|
||||
|
||||
const config: Configuration = {
|
||||
appId: 'com.molunerfinn.picgo',
|
||||
productName: 'PicGo',
|
||||
afterSign: shouldNotarize ? 'scripts/notarize.js' : undefined,
|
||||
// publish: [
|
||||
// {
|
||||
// provider: 'github',
|
||||
@@ -43,17 +48,21 @@ const config: Configuration = {
|
||||
]
|
||||
},
|
||||
mac: {
|
||||
icon: 'build/icons/512x512.png',
|
||||
icon: 'build/icons/icon.icns',
|
||||
extendInfo: {
|
||||
LSUIElement: 0
|
||||
},
|
||||
target: [
|
||||
{
|
||||
target: 'dmg',
|
||||
arch: ['x64', 'arm64']
|
||||
arch: ['arm64', 'x64']
|
||||
}
|
||||
],
|
||||
artifactName: 'PicGo-${version}-${arch}.${ext}'
|
||||
artifactName: 'PicGo-${version}-${arch}.${ext}',
|
||||
hardenedRuntime: true,
|
||||
entitlements: 'build/entitlements.mac.plist',
|
||||
entitlementsInherit: 'build/entitlements.mac.plist',
|
||||
notarize: false
|
||||
},
|
||||
win: {
|
||||
icon: 'build/icons/icon.ico',
|
||||
@@ -95,12 +104,15 @@ const config: Configuration = {
|
||||
},
|
||||
{
|
||||
target: 'snap',
|
||||
arch: ['x64']
|
||||
arch: ['x64'],
|
||||
}
|
||||
],
|
||||
maintainer: 'Molunerfinn',
|
||||
category: 'Utility',
|
||||
publish: []
|
||||
},
|
||||
snap: {
|
||||
publish: []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -1,3 +1,4 @@
|
||||
const globals = require('globals')
|
||||
const path = require('node:path')
|
||||
const eslintJs = require('@eslint/js')
|
||||
const tsPlugin = require('@typescript-eslint/eslint-plugin')
|
||||
@@ -122,5 +123,16 @@ module.exports = [
|
||||
'@typescript-eslint/no-empty-object-type': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// 1. 针对所有 JS 文件(或者特定目录)启用 Node 全局变量
|
||||
files: ["**/*.js", "scripts/*.js"],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node, // 注入 process, require, module, __dirname 等
|
||||
...globals.browser // 如果你的项目是前端项目,可能还需要 browser
|
||||
},
|
||||
sourceType: "commonjs" // 如果你的项目代码主要是 CJS,加上这个;如果是 ESM 则设为 "module"
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
+8
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "picgo",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.2-beta.0",
|
||||
"private": true,
|
||||
"main": "dist_electron/main/index.js",
|
||||
"description": "A powerful & simple image uploader for creators.",
|
||||
@@ -9,10 +9,11 @@
|
||||
"email": "marksz@teamsz.xyz"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "electron-vite build && electron-builder --config electron-builder.config.ts",
|
||||
"build:win": "npm run build && electron-builder --config electron-builder.config.ts --win",
|
||||
"build:mac": "npm run build && electron-builder --config electron-builder.config.ts --mac",
|
||||
"build:linux": "npm run build && electron-builder --config electron-builder.config.ts --linux",
|
||||
"build": "electron-vite build && electron-builder --config electron-builder.config.ts --publish never",
|
||||
"build:win": "npm run build && electron-builder --config electron-builder.config.ts --win --publish never",
|
||||
"build:mac": "npm run build && electron-builder --config electron-builder.config.ts --mac --publish never",
|
||||
"build:linux": "npm run build && electron-builder --config electron-builder.config.ts --linux --publish never",
|
||||
"build:local": "dotenv -e .env -- electron-vite build && electron-builder --config electron-builder.config.ts --publish never",
|
||||
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.vue src/",
|
||||
"tsc": "tsc --noEmit",
|
||||
"bump": "bump-version",
|
||||
@@ -88,6 +89,7 @@
|
||||
"conventional-changelog": "^3.1.18",
|
||||
"cz-customizable": "^7.5.1",
|
||||
"dotenv": "^16.0.1",
|
||||
"dotenv-cli": "^11.0.0",
|
||||
"dpdm": "^3.13.1",
|
||||
"electron": "^38",
|
||||
"electron-builder": "26.1.0",
|
||||
@@ -97,6 +99,7 @@
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-promise": "^7.2.1",
|
||||
"eslint-plugin-vue": "^10.6.2",
|
||||
"globals": "^16.5.0",
|
||||
"husky": "^3.1.0",
|
||||
"postcss": "^8.4.23",
|
||||
"stylus": "^0.54.7",
|
||||
|
||||
Generated
+37
@@ -186,6 +186,9 @@ importers:
|
||||
dotenv:
|
||||
specifier: ^16.0.1
|
||||
version: 16.6.1
|
||||
dotenv-cli:
|
||||
specifier: ^11.0.0
|
||||
version: 11.0.0
|
||||
dpdm:
|
||||
specifier: ^3.13.1
|
||||
version: 3.14.0
|
||||
@@ -213,6 +216,9 @@ importers:
|
||||
eslint-plugin-vue:
|
||||
specifier: ^10.6.2
|
||||
version: 10.6.2(@typescript-eslint/parser@8.49.0(eslint@9.39.1(jiti@1.21.7))(typescript@5.9.3))(eslint@9.39.1(jiti@1.21.7))(vue-eslint-parser@10.2.0(eslint@9.39.1(jiti@1.21.7)))
|
||||
globals:
|
||||
specifier: ^16.5.0
|
||||
version: 16.5.0
|
||||
husky:
|
||||
specifier: ^3.1.0
|
||||
version: 3.1.0
|
||||
@@ -2607,14 +2613,26 @@ packages:
|
||||
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
dotenv-cli@11.0.0:
|
||||
resolution: {integrity: sha512-r5pA8idbk7GFWuHEU7trSTflWcdBpQEK+Aw17UrSHjS6CReuhrrPcyC3zcQBPQvhArRHnBo/h6eLH1fkCvNlww==}
|
||||
hasBin: true
|
||||
|
||||
dotenv-expand@11.0.7:
|
||||
resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
dotenv-expand@12.0.3:
|
||||
resolution: {integrity: sha512-uc47g4b+4k/M/SeaW1y4OApx+mtLWl92l5LMPP0GNXctZqELk+YGgOPIIC5elYmUH4OuoK3JLhuRUYegeySiFA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
dotenv@16.6.1:
|
||||
resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
dotenv@17.2.3:
|
||||
resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
download-git-repo@3.0.2:
|
||||
resolution: {integrity: sha512-N8hWXD4hXqmEcNoR8TBYFntaOcYvEQ7Bz90mgm3bZRTuteGQqwT32VDMnTyD0KTEvb8BWrMc1tVmzuV9u/WrAg==}
|
||||
|
||||
@@ -3274,6 +3292,10 @@ packages:
|
||||
resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
globals@16.5.0:
|
||||
resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
globalthis@1.0.4:
|
||||
resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8769,12 +8791,25 @@ snapshots:
|
||||
dependencies:
|
||||
is-obj: 2.0.0
|
||||
|
||||
dotenv-cli@11.0.0:
|
||||
dependencies:
|
||||
cross-spawn: 7.0.6
|
||||
dotenv: 17.2.3
|
||||
dotenv-expand: 12.0.3
|
||||
minimist: 1.2.8
|
||||
|
||||
dotenv-expand@11.0.7:
|
||||
dependencies:
|
||||
dotenv: 16.6.1
|
||||
|
||||
dotenv-expand@12.0.3:
|
||||
dependencies:
|
||||
dotenv: 16.6.1
|
||||
|
||||
dotenv@16.6.1: {}
|
||||
|
||||
dotenv@17.2.3: {}
|
||||
|
||||
download-git-repo@3.0.2:
|
||||
dependencies:
|
||||
download: 7.1.0
|
||||
@@ -9665,6 +9700,8 @@ snapshots:
|
||||
|
||||
globals@14.0.0: {}
|
||||
|
||||
globals@16.5.0: {}
|
||||
|
||||
globalthis@1.0.4:
|
||||
dependencies:
|
||||
define-properties: 1.2.1
|
||||
|
||||
+2
-1
@@ -248,6 +248,8 @@ TIPS_SHORTCUT_MODIFIED_SUCCEED: Shortcut modified successfully
|
||||
TIPS_SHORTCUT_MODIFIED_CONFLICT: Shortcut conflict, please reset
|
||||
TIPS_CUSTOM_LINK_STYLE_MODIFIED_SUCCEED: Custom link style modified successfully
|
||||
TIPS_FIND_NEW_VERSION: Find new version ${v},update many new features, do you want to download the latest version?
|
||||
TIPS_DELETE_UPLOADER_CONFIG: Are you sure you want to delete this config?
|
||||
TIPS_COPY_UPLOADER_CONFIG: Are you sure you want to copy this config?
|
||||
|
||||
# privacy
|
||||
PRIVACY: >
|
||||
@@ -276,7 +278,6 @@ PRIVACY: >
|
||||
b) In accordance with the relevant provisions of the law, or the requirements of administrative or judicial institutions, disclose to third parties or administrative or judicial institutions;
|
||||
|
||||
|
||||
c) If you violate relevant Chinese laws, regulations or relevant rules, you need to disclose it to a third party;
|
||||
|
||||
|
||||
4. Information Security
|
||||
|
||||
@@ -248,6 +248,8 @@ TIPS_SHORTCUT_MODIFIED_SUCCEED: 快捷键已经修改成功
|
||||
TIPS_SHORTCUT_MODIFIED_CONFLICT: 快捷键冲突,请重新设置
|
||||
TIPS_CUSTOM_LINK_STYLE_MODIFIED_SUCCEED: 自定义链接格式已经修改成功
|
||||
TIPS_FIND_NEW_VERSION: 发现新版本${v},更新了很多功能,是否去下载最新的版本?
|
||||
TIPS_DELETE_UPLOADER_CONFIG: 是否要删除这个配置?
|
||||
TIPS_COPY_UPLOADER_CONFIG: 是否要复制这个配置?
|
||||
|
||||
# privacy
|
||||
PRIVACY: >
|
||||
@@ -276,7 +278,6 @@ PRIVACY: >
|
||||
b)根据法律的有关规定,或者行政或司法机构的要求,向第三方或者行政、司法机构披露;
|
||||
|
||||
|
||||
c)如您出现违反中国有关法律、法规或者相关规则的情况,需要向第三方披露;
|
||||
|
||||
|
||||
4.信息安全
|
||||
|
||||
@@ -248,6 +248,8 @@ TIPS_SHORTCUT_MODIFIED_SUCCEED: 快捷鍵已經修改成功
|
||||
TIPS_SHORTCUT_MODIFIED_CONFLICT: 快捷鍵衝突,請重新設定
|
||||
TIPS_CUSTOM_LINK_STYLE_MODIFIED_SUCCEED: 自訂連結格式已經修改成功
|
||||
TIPS_FIND_NEW_VERSION: 發現新版本${v},更新了很多功能,是否去下載最新的版本?
|
||||
TIPS_DELETE_UPLOADER_CONFIG: 是否要刪除這個配置?
|
||||
TIPS_COPY_UPLOADER_CONFIG: 是否要複製這個配置?
|
||||
|
||||
# privacy
|
||||
PRIVACY: >
|
||||
@@ -276,7 +278,6 @@ PRIVACY: >
|
||||
b)根據法律的有關規定,或者行政或司法機構的要求,向第三方或者行政、司法機構披露;
|
||||
|
||||
|
||||
c)如您出現違反中國有關法律、法規或者相關規則的情況,需要向第三方披露;
|
||||
|
||||
|
||||
4.信息安全
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
require('dotenv').config()
|
||||
|
||||
const { notarize } = require('@electron/notarize')
|
||||
const { APPLE_ID, APPLE_TEAM_ID, APPLE_APP_SPECIFIC_PASSWORD } = process.env
|
||||
const APP_BUNDLE_ID = 'com.molunerfinn.picgo'
|
||||
|
||||
async function main(context) {
|
||||
const { electronPlatformName, appOutDir, packager } = context
|
||||
|
||||
if (
|
||||
electronPlatformName !== 'darwin' ||
|
||||
!APPLE_ID ||
|
||||
!APPLE_APP_SPECIFIC_PASSWORD ||
|
||||
!APPLE_TEAM_ID
|
||||
) {
|
||||
console.log('Skip notarization.')
|
||||
return
|
||||
}
|
||||
|
||||
const appName = packager.appInfo.productFilename
|
||||
const appPath = `${appOutDir}/${appName}.app`
|
||||
|
||||
const now = Date.now()
|
||||
|
||||
console.log('Starting Apple notarization for', appPath)
|
||||
|
||||
await notarize({
|
||||
appPath,
|
||||
appBundleId: APP_BUNDLE_ID,
|
||||
appleId: APPLE_ID,
|
||||
appleIdPassword: APPLE_APP_SPECIFIC_PASSWORD,
|
||||
teamId: APPLE_TEAM_ID
|
||||
})
|
||||
|
||||
console.log('Finished Apple notarization for', appPath, `in ${(Date.now() - now) / 1000}s`)
|
||||
}
|
||||
|
||||
|
||||
module.exports = main
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IRPCActionType } from '~/universal/types/enum'
|
||||
import { RPCRouter } from '../router'
|
||||
import { deleteUploaderConfig, getUploaderConfigList, selectUploaderConfig, updateUploaderConfig } from '~/main/utils/handleUploaderConfig'
|
||||
import { copyUploaderConfig, deleteUploaderConfig, getUploaderConfigList, selectUploaderConfig, updateUploaderConfig } from '~/main/utils/handleUploaderConfig'
|
||||
|
||||
const configRouter = new RPCRouter()
|
||||
|
||||
@@ -15,6 +15,11 @@ configRouter
|
||||
const config = deleteUploaderConfig(type, id)
|
||||
return config
|
||||
})
|
||||
.add(IRPCActionType.COPY_UPLOADER_CONFIG, async (args) => {
|
||||
const [type, id] = args as ICopyUploaderConfigArgs
|
||||
const config = copyUploaderConfig(type, id)
|
||||
return config
|
||||
})
|
||||
.add(IRPCActionType.SELECT_UPLOADER, async (args) => {
|
||||
const [type, id] = args as ISelectUploaderConfigArgs
|
||||
selectUploaderConfig(type, id)
|
||||
|
||||
@@ -63,6 +63,8 @@ class DataReportManager {
|
||||
EventId: 'upload_video',
|
||||
Label: '',
|
||||
MapKv: {
|
||||
type: db.get('picBed.uploader') || db.get('picBed.current') || 'smms',
|
||||
mimeType: file.mimeType,
|
||||
sizeRange: calcUploadBigFileSizeRange(sizeMB),
|
||||
durationRange: calcVideoDurationRange(durationSec),
|
||||
}
|
||||
@@ -74,11 +76,22 @@ class DataReportManager {
|
||||
Label: '',
|
||||
MapKv: {
|
||||
type: db.get('picBed.uploader') || db.get('picBed.current') || 'smms',
|
||||
mimeType: file.mimeType,
|
||||
mimeType: file.mimeType || 'image/png',
|
||||
sizeRange: calcUploadBigFileSizeRange(file.size / MB)
|
||||
}
|
||||
};
|
||||
this.reportDataToWebContents(webContents, imageEventData);
|
||||
} else {
|
||||
const otherEventData: ITalkingDataOptions = {
|
||||
EventId: 'upload_file',
|
||||
Label: '',
|
||||
MapKv: {
|
||||
type: db.get('picBed.uploader') || db.get('picBed.current') || 'smms',
|
||||
mimeType: file.mimeType || 'UNKNOWN',
|
||||
sizeRange: calcUploadBigFileSizeRange(file.size / MB)
|
||||
}
|
||||
};
|
||||
this.reportDataToWebContents(webContents, otherEventData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { trimValues } from '#/utils/common'
|
||||
import { simpleClone, trimValues } from '#/utils/common'
|
||||
import picgo from '@core/picgo'
|
||||
import { v4 as uuid } from 'uuid'
|
||||
|
||||
@@ -121,6 +121,29 @@ export const deleteUploaderConfig = (type: string, id: string): IUploaderConfigI
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy uploader config by type & id
|
||||
*/
|
||||
export const copyUploaderConfig = (type: string, id: string): IUploaderConfigItem | void => {
|
||||
const { configList, defaultId } = getUploaderConfigList(type)
|
||||
const existConfig = configList.find((item: IStringKeyMap) => item._id === id)
|
||||
if (!existConfig) {
|
||||
return
|
||||
}
|
||||
const copiedConfig = completeUploaderMetaConfig({
|
||||
...simpleClone(existConfig),
|
||||
_configName: `${existConfig._configName || 'Default'} - Copy`
|
||||
})
|
||||
configList.push(copiedConfig)
|
||||
picgo.saveConfig({
|
||||
[`uploader.${type}.configList`]: configList
|
||||
})
|
||||
return {
|
||||
configList,
|
||||
defaultId
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* upgrade old uploader config to new format
|
||||
*/
|
||||
|
||||
@@ -461,6 +461,13 @@ function _getSearchResult (val: string) {
|
||||
.filter((item:INPMSearchResultObject) => {
|
||||
return item.package.name.includes('picgo-plugin-')
|
||||
})
|
||||
.filter((item: INPMSearchResultObject) => {
|
||||
// filter out fake picgo plugins from picgo.net
|
||||
if (item.package.description.includes('picgo.net') || item.package.description.includes('PicGo官方')) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
.map((item: INPMSearchResultObject) => {
|
||||
return handleSearchResult(item)
|
||||
})
|
||||
|
||||
@@ -43,6 +43,12 @@
|
||||
>
|
||||
<Edit />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="el-icon-copy"
|
||||
@click.stop="() => copyConfig(item._id)"
|
||||
>
|
||||
<DocumentCopy />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="el-icon-delete"
|
||||
:class="curConfigList.length <= 1 ? 'disabled' : ''"
|
||||
@@ -89,7 +95,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { Edit, Delete, Plus } from '@element-plus/icons-vue'
|
||||
import { Delete, DocumentCopy, Edit, Plus } from '@element-plus/icons-vue'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { saveConfig, triggerRPC } from '@/utils/dataSender'
|
||||
import dayjs from 'dayjs'
|
||||
import { IRPCActionType } from '~/universal/types/enum'
|
||||
@@ -105,6 +112,7 @@ const type = ref('')
|
||||
const curConfigList = ref<IStringKeyMap[]>([])
|
||||
const defaultConfigId = ref('')
|
||||
const store = useStore()
|
||||
const $confirm = ElMessageBox.confirm
|
||||
|
||||
async function selectItem (id: string) {
|
||||
await triggerRPC<void>(IRPCActionType.SELECT_UPLOADER, type.value, id)
|
||||
@@ -147,11 +155,39 @@ function formatTime (time: number): string {
|
||||
return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
||||
async function deleteConfig (id: string) {
|
||||
const res = await triggerRPC<IUploaderConfigItem | undefined>(IRPCActionType.DELETE_PICBED_CONFIG, type.value, id)
|
||||
if (!res) return
|
||||
curConfigList.value = res.configList
|
||||
defaultConfigId.value = res.defaultId
|
||||
function deleteConfig (id: string) {
|
||||
if (curConfigList.value.length <= 1) {
|
||||
return
|
||||
}
|
||||
$confirm($T('TIPS_DELETE_UPLOADER_CONFIG'), $T('TIPS_NOTICE'), {
|
||||
confirmButtonText: $T('CONFIRM'),
|
||||
cancelButtonText: $T('CANCEL'),
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const res = await triggerRPC<IUploaderConfigItem | undefined>(IRPCActionType.DELETE_PICBED_CONFIG, type.value, id)
|
||||
if (!res) return
|
||||
curConfigList.value = res.configList
|
||||
defaultConfigId.value = res.defaultId
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
function copyConfig (id: string) {
|
||||
$confirm($T('TIPS_COPY_UPLOADER_CONFIG'), $T('TIPS_NOTICE'), {
|
||||
confirmButtonText: $T('CONFIRM'),
|
||||
cancelButtonText: $T('CANCEL'),
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const res = await triggerRPC<IUploaderConfigItem | undefined>(IRPCActionType.COPY_UPLOADER_CONFIG, type.value, id)
|
||||
if (!res) return
|
||||
curConfigList.value = res.configList
|
||||
defaultConfigId.value = res.defaultId
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
function addNewConfig () {
|
||||
@@ -226,9 +262,11 @@ export default {
|
||||
align-items center
|
||||
color #eee
|
||||
.el-icon-edit
|
||||
.el-icon-copy
|
||||
.el-icon-delete
|
||||
cursor pointer
|
||||
.el-icon-edit
|
||||
.el-icon-copy
|
||||
margin-right 10px
|
||||
.disabled
|
||||
cursor not-allowed
|
||||
|
||||
@@ -58,6 +58,7 @@ export enum IRPCActionType {
|
||||
CHANGE_CURRENT_UPLOADER = 'CHANGE_CURRENT_UPLOADER',
|
||||
SELECT_UPLOADER = 'SELECT_UPLOADER',
|
||||
UPDATE_UPLOADER_CONFIG = 'UPDATE_UPLOADER_CONFIG',
|
||||
COPY_UPLOADER_CONFIG = 'COPY_UPLOADER_CONFIG',
|
||||
|
||||
// version rpc
|
||||
GET_LATEST_VERSION = 'GET_LATEST_VERSION',
|
||||
|
||||
Vendored
+2
@@ -218,6 +218,8 @@ interface ILocales {
|
||||
TIPS_SHORTCUT_MODIFIED_CONFLICT: string
|
||||
TIPS_CUSTOM_LINK_STYLE_MODIFIED_SUCCEED: string
|
||||
TIPS_FIND_NEW_VERSION: string
|
||||
TIPS_DELETE_UPLOADER_CONFIG: string
|
||||
TIPS_COPY_UPLOADER_CONFIG: string
|
||||
PRIVACY: string
|
||||
PRIVACY_TIPS: string
|
||||
QUIT: string
|
||||
|
||||
Vendored
+1
@@ -3,6 +3,7 @@ type IGetUploaderConfigListArgs = [type: string]
|
||||
type IDeleteUploaderConfigArgs = [type: string, id: string]
|
||||
type ISelectUploaderConfigArgs = [type: string, id: string]
|
||||
type IUpdateUploaderConfigArgs = [type: string, id: string, config: IStringKeyMap]
|
||||
type ICopyUploaderConfigArgs = [type: string, id: string]
|
||||
type IGetLatestVersionArgs = [isCheckBetaVersion: boolean]
|
||||
type IToolboxCheckArgs = [type: import('./enum').IToolboxItemType]
|
||||
type IOpenFileArgs = [filePath: string]
|
||||
|
||||
Reference in New Issue
Block a user