Compare commits

...
15 Commits
Author SHA1 Message Date
github-actions[bot] 63a637a50e chore: release v2.5.1 2023-03-16 13:52:56 +00:00
qwqcode 54487d999c chore(ci): fix git-chglog config
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 21:51:27 +08:00
qwqcode 6916c5a4d5 feat(go): upgrade golang to v1.20.2
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 21:14:29 +08:00
qwqcode 00d765b563 chore(deps): upgrade frontend deps
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 21:08:48 +08:00
qwqcode cb4985dc0b chore(deps): upgrade go app deps
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 21:02:40 +08:00
qwqcode 2b7d69e364 chore(ci): fix release.yml git command
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 20:58:27 +08:00
qwqcode 5075698f4a fix(ui/count-widget): context api undefined issue (#464)
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 20:50:42 +08:00
qwqcode 4c6fbeffb7 fix(ui/paginator): showErr func call issue
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 20:37:26 +08:00
qwqcode 262dd4123d refactor(ui/user): modify user to standalone module (#463)
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 19:23:10 +08:00
qwqcode 3ccc25e08b chore(chglog): set title_order config
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-16 11:32:02 +08:00
qwqcode 65ab1bab79 fix(ui/i18n): duplicate packaging built-in language in the external script
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-15 21:52:20 +08:00
qwqcode 4f5f3b9f7c chore(ci/build): checkout latest tag
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-15 21:20:58 +08:00
qwqcode fe4dfb2a1c fix(ui/sort-dropdown): dropdown menu disappears after call reload func (#461)
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-15 21:00:39 +08:00
qwqcode b71fe13787 refactor(anti_spam/aliyun): accessing aliyun green text api without sdk (#459)
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-14 23:12:12 +08:00
qwqcode 340ab407da chore(docs): update artalk latest version in docs
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-03-10 23:15:51 +08:00
53 changed files with 1026 additions and 974 deletions

No files matched your search

+8 -1
View File
@@ -15,6 +15,13 @@ options:
- refactor
- docs
commit_groups:
sort_by: Custom
title_order:
- feat
- fix
- perf
- refactor
- docs
title_maps:
feat: Features
fix: Bug Fixes
@@ -22,7 +29,7 @@ options:
refactor: Code Refactoring
docs: Documentation
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s\\/]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
+16 -11
View File
@@ -6,7 +6,7 @@ on:
types: [artalk-release]
env:
GO_VERSION: '1.20.1'
GO_VERSION: '1.20.2'
PKG_NAME: 'github.com/ArtalkJS/Artalk'
DOCKER_IMG: ghcr.io/goreleaser/goreleaser-cross
CACHE_DIR: /tmp/cache/docker-image
@@ -18,9 +18,17 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
- name: Checkout latest tag
run: |
# fetch tags
git fetch --prune --unshallow --tags -f
# checkout latest version
VERSION=$(git describe --tags --abbrev=0)
git checkout ${VERSION}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Docker Image Cache
id: docker-cache
@@ -48,20 +56,17 @@ jobs:
- name: Pre Build
run: |-
# get latest version by tag
VERSION=$(git describe --tags --abbrev=0)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
mkdir -p local
# github token
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" > local/.release-env
# changelog
mkdir -p local
git-chglog ${VERSION} > local/release-notes.md
# copy config file
cp conf/artalk.example.yml artalk.yml
# github token
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" > local/.release-env
- name: Build and Release
run: |
docker run \
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
- name: Checkout latest release tag
- name: Checkout latest tag
run: |
# fetch tags
git fetch --prune --unshallow --tags -f
+6 -2
View File
@@ -11,13 +11,17 @@ jobs:
defaults:
run:
# set for building frontend
working-directory: ./ui
working-directory: ./ui # set for building frontend
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Checkout latest tag
run: |
git fetch --prune --unshallow --tags -f
git checkout $(git describe --tags --abbrev=0)
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
+1 -1
View File
@@ -78,7 +78,7 @@ jobs:
# git commit and push
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add CHANGELOG.md "${UI_NPM_PKG_FILE}"
git add .
git commit -m "chore: release ${VERSION}"
git tag "${VERSION}"
+91 -240
View File
@@ -1,256 +1,107 @@
## [v2.5.0](https://github.com/ArtalkJS/Artalk/compare/v2.4.4...v2.5.0) (2023-03-10)
### Bug Fixes
* admin_page_get default Sort by create_at DESC.
* Fix wrong SQL syntax to support mysql database.
* add `X-Forwarded-For` proxy header read
* `timeAgo` appears negative number minutes ago
* `timeAgo` function does not display the now
* github actions image cache
* Typecho Importer some bugs.
* Prevent unsafe svg image uploads
* naming conflict of node circleci
* crash when frontend config is not set
* Truncate Chinese character issue.
* Wrong logic of captcha 'always' config.
* sidebar navigation sorting ([#361](https://github.com/ArtalkJS/Artalk/issues/361))
* docker image build script
* add `.npmignore` to fix NPM publish inclusion issue
* missing trusted_domains field
* config alias and Dockerfile
* frontend repository directory issue
* Add lock in ChildCommentCacheSave
* destroy method remove root element
* Add lock prevent query db repeatedly while cache miss.
* Dockerfile install bash
* Cache add mutex lock
* replace gravatar default mirror
* PageEdit not work when Page is not created.
* add whitelist for origin checker
* Geetest js resource url
* Rename field total_parents to total_roots.
* admin_site_edit URL Validator bug.
* Reduce the use of native raw SQL to process boolean judgments and transfer them to ORM for processing.
* **UA:** Cooperate with client-side to correct Win11 UA.
* **admin_edit:** Remove cache before admin_edit.
* **admin_site_edit:** Split urls and TrimSpace to allow Space around sep char.
* **api:** Modify to only api subpath enable SiteOrigin checker
* **api_main_get:** Msg center disable comment-pin.
* **api_version:** Trim version prefix v char
* **artrans:** Frontend import Payload modify to JSON object.
* **artrans:** Modify Typecho boot param keys.
* **artransfer:** trim json string before checking array type.
* **artransfer:** typecho date recovery.
* **artransfer:** incorrect IsPinned reference to IsPending ([#49](https://github.com/ArtalkJS/Artalk/issues/49))
* **artransfer:** improve logger & twikoo importer bug.
* **artransfer:** CreatedAt field recovery & json unmarshal number to float64 issue.
* **cache:** ChildCommentCacheSave repeatedly cache while exist
* **cache:** Use SingleFlight to avoid Cache breakdown.
* **cache:** Type conversion issue in Captcha part when using redis.
* **cache:** Duplicate display reply comments when pid cache is deleted
* **captcha:** Always-mode fail on the first req & modify font size
* **captcha:** Fix lots of bugs.
* **comment_add:** ip region search in comment add api
* **comment_add:** PendingDefault ignore Admin user
* **comment_edit:** Resend email when comment is_pending status is modified
* **conf_admins:** Preserve admin user which not in config file.
* **config:** replace viper with koanf to make map case sensitivity ([#47](https://github.com/ArtalkJS/Artalk/issues/47))
* **cors:** Import cors domains from db site urls.
* **db:** Time type field use pointer to solve 0000-00-00 issue.
* **db:** Fix query syntax error & importer vote recover.
* **db:** Support postgres database.
* **docker:** Docker-compose file add build option
* **docker:** Entrypoint script gen command
* **docker:** Run artalk-go anywhere with a right config
* **dockerfile:** Expose host for external device
* **email:** email queue initialization issue ([#374](https://github.com/ArtalkJS/Artalk/issues/374))
* **email:** duplicate sending with multiple admins using same email addrs ([#375](https://github.com/ArtalkJS/Artalk/issues/375))
* **email:** failback to `email.mail_tpl` if `admin_notify.email.mail_tpl` is empty
* **frontend-conf:** Use pointer with omitempty to ignore frontend config output
* **geetest:** Static page prevent cache
* **img-upload:** Set img_upload.path defualt value
* **importer:** UrlResolver disabled by default
* **importer:** UrlResolver avoid end of slash being removed
* **importer:** Fix too many sql variables Err while too much items.
* **importer:** json decode by universal type.
* **importer:** UrlResolver disabled by default when a TargetSiteUrl is given
* **limit-middleware:** Precise match & fix disable captcha config.
* **lint:** add tsc check before vite compile ([#440](https://github.com/ArtalkJS/Artalk/issues/440))
* **notify:** Remove atk-emoticon img tags
* **sidebar:** array type config option cannot be shown
* **site_origin:** issue of same-origin request under the proxy ([#454](https://github.com/ArtalkJS/Artalk/issues/454))
* **time:** Embed IANA timezone database in Windows build
* **transfer:** Importer boot param parse.
* **trusted_domains:** Extract from full URL with slash suffix & improve referer interceptor
* **trusted_domains:** Disable CORS restrictions
* **typo:** CaptchaCheck typo
* **ui:** hash goto function check condition issue
* **upgrade:** Upgrade cmd load config
* **utils:** func SplitAndTrimSpace remove blank items by default
* **validator:** ValidateURL modify to IsRequestURL
* **vote:** Vote up and down at the same time.
### Code Refactoring
* renamed from artalk-go to artalk
* http origin checker
* Improve GetLinkToReply logic
* Bind API actions under a struct.
* abstract email service
* project package structure
* remove version two-way check ([#452](https://github.com/ArtalkJS/Artalk/issues/452))
* batch removing artalk `-go` postfix
* Replace global variable lib.DB with injected db.
* build scripts and CI tests
* move from tmp dir to root
* merge ci workflows
* merge backend to monorepo branch
* migrate from echo to go-fiber
* replace pkger with go:embed
* **CI:** improve build and release workflows ([#358](https://github.com/ArtalkJS/Artalk/issues/358))
* **api:** Modify admin_comment_edit user merge logic
* **api:** Remove unnecessary parameter of ParamsDecode method
* **api_get:** Comments get api.
* **captcha:** abstract captcha service ([#455](https://github.com/ArtalkJS/Artalk/issues/455))
* **comment:** seperate comment ui renders from single file ([#427](https://github.com/ArtalkJS/Artalk/issues/427))
* **conf:** Rename notify to admin_notify & admin_notify.email option
* **docker:** Use a folder to place config instead of mounting a single file
* **notify_launcher:** notify_launcher refactor and fix some bugs.
* **scripts:** double quote to prevent globbing and word splitting
* **style:** convert to use Sass as a style interpreter ([#439](https://github.com/ArtalkJS/Artalk/issues/439))
* **ui:** automatic dependency injection ([#429](https://github.com/ArtalkJS/Artalk/issues/429))
### Documentation
* add `CODE_OF_CONDUCT.md`
* Update README.md
* add simplified README for artalk npm package
* add translation section to `CONTRIBUTING.md`
* Update README.md
* fix content and update index
* fix wrong config value ([#371](https://github.com/ArtalkJS/Artalk/issues/371))
* fix broken links ([#364](https://github.com/ArtalkJS/Artalk/issues/364))
* add open api ([#360](https://github.com/ArtalkJS/Artalk/issues/360))
* add `Project Structure` section to `CONTRIBUTING.md`
* Update README.md
* refine and add frontend api docs
* example in zh-CN
* update setup-example-site.sh script usage
* init artalk with new frontend api
* migrate ArtalkJS/Docs to monorepo docs
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* update CONTRIBUTING.md `make debug-build`
* **deploy:** add `restart=always` for docker to auto restart ([#425](https://github.com/ArtalkJS/Artalk/issues/425))
* **extras:** add deploy guide for vuepress ([#436](https://github.com/ArtalkJS/Artalk/issues/436))
## [v2.5.1](https://github.com/ArtalkJS/Artalk/compare/v2.5.0...v2.5.1) (2023-03-16)
### Features
* Typecho Impoter PageKey builder.
* add graceful shutdown
* password support to be encrypted by md5.
* Global site & origin checker & support cookie
* Update config example file.
* display IP region of comment ([#418](https://github.com/ArtalkJS/Artalk/issues/418)) ([#447](https://github.com/ArtalkJS/Artalk/issues/447))
* **go:** upgrade golang to v1.20.2
### Bug Fixes
* **ui/count-widget:** context api undefined issue ([#464](https://github.com/ArtalkJS/Artalk/issues/464))
* **ui/i18n:** duplicate packaging built-in language in the external script
* **ui/paginator:** showErr func call issue
* **ui/sort-dropdown:** dropdown menu disappears after call reload func ([#461](https://github.com/ArtalkJS/Artalk/issues/461))
### Code Refactoring
* **anti_spam/aliyun:** accessing aliyun green text api without sdk ([#459](https://github.com/ArtalkJS/Artalk/issues/459))
* **ui/user:** modify user to standalone module ([#463](https://github.com/ArtalkJS/Artalk/issues/463))
## [v2.5.0](https://github.com/ArtalkJS/Artalk/compare/v2.4.4...v2.5.0) (2023-03-10)
### Features
* migrate from `echo` to `go-fiber`
* upgrade go to v1.20.1
* more functions to handle artalk lifecycle ([#426](https://github.com/ArtalkJS/Artalk/issues/426))
* Add script to build artalk-sidebar
* Use bluemonday sanitizer
* Global trusted_domain config
* launch with vscode debugger
* display IP region of comment ([#418](https://github.com/ArtalkJS/Artalk/issues/418)) ([#447](https://github.com/ArtalkJS/Artalk/issues/447))
* docker ci add support for building arm64 wheels
* one-key site creating with artalk integrated
* trusted_domains disable referer check
* ApiVersion & FeMinVersion.
* Page PV counter
* Pagination of admin_page_get.
* FeMinVersion update to 2.0.5
* root path redict to sidebar login page
* FindCommentChildren query db while cache miss
* Add goreleaser with golang-cross.
* Remove example config allow_origins field
* Specific comments get flat mode.
* Add robots.txt.
* Typecho Impoter.
* admin_users password support to be encrypted by using bcrypt.
* Page title fetch support meta tag redirect link
* Admin update all title of pages.
* Typecho Impoter add some hint.
* **anti-spam:** Support Aliyun for Spam detection.
* **anti-spam:** Support KeyWords for Spam detection.
* **api:** Add Accessible URL fields
* **api:** Modify some APIs method to post
* **api:** Get login status API
* **api:** New statistic api
* **api:** Site cannot find err mark
* **api:** settings get & save
* **api-import-upload:** Frontend importer upload before.
* **api_add:** Allow patch user-agent parameter
* **api_admin_cache:** Add api handle cache
* **api_admin_page_fetch:** Add GetStatus parameter.
* **api_login_status:** Add is_admin field
* **artrans:** Import from Artalk v1 (PHP).
* **artrans:** Export and Import Artrans type data.
* **artrans:** Run on frontend client.
* **cache:** Almost full cache coverage.
* **cache:** Support redis & memcache
* **cache:** Replace built-in json lib with vmihailenco/msgpack to speed up
* more functions to handle artalk lifecycle ([#426](https://github.com/ArtalkJS/Artalk/issues/426))
* **ui:** add some static methods
* **ui/height_limit:** support scrollable height limit area ([#451](https://github.com/ArtalkJS/Artalk/issues/451))
* **ui/sidebar:** add dark mode support ([#450](https://github.com/ArtalkJS/Artalk/issues/450))
* **captcha:** add support for reCAPTCHA and hCaptcha ([#456](https://github.com/ArtalkJS/Artalk/issues/456))
* **captcha:** support turnstile captcha by cloudflare ([#453](https://github.com/ArtalkJS/Artalk/issues/453))
* **cmd:** Add workdir parameter & gen cmd.
* **cmd:** add admin command to create new user
* **cmd:** Add config cmd
* **comment:** Add field content_marked to render the markdown content
* **conf:** Support control Frontend Conf by Backend.
* **conf:** add conf option for specific email tpl for admins
* **conf:** auto-gen config file when initializing the app
* **conf:** Support for admin_notify.email.enabled option
* **conf:** Support for admin_notify.noise_mode option
* **conf:** Config database options not just dsn.
* **db:** Remove formal foreign key constraints
* **db:** Allow set table_prefix
* **email-tpl:** add ip variable to email template
* **geetest:** Provide geetest check API for frontend.
* **geetest:** Access geetest API
* **gen:** Gen cmd support overwrite file
* **go:** upgrade to Go 1.19 and update some deps
* **go:** Update golang to v1.18.1
* **i18n:** add i18n support for backend ([#343](https://github.com/ArtalkJS/Artalk/issues/343))
* **i18n:** translations for backend ([#344](https://github.com/ArtalkJS/Artalk/issues/344))
* **i18n:** add i18n support for sidebar ([#353](https://github.com/ArtalkJS/Artalk/issues/353))
* **i18n:** add zh-TW i18n translation for sidebar and app
* **img-upload:** Add img-upload option to config file.
* **img-upload:** Image Upload Api
* **img-upload:** Upload rate limitation.
* **img-upload:** Upload using upgit
* **img-upload:** Admin always enable img_upload function.
* **importer:** import from Twikoo.
* **importer:** import from valine.
* **importer:** Speed up importer & fix some bugs.
* **model:** Add IsPinned field into commnent model.
* **multi-site:** Isolate admin users among sites
* **notify:** Support WebHook notify
* **notify:** Various ways to send notify message for admin.
* **notify:** Support template & fix some bugs
* **pin:** Update admin_comment_edit api to edit IsPinned
* **pin:** Pin comments keep most top & Child-comments recursive query use Cooked.
* **pv:** Make route rule & create pvs table
* **self-upgrade:** Add cmd Self-upgrade function
* **tencent_tms:** Support tencent tms for Spam detection.
* **ui:** add some static methods
* **upgit:** Config del_local to remove local file after uploaded.
* **upgrade:** Upgrade command allow ignore version check.
* **user:** Admin email sending isolation between sites.
* **version:** Update Frontend min version to 2.2.1
### Bug Fixes
* **ui:** hash goto function check condition issue
* **ui/conf:** avoid some conf overrides frontend from the backend ([#449](https://github.com/ArtalkJS/Artalk/issues/449))
* **ui/editor:** disable img upload cannot hide its btn
* **ui/i18n:** subscribe event priority issue
* **ui/sidebar:** array type of preference initial data issue
* **ui/sidebar:** array type config option cannot be shown
* **ui/sidebar:** boolean type setting option save issue ([#431](https://github.com/ArtalkJS/Artalk/issues/431)) ([#444](https://github.com/ArtalkJS/Artalk/issues/444))
* **ui/sidebar:** setting item save follow type of template
* **lint:** add tsc check before vite compile ([#440](https://github.com/ArtalkJS/Artalk/issues/440))
* **email:** duplicate sending with multiple admins using same email addrs ([#375](https://github.com/ArtalkJS/Artalk/issues/375))
* **email:** email queue initialization issue ([#374](https://github.com/ArtalkJS/Artalk/issues/374))
* **email:** failback to `email.mail_tpl` if `admin_notify.email.mail_tpl` is empty
* `timeAgo` function does not display the now
* add `.npmignore` to fix NPM publish inclusion issue
* sidebar navigation sorting ([#361](https://github.com/ArtalkJS/Artalk/issues/361))
### Performance Improvements
* **conf:** only provide conf for frontend when fetching the first page
* **docker-build:** cache by separating the downloading of deps
* **trusted_domains:** Improve origin checker
* improve some css styles
* add graceful shutdown
* **conf/i18n:** detect and change locale when config file contains chinese
* **ui/list:** remove useless function call
* **ui/sidebar:** improve sidebar i18n
### Code Refactoring
* bump to monorepo
* renamed from artalk-go to artalk
* http origin checker
* abstract email service
* project package structure
* remove version two-way check ([#452](https://github.com/ArtalkJS/Artalk/issues/452))
* build scripts and CI tests
* replace pkger with go:embed
* launch with vscode debugger
* **CI:** one-key site creating with artalk integrated
* **CI:** improve build and release workflows ([#358](https://github.com/ArtalkJS/Artalk/issues/358))
* **captcha:** abstract captcha service ([#455](https://github.com/ArtalkJS/Artalk/issues/455))
* **comment:** separate comment ui renders from single file ([#427](https://github.com/ArtalkJS/Artalk/issues/427))
* **style:** convert to use Sass as a style interpreter ([#439](https://github.com/ArtalkJS/Artalk/issues/439))
* **ui:** automatic dependency injection ([#429](https://github.com/ArtalkJS/Artalk/issues/429))
* **ui/checker:** simplify checker lifecycle function param table ([#428](https://github.com/ArtalkJS/Artalk/issues/428))
* **ui/dark-mode:** separate dark mode logic into its own module ([#430](https://github.com/ArtalkJS/Artalk/issues/430))
* **ui/editor:** modify editor ui to standalone module ([#441](https://github.com/ArtalkJS/Artalk/issues/441))
* **ui/editor:** change functions of editor to standalone modules ([#443](https://github.com/ArtalkJS/Artalk/issues/443))
* **ui/height-limit:** modify height limit function to standalone module ([#435](https://github.com/ArtalkJS/Artalk/issues/435))
* **ui/i18n:** improve i18n function to standalone module ([#434](https://github.com/ArtalkJS/Artalk/issues/434))
* **ui/list:** modify list pagination to standalone module ([#437](https://github.com/ArtalkJS/Artalk/issues/437))
* **page/fetch:** remove goquery dependency when extracting page data ([#442](https://github.com/ArtalkJS/Artalk/issues/442))
* **anti_spam/qcloud-tms:** implement qcloud tms api without sdk ([#438](https://github.com/ArtalkJS/Artalk/issues/438))
### Documentation
* migrate ArtalkJS/Docs to monorepo docs
* add `CODE_OF_CONDUCT.md`
* add simplified README for artalk npm package
* add translation section to `CONTRIBUTING.md`
* fix wrong config value ([#371](https://github.com/ArtalkJS/Artalk/issues/371))
* fix broken links ([#364](https://github.com/ArtalkJS/Artalk/issues/364))
* add open api ([#360](https://github.com/ArtalkJS/Artalk/issues/360))
* add `Project Structure` section to `CONTRIBUTING.md`
* refine and add frontend api docs
* update setup-example-site.sh script usage
* init artalk with new frontend api
* **deploy:** add `restart=always` for docker to auto restart ([#425](https://github.com/ArtalkJS/Artalk/issues/425))
* **extras:** add deploy guide for vuepress ([#436](https://github.com/ArtalkJS/Artalk/issues/436))
+1 -1
View File
@@ -1,5 +1,5 @@
### build Artalk
FROM golang:1.20.1-alpine3.17 as builder
FROM golang:1.20.2-alpine3.17 as builder
WORKDIR /source
+2
View File
@@ -171,6 +171,8 @@ see [CONTRIBUTING.md](./CONTRIBUTING.md)
- [x] 验证码
- [x] 图片验证码
- [x] [Turnstile](https://www.cloudflare.com/products/turnstile/)
- [x] [ReCAPTCHA](https://www.google.com/recaptcha/about/)
- [x] [hCaptcha](https://www.hcaptcha.com/)
- [x] [极验](https://www.geetest.com/)滑动验证码
- [x] 反垃圾
- [x] [Akismet](https://akismet.com/)
+1 -1
View File
@@ -1,3 +1,3 @@
{
"latest": "2.4.4"
"latest": "2.5.1"
}
+3 -3
View File
@@ -16,9 +16,9 @@
"swagger:serve": "npx @redocly/cli preview-docs"
},
"devDependencies": {
"@redocly/cli": "1.0.0-beta.123",
"@redocly/cli": "1.0.0-beta.124",
"markdown-it-for-inline": "^0.1.1",
"sass": "^1.58.3",
"vitepress": "1.0.0-alpha.50"
"sass": "^1.59.3",
"vitepress": "1.0.0-alpha.60"
}
}
+144 -144
View File
@@ -1,16 +1,16 @@
lockfileVersion: 5.4
specifiers:
'@redocly/cli': 1.0.0-beta.123
'@redocly/cli': 1.0.0-beta.124
markdown-it-for-inline: ^0.1.1
sass: ^1.58.3
vitepress: 1.0.0-alpha.50
sass: ^1.59.3
vitepress: 1.0.0-alpha.60
devDependencies:
'@redocly/cli': 1.0.0-beta.123
'@redocly/cli': 1.0.0-beta.124
markdown-it-for-inline: 0.1.1
sass: 1.58.3
vitepress: 1.0.0-alpha.50_sass@1.58.3
sass: 1.59.3
vitepress: 1.0.0-alpha.60_sass@1.59.3
packages:
@@ -131,11 +131,11 @@ packages:
'@babel/highlight': 7.18.6
dev: true
/@babel/generator/7.21.1:
resolution: {integrity: sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA==}
/@babel/generator/7.21.3:
resolution: {integrity: sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.21.2
'@babel/types': 7.21.3
'@jridgewell/gen-mapping': 0.3.2
'@jridgewell/trace-mapping': 0.3.17
jsesc: 2.5.2
@@ -145,7 +145,7 @@ packages:
resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.21.2
'@babel/types': 7.21.3
dev: true
/@babel/helper-environment-visitor/7.18.9:
@@ -158,28 +158,28 @@ packages:
engines: {node: '>=6.9.0'}
dependencies:
'@babel/template': 7.20.7
'@babel/types': 7.21.2
'@babel/types': 7.21.3
dev: true
/@babel/helper-hoist-variables/7.18.6:
resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.21.2
'@babel/types': 7.21.3
dev: true
/@babel/helper-module-imports/7.18.6:
resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.21.2
'@babel/types': 7.21.3
dev: true
/@babel/helper-split-export-declaration/7.18.6:
resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.21.2
'@babel/types': 7.21.3
dev: true
/@babel/helper-string-parser/7.19.4:
@@ -201,12 +201,12 @@ packages:
js-tokens: 4.0.0
dev: true
/@babel/parser/7.21.2:
resolution: {integrity: sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==}
/@babel/parser/7.21.3:
resolution: {integrity: sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
'@babel/types': 7.21.2
'@babel/types': 7.21.3
dev: true
/@babel/runtime/7.21.0:
@@ -221,30 +221,30 @@ packages:
engines: {node: '>=6.9.0'}
dependencies:
'@babel/code-frame': 7.18.6
'@babel/parser': 7.21.2
'@babel/types': 7.21.2
'@babel/parser': 7.21.3
'@babel/types': 7.21.3
dev: true
/@babel/traverse/7.21.2_supports-color@5.5.0:
resolution: {integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==}
/@babel/traverse/7.21.3_supports-color@5.5.0:
resolution: {integrity: sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/code-frame': 7.18.6
'@babel/generator': 7.21.1
'@babel/generator': 7.21.3
'@babel/helper-environment-visitor': 7.18.9
'@babel/helper-function-name': 7.21.0
'@babel/helper-hoist-variables': 7.18.6
'@babel/helper-split-export-declaration': 7.18.6
'@babel/parser': 7.21.2
'@babel/types': 7.21.2
'@babel/parser': 7.21.3
'@babel/types': 7.21.3
debug: 4.3.4_supports-color@5.5.0
globals: 11.12.0
transitivePeerDependencies:
- supports-color
dev: true
/@babel/types/7.21.2:
resolution: {integrity: sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw==}
/@babel/types/7.21.3:
resolution: {integrity: sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-string-parser': 7.19.4
@@ -260,7 +260,7 @@ packages:
resolution: {integrity: sha512-2xAv2GFuHzzmG0SSZgf8wHX0qZX8n9Y1ZirKUk5Wrdc+vH9CL837x2hZIUdwcPZI9caBA+/CzxsS68O4waYjUQ==}
dependencies:
'@docsearch/react': 3.3.3
preact: 10.13.0
preact: 10.13.1
transitivePeerDependencies:
- '@algolia/client-search'
- '@types/react'
@@ -308,8 +308,8 @@ packages:
resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==}
dev: true
/@esbuild/android-arm/0.16.17:
resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==}
/@esbuild/android-arm/0.17.11:
resolution: {integrity: sha512-CdyX6sRVh1NzFCsf5vw3kULwlAhfy9wVt8SZlrhQ7eL2qBjGbFhRBWkkAzuZm9IIEOCKJw4DXA6R85g+qc8RDw==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
@@ -317,8 +317,8 @@ packages:
dev: true
optional: true
/@esbuild/android-arm64/0.16.17:
resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==}
/@esbuild/android-arm64/0.17.11:
resolution: {integrity: sha512-QnK4d/zhVTuV4/pRM4HUjcsbl43POALU2zvBynmrrqZt9LPcLA3x1fTZPBg2RRguBQnJcnU059yKr+bydkntjg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
@@ -326,8 +326,8 @@ packages:
dev: true
optional: true
/@esbuild/android-x64/0.16.17:
resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==}
/@esbuild/android-x64/0.17.11:
resolution: {integrity: sha512-3PL3HKtsDIXGQcSCKtWD/dy+mgc4p2Tvo2qKgKHj9Yf+eniwFnuoQ0OUhlSfAEpKAFzF9N21Nwgnap6zy3L3MQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
@@ -335,8 +335,8 @@ packages:
dev: true
optional: true
/@esbuild/darwin-arm64/0.16.17:
resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==}
/@esbuild/darwin-arm64/0.17.11:
resolution: {integrity: sha512-pJ950bNKgzhkGNO3Z9TeHzIFtEyC2GDQL3wxkMApDEghYx5Qers84UTNc1bAxWbRkuJOgmOha5V0WUeh8G+YGw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
@@ -344,8 +344,8 @@ packages:
dev: true
optional: true
/@esbuild/darwin-x64/0.16.17:
resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==}
/@esbuild/darwin-x64/0.17.11:
resolution: {integrity: sha512-iB0dQkIHXyczK3BZtzw1tqegf0F0Ab5texX2TvMQjiJIWXAfM4FQl7D909YfXWnB92OQz4ivBYQ2RlxBJrMJOw==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
@@ -353,8 +353,8 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-arm64/0.16.17:
resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==}
/@esbuild/freebsd-arm64/0.17.11:
resolution: {integrity: sha512-7EFzUADmI1jCHeDRGKgbnF5sDIceZsQGapoO6dmw7r/ZBEKX7CCDnIz8m9yEclzr7mFsd+DyasHzpjfJnmBB1Q==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
@@ -362,8 +362,8 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-x64/0.16.17:
resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==}
/@esbuild/freebsd-x64/0.17.11:
resolution: {integrity: sha512-iPgenptC8i8pdvkHQvXJFzc1eVMR7W2lBPrTE6GbhR54sLcF42mk3zBOjKPOodezzuAz/KSu8CPyFSjcBMkE9g==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
@@ -371,8 +371,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm/0.16.17:
resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==}
/@esbuild/linux-arm/0.17.11:
resolution: {integrity: sha512-M9iK/d4lgZH0U5M1R2p2gqhPV/7JPJcRz+8O8GBKVgqndTzydQ7B2XGDbxtbvFkvIs53uXTobOhv+RyaqhUiMg==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
@@ -380,8 +380,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm64/0.16.17:
resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==}
/@esbuild/linux-arm64/0.17.11:
resolution: {integrity: sha512-Qxth3gsWWGKz2/qG2d5DsW/57SeA2AmpSMhdg9TSB5Svn2KDob3qxfQSkdnWjSd42kqoxIPy3EJFs+6w1+6Qjg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
@@ -389,8 +389,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-ia32/0.16.17:
resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==}
/@esbuild/linux-ia32/0.17.11:
resolution: {integrity: sha512-dB1nGaVWtUlb/rRDHmuDQhfqazWE0LMro/AIbT2lWM3CDMHJNpLckH+gCddQyhhcLac2OYw69ikUMO34JLt3wA==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
@@ -398,8 +398,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-loong64/0.16.17:
resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==}
/@esbuild/linux-loong64/0.17.11:
resolution: {integrity: sha512-aCWlq70Q7Nc9WDnormntGS1ar6ZFvUpqr8gXtO+HRejRYPweAFQN615PcgaSJkZjhHp61+MNLhzyVALSF2/Q0g==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
@@ -407,8 +407,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-mips64el/0.16.17:
resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==}
/@esbuild/linux-mips64el/0.17.11:
resolution: {integrity: sha512-cGeGNdQxqY8qJwlYH1BP6rjIIiEcrM05H7k3tR7WxOLmD1ZxRMd6/QIOWMb8mD2s2YJFNRuNQ+wjMhgEL2oCEw==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
@@ -416,8 +416,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-ppc64/0.16.17:
resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==}
/@esbuild/linux-ppc64/0.17.11:
resolution: {integrity: sha512-BdlziJQPW/bNe0E8eYsHB40mYOluS+jULPCjlWiHzDgr+ZBRXPtgMV1nkLEGdpjrwgmtkZHEGEPaKdS/8faLDA==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
@@ -425,8 +425,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-riscv64/0.16.17:
resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==}
/@esbuild/linux-riscv64/0.17.11:
resolution: {integrity: sha512-MDLwQbtF+83oJCI1Cixn68Et/ME6gelmhssPebC40RdJaect+IM+l7o/CuG0ZlDs6tZTEIoxUe53H3GmMn8oMA==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
@@ -434,8 +434,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-s390x/0.16.17:
resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==}
/@esbuild/linux-s390x/0.17.11:
resolution: {integrity: sha512-4N5EMESvws0Ozr2J94VoUD8HIRi7X0uvUv4c0wpTHZyZY9qpaaN7THjosdiW56irQ4qnJ6Lsc+i+5zGWnyqWqQ==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
@@ -443,8 +443,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-x64/0.16.17:
resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==}
/@esbuild/linux-x64/0.17.11:
resolution: {integrity: sha512-rM/v8UlluxpytFSmVdbCe1yyKQd/e+FmIJE2oPJvbBo+D0XVWi1y/NQ4iTNx+436WmDHQBjVLrbnAQLQ6U7wlw==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
@@ -452,8 +452,8 @@ packages:
dev: true
optional: true
/@esbuild/netbsd-x64/0.16.17:
resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==}
/@esbuild/netbsd-x64/0.17.11:
resolution: {integrity: sha512-4WaAhuz5f91h3/g43VBGdto1Q+X7VEZfpcWGtOFXnggEuLvjV+cP6DyLRU15IjiU9fKLLk41OoJfBFN5DhPvag==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
@@ -461,8 +461,8 @@ packages:
dev: true
optional: true
/@esbuild/openbsd-x64/0.16.17:
resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==}
/@esbuild/openbsd-x64/0.17.11:
resolution: {integrity: sha512-UBj135Nx4FpnvtE+C8TWGp98oUgBcmNmdYgl5ToKc0mBHxVVqVE7FUS5/ELMImOp205qDAittL6Ezhasc2Ev/w==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
@@ -470,8 +470,8 @@ packages:
dev: true
optional: true
/@esbuild/sunos-x64/0.16.17:
resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==}
/@esbuild/sunos-x64/0.17.11:
resolution: {integrity: sha512-1/gxTifDC9aXbV2xOfCbOceh5AlIidUrPsMpivgzo8P8zUtczlq1ncFpeN1ZyQJ9lVs2hILy1PG5KPp+w8QPPg==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
@@ -479,8 +479,8 @@ packages:
dev: true
optional: true
/@esbuild/win32-arm64/0.16.17:
resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==}
/@esbuild/win32-arm64/0.17.11:
resolution: {integrity: sha512-vtSfyx5yRdpiOW9yp6Ax0zyNOv9HjOAw8WaZg3dF5djEHKKm3UnoohftVvIJtRh0Ec7Hso0RIdTqZvPXJ7FdvQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
@@ -488,8 +488,8 @@ packages:
dev: true
optional: true
/@esbuild/win32-ia32/0.16.17:
resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==}
/@esbuild/win32-ia32/0.17.11:
resolution: {integrity: sha512-GFPSLEGQr4wHFTiIUJQrnJKZhZjjq4Sphf+mM76nQR6WkQn73vm7IsacmBRPkALfpOCHsopSvLgqdd4iUW2mYw==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
@@ -497,8 +497,8 @@ packages:
dev: true
optional: true
/@esbuild/win32-x64/0.16.17:
resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==}
/@esbuild/win32-x64/0.17.11:
resolution: {integrity: sha512-N9vXqLP3eRL8BqSy8yn4Y98cZI2pZ8fyuHx6lKjiG2WABpT2l01TXdzq5Ma2ZUBzfB7tx5dXVhge8X9u0S70ZQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
@@ -506,8 +506,8 @@ packages:
dev: true
optional: true
/@exodus/schemasafe/1.0.0-rc.11:
resolution: {integrity: sha512-jlDglM3cbjrpq+D4oDBP/tztQDJn2hNqOak/wIOIVxbv8+d9Yn8or4Misr0zx9UEsvVFYNCQsE97zVvIU0/Idw==}
/@exodus/schemasafe/1.0.0:
resolution: {integrity: sha512-2cyupPIZI69HQxEAPllLXBjQp4njDKkOjYRCYxvMZe3/LY9pp9fBM3Tb1wiFAdP6Emo4v3OEbCLGj6u73Q5KLw==}
dev: true
/@jridgewell/gen-mapping/0.3.2:
@@ -549,12 +549,12 @@ packages:
uri-js: 4.4.1
dev: true
/@redocly/cli/1.0.0-beta.123:
resolution: {integrity: sha512-aTlqewdXj0LXjh38xJ5lfa380Nyu/cq9+CmfUKXk95/5BDkbJvOjTInxndsjB/KgKbOJlx0vnEoktms0aDhtNw==}
/@redocly/cli/1.0.0-beta.124:
resolution: {integrity: sha512-DkERQRqSK8ziYusCoiEWQ187lBtGCBf5ujqGozK3BkBrZkPYstPiIAF88vlbdgPnlOUuCHOT7/AeYf7rE/2VBw==}
engines: {node: '>=12.0.0'}
hasBin: true
dependencies:
'@redocly/openapi-core': 1.0.0-beta.123
'@redocly/openapi-core': 1.0.0-beta.124
assert-node-version: 1.0.3
chokidar: 3.5.3
colorette: 1.4.0
@@ -580,12 +580,12 @@ packages:
- webpack
dev: true
/@redocly/openapi-core/1.0.0-beta.123:
resolution: {integrity: sha512-W6MbUWpb/VaV+Kf0c3jmMIJw3WwwF7iK5nAfcOS+ZwrlbxtIl37+1hEydFlJ209vCR9HL12PaMwdh2Vpihj6Jw==}
/@redocly/openapi-core/1.0.0-beta.124:
resolution: {integrity: sha512-WvRRR4z1zJgs55fM5wdFrZ9WzuFT8QeEVRgvmERhi/kJcGEUGKHgezuDMmIhDUAnxi/+eJJfwAnLnUzC4c69Fg==}
engines: {node: '>=12.0.0'}
dependencies:
'@redocly/ajv': 8.11.0
'@types/node': 14.18.37
'@types/node': 14.18.38
colorette: 1.4.0
js-levenshtein: 1.1.6
js-yaml: 4.1.0
@@ -602,7 +602,7 @@ packages:
resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==}
dependencies:
'@types/minimatch': 5.1.2
'@types/node': 18.14.6
'@types/node': 18.15.3
dev: true
/@types/json-schema/7.0.11:
@@ -613,33 +613,33 @@ packages:
resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
dev: true
/@types/node/14.18.37:
resolution: {integrity: sha512-7GgtHCs/QZrBrDzgIJnQtuSvhFSwhyYSI2uafSwZoNt1iOGhEN5fwNrQMjtONyHm9+/LoA4453jH0CMYcr06Pg==}
/@types/node/14.18.38:
resolution: {integrity: sha512-zMRIidN2Huikv/+/U7gRPFYsXDR/7IGqFZzTLnCEj5+gkrQjsowfamaxEnyvArct5hxGA3bTxMXlYhH78V6Cew==}
dev: true
/@types/node/18.14.6:
resolution: {integrity: sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==}
/@types/node/18.15.3:
resolution: {integrity: sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==}
dev: true
/@types/web-bluetooth/0.0.16:
resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==}
dev: true
/@vitejs/plugin-vue/4.0.0_vite@4.1.4+vue@3.2.47:
resolution: {integrity: sha512-e0X4jErIxAB5oLtDqbHvHpJe/uWNkdpYV83AOG2xo2tEVSzCzewgJMtREZM30wXnM5ls90hxiOtAuVU6H5JgbA==}
/@vitejs/plugin-vue/4.1.0_vite@4.2.0+vue@3.2.47:
resolution: {integrity: sha512-++9JOAFdcXI3lyer9UKUV4rfoQ3T1RN8yDqoCLar86s0xQct5yblxAE+yWgRnU5/0FOlVCpTZpYSBV/bGWrSrQ==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
vite: ^4.0.0
vue: ^3.2.25
dependencies:
vite: 4.1.4_sass@1.58.3
vite: 4.2.0_sass@1.59.3
vue: 3.2.47
dev: true
/@vue/compiler-core/3.2.47:
resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==}
dependencies:
'@babel/parser': 7.21.2
'@babel/parser': 7.21.3
'@vue/shared': 3.2.47
estree-walker: 2.0.2
source-map: 0.6.1
@@ -655,7 +655,7 @@ packages:
/@vue/compiler-sfc/3.2.47:
resolution: {integrity: sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==}
dependencies:
'@babel/parser': 7.21.2
'@babel/parser': 7.21.3
'@vue/compiler-core': 3.2.47
'@vue/compiler-dom': 3.2.47
'@vue/compiler-ssr': 3.2.47
@@ -681,7 +681,7 @@ packages:
/@vue/reactivity-transform/3.2.47:
resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==}
dependencies:
'@babel/parser': 7.21.2
'@babel/parser': 7.21.3
'@vue/compiler-core': 3.2.47
'@vue/shared': 3.2.47
estree-walker: 2.0.2
@@ -1013,34 +1013,34 @@ packages:
resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==}
dev: true
/esbuild/0.16.17:
resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==}
/esbuild/0.17.11:
resolution: {integrity: sha512-pAMImyokbWDtnA/ufPxjQg0fYo2DDuzAlqwnDvbXqHLphe+m80eF++perYKVm8LeTuj2zUuFXC+xgSVxyoHUdg==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
optionalDependencies:
'@esbuild/android-arm': 0.16.17
'@esbuild/android-arm64': 0.16.17
'@esbuild/android-x64': 0.16.17
'@esbuild/darwin-arm64': 0.16.17
'@esbuild/darwin-x64': 0.16.17
'@esbuild/freebsd-arm64': 0.16.17
'@esbuild/freebsd-x64': 0.16.17
'@esbuild/linux-arm': 0.16.17
'@esbuild/linux-arm64': 0.16.17
'@esbuild/linux-ia32': 0.16.17
'@esbuild/linux-loong64': 0.16.17
'@esbuild/linux-mips64el': 0.16.17
'@esbuild/linux-ppc64': 0.16.17
'@esbuild/linux-riscv64': 0.16.17
'@esbuild/linux-s390x': 0.16.17
'@esbuild/linux-x64': 0.16.17
'@esbuild/netbsd-x64': 0.16.17
'@esbuild/openbsd-x64': 0.16.17
'@esbuild/sunos-x64': 0.16.17
'@esbuild/win32-arm64': 0.16.17
'@esbuild/win32-ia32': 0.16.17
'@esbuild/win32-x64': 0.16.17
'@esbuild/android-arm': 0.17.11
'@esbuild/android-arm64': 0.17.11
'@esbuild/android-x64': 0.17.11
'@esbuild/darwin-arm64': 0.17.11
'@esbuild/darwin-x64': 0.17.11
'@esbuild/freebsd-arm64': 0.17.11
'@esbuild/freebsd-x64': 0.17.11
'@esbuild/linux-arm': 0.17.11
'@esbuild/linux-arm64': 0.17.11
'@esbuild/linux-ia32': 0.17.11
'@esbuild/linux-loong64': 0.17.11
'@esbuild/linux-mips64el': 0.17.11
'@esbuild/linux-ppc64': 0.17.11
'@esbuild/linux-riscv64': 0.17.11
'@esbuild/linux-s390x': 0.17.11
'@esbuild/linux-x64': 0.17.11
'@esbuild/netbsd-x64': 0.17.11
'@esbuild/openbsd-x64': 0.17.11
'@esbuild/sunos-x64': 0.17.11
'@esbuild/win32-arm64': 0.17.11
'@esbuild/win32-ia32': 0.17.11
'@esbuild/win32-x64': 0.17.11
dev: true
/escalade/3.1.1:
@@ -1174,8 +1174,8 @@ packages:
resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==}
dev: true
/immutable/4.2.4:
resolution: {integrity: sha512-WDxL3Hheb1JkRN3sQkyujNlL/xRjAo3rJtaU5xeufUauG66JdMr32bLj4gF+vWl84DIA3Zxw7tiAjneYzRRw+w==}
/immutable/4.3.0:
resolution: {integrity: sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==}
dev: true
/inflight/1.0.6:
@@ -1323,8 +1323,8 @@ packages:
minimist: 1.2.8
dev: true
/mobx-react-lite/3.4.2_qq5k7xmo3oqg7ez4gi6qckqgy4:
resolution: {integrity: sha512-wOFI6qhMBucYNy00aSDoee23L2//wKYJp4z5k+YOhOCY303prwLaWiEhJU0H2c//oIEEswGqUHtVV2qptk/g5g==}
/mobx-react-lite/3.4.3_qq5k7xmo3oqg7ez4gi6qckqgy4:
resolution: {integrity: sha512-NkJREyFTSUXR772Qaai51BnE1voWx56LOL80xG7qkZr6vo8vEaLF3sz1JNUVh+rxmUzxYaqOhfuxTfqUh0FXUg==}
peerDependencies:
mobx: ^6.1.0
react: ^16.8.0 || ^17 || ^18
@@ -1355,7 +1355,7 @@ packages:
optional: true
dependencies:
mobx: 6.8.0
mobx-react-lite: 3.4.2_qq5k7xmo3oqg7ez4gi6qckqgy4
mobx-react-lite: 3.4.3_qq5k7xmo3oqg7ez4gi6qckqgy4
react: 17.0.2
react-dom: 17.0.2_react@17.0.2
dev: true
@@ -1421,7 +1421,7 @@ packages:
/oas-linter/3.2.2:
resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==}
dependencies:
'@exodus/schemasafe': 1.0.0-rc.11
'@exodus/schemasafe': 1.0.0
should: 13.2.3
yaml: 1.10.2
dev: true
@@ -1534,8 +1534,8 @@ packages:
source-map-js: 1.0.2
dev: true
/preact/10.13.0:
resolution: {integrity: sha512-ERdIdUpR6doqdaSIh80hvzebHB7O6JxycOhyzAeLEchqOq/4yueslQbfnPwXaNhAYacFTyCclhwkEbOumT0tHw==}
/preact/10.13.1:
resolution: {integrity: sha512-KyoXVDU5OqTpG9LXlB3+y639JAGzl8JSBXLn1J9HTSB3gbKcuInga7bZnXLlxmK94ntTs1EFeZp0lrja2AuBYQ==}
dev: true
/prismjs/1.29.0:
@@ -1599,8 +1599,8 @@ packages:
object-assign: 4.1.1
dev: true
/readable-stream/3.6.1:
resolution: {integrity: sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==}
/readable-stream/3.6.2:
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
engines: {node: '>= 6'}
dependencies:
inherits: 2.0.4
@@ -1625,7 +1625,7 @@ packages:
react-dom: ^16.8.4 || ^17.0.0
styled-components: ^4.1.1 || ^5.1.1
dependencies:
'@redocly/openapi-core': 1.0.0-beta.123
'@redocly/openapi-core': 1.0.0-beta.124
classnames: 2.3.2
decko: 1.2.0
dompurify: 2.4.5
@@ -1647,7 +1647,7 @@ packages:
react-tabs: 3.2.3_react@17.0.2
slugify: 1.4.7
stickyfill: 1.1.1
style-loader: 3.3.1
style-loader: 3.3.2
styled-components: 5.3.3_sfoxds7t5ydpegc3knd667wn6m
swagger2openapi: 7.0.8
url-template: 2.0.8
@@ -1684,8 +1684,8 @@ packages:
supports-preserve-symlinks-flag: 1.0.0
dev: true
/rollup/3.18.0:
resolution: {integrity: sha512-J8C6VfEBjkvYPESMQYxKHxNOh4A5a3FlP+0BETGo34HEcE4eTlgCrO2+eWzlu2a/sHs2QUkZco+wscH7jhhgWg==}
/rollup/3.19.1:
resolution: {integrity: sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
@@ -1696,13 +1696,13 @@ packages:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
dev: true
/sass/1.58.3:
resolution: {integrity: sha512-Q7RaEtYf6BflYrQ+buPudKR26/lH+10EmO9bBqbmPh/KeLqv8bjpTNqxe71ocONqXq+jYiCbpPUmQMS+JJPk4A==}
/sass/1.59.3:
resolution: {integrity: sha512-QCq98N3hX1jfTCoUAsF3eyGuXLsY7BCnCEg9qAact94Yc21npG2/mVOqoDvE0fCbWDqiM4WlcJQla0gWG2YlxQ==}
engines: {node: '>=12.0.0'}
hasBin: true
dependencies:
chokidar: 3.5.3
immutable: 4.2.4
immutable: 4.3.0
source-map-js: 1.0.2
dev: true
@@ -1775,7 +1775,7 @@ packages:
debug: 4.3.4
queue-microtask: 1.2.3
randombytes: 2.1.0
readable-stream: 3.6.1
readable-stream: 3.6.2
ws: 7.5.9
transitivePeerDependencies:
- bufferutil
@@ -1829,8 +1829,8 @@ packages:
ansi-regex: 5.0.1
dev: true
/style-loader/3.3.1:
resolution: {integrity: sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==}
/style-loader/3.3.2:
resolution: {integrity: sha512-RHs/vcrKdQK8wZliteNK4NKzxvLBzpuHMqYmUVWeKa6MkaIQ97ZTOS0b+zapZhy6GcrgWnvWYCMHRirC3FsUmw==}
engines: {node: '>= 12.13.0'}
peerDependencies:
webpack: ^5.0.0
@@ -1845,7 +1845,7 @@ packages:
react-is: '>= 16.8.0'
dependencies:
'@babel/helper-module-imports': 7.18.6
'@babel/traverse': 7.21.2_supports-color@5.5.0
'@babel/traverse': 7.21.3_supports-color@5.5.0
'@emotion/is-prop-valid': 0.8.8
'@emotion/stylis': 0.8.5
'@emotion/unitless': 0.7.5
@@ -1927,8 +1927,8 @@ packages:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
dev: true
/vite/4.1.4_sass@1.58.3:
resolution: {integrity: sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==}
/vite/4.2.0_sass@1.59.3:
resolution: {integrity: sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
@@ -1952,27 +1952,27 @@ packages:
terser:
optional: true
dependencies:
esbuild: 0.16.17
esbuild: 0.17.11
postcss: 8.4.21
resolve: 1.22.1
rollup: 3.18.0
sass: 1.58.3
rollup: 3.19.1
sass: 1.59.3
optionalDependencies:
fsevents: 2.3.2
dev: true
/vitepress/1.0.0-alpha.50_sass@1.58.3:
resolution: {integrity: sha512-6EdT6JIiHRD7KatKMfxCJ3J7aHlkMp67ZEcfYrMTLKAJ+K+qWs2p427udMHSenCOzVNLIikEC5v/rP3GOGWubQ==}
/vitepress/1.0.0-alpha.60_sass@1.59.3:
resolution: {integrity: sha512-GI5iLDkZRqGEPixbSloT+p6pbKcMh9ykRRxt8vf9AjV1gaPit6Stg/t9WNxTdIhKVCuQMexGs1605DNApSRK2A==}
hasBin: true
dependencies:
'@docsearch/css': 3.3.3
'@docsearch/js': 3.3.3
'@vitejs/plugin-vue': 4.0.0_vite@4.1.4+vue@3.2.47
'@vitejs/plugin-vue': 4.1.0_vite@4.2.0+vue@3.2.47
'@vue/devtools-api': 6.5.0
'@vueuse/core': 9.13.0_vue@3.2.47
body-scroll-lock: 4.0.0-beta.0
shiki: 0.14.1
vite: 4.1.4_sass@1.58.3
vite: 4.2.0_sass@1.59.3
vue: 3.2.47
transitivePeerDependencies:
- '@algolia/client-search'
+13 -20
View File
@@ -3,7 +3,6 @@ module github.com/ArtalkJS/Artalk
go 1.20
require (
github.com/aliyun/alibaba-cloud-sdk-go v1.62.218
github.com/allegro/bigcache/v3 v3.1.0
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
@@ -23,8 +22,8 @@ require (
github.com/jeremywohl/flatten v1.0.1
github.com/knadh/koanf v1.5.0
github.com/lionsoul2014/ip2region/binding/golang v0.0.0-20230205110531-05840c74e63c
github.com/microcosm-cc/bluemonday v1.0.22
github.com/nikoksr/notify v0.38.0
github.com/microcosm-cc/bluemonday v1.0.23
github.com/nikoksr/notify v0.38.1
github.com/qwqcode/go-aliyun-email v0.0.0-20180120030821-cb6e7b1382bf
github.com/rhysd/go-github-selfupdate v1.2.3
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
@@ -39,16 +38,16 @@ require (
github.com/x-cray/logrus-prefixed-formatter v0.5.2
github.com/yuin/goldmark v1.5.4
golang.org/x/crypto v0.7.0
golang.org/x/exp v0.0.0-20230306221820-f0f767cdffd6
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0
golang.org/x/sync v0.1.0
golang.org/x/term v0.6.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.4.7
gorm.io/driver/postgres v1.4.8
gorm.io/driver/postgres v1.5.0
gorm.io/driver/sqlite v1.4.4
gorm.io/driver/sqlserver v1.4.2
gorm.io/gorm v1.24.6
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11
)
require (
@@ -62,7 +61,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisenkom/go-mssqldb v0.12.3 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
@@ -74,7 +73,7 @@ require (
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
@@ -88,10 +87,8 @@ require (
github.com/jackc/pgx/v5 v5.3.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/line/line-bot-sdk-go v7.8.0+incompatible // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -104,16 +101,13 @@ require (
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/gomega v1.27.2 // indirect
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
github.com/onsi/gomega v1.27.4 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.41.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect
@@ -130,16 +124,15 @@ require (
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/utahta/go-linenotify v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.44.0 // indirect
github.com/valyala/fasthttp v1.45.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
golang.org/x/image v0.6.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
+27 -48
View File
@@ -21,8 +21,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aliyun/alibaba-cloud-sdk-go v1.62.218 h1:2EEA8rDDzb99mDzcywtSGe24MjfBjPGmb9gWH0pw940=
github.com/aliyun/alibaba-cloud-sdk-go v1.62.218/go.mod h1:Api2AkmMgGaSUAhmk76oaFObkoeCPc/bKAqcyplPODs=
github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk=
github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
@@ -103,8 +101,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -153,7 +151,6 @@ github.com/gofiber/swagger v0.1.9/go.mod h1:IBHyqGmqbfOwbZmt2X5it5m6PfgtB05VjMN3
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
@@ -183,8 +180,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -330,10 +328,7 @@ github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkr
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
@@ -341,19 +336,16 @@ github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY=
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs=
github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -413,8 +405,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/microcosm-cc/bluemonday v1.0.22 h1:p2tT7RNzRdCi0qmwxG+HbqD6ILkmwter1ZwVZn1oTxA=
github.com/microcosm-cc/bluemonday v1.0.22/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM=
github.com/microcosm-cc/bluemonday v1.0.23 h1:SMZe2IGa0NuHvnVNAZ+6B38gsTbi5e4sViiWJyDDqFY=
github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4=
github.com/microsoft/go-mssqldb v0.19.0/go.mod h1:ukJCBnnzLzpVF0qYRT+eg1e+eSwjeQ7IvenUv8QPook=
github.com/microsoft/go-mssqldb v0.20.0 h1:jAfvs5TIR311fEuNgohFzMtUO0IcCHyI1kWAVws4ES8=
github.com/microsoft/go-mssqldb v0.20.0/go.mod h1:ukJCBnnzLzpVF0qYRT+eg1e+eSwjeQ7IvenUv8QPook=
@@ -437,29 +429,24 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nikoksr/notify v0.38.0 h1:moS1iFvqkh7AerMv9fwIGbmHNRr7uH/5x/OvsONlkyE=
github.com/nikoksr/notify v0.38.0/go.mod h1:oV9B/PdWIXqBd2S2azkEmnttOrmcEp+NOC6MryPN7xc=
github.com/nikoksr/notify v0.38.1 h1:+WjA3nUMMhfxKuFFYmTIgDOykdI7GPP3ZWWg3SLuQyo=
github.com/nikoksr/notify v0.38.1/go.mod h1:BA0LnpzG+iBlnxtPnSmV/Ei57wqEtyv9V9IJ+rDlo58=
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.27.2 h1:SKU0CXeKE/WVgIV1T61kSa3+IRE8Ekrv9rdXDwwTqnY=
github.com/onsi/gomega v1.27.2/go.mod h1:5mR3phAHpkAVIDkHEUBY6HGVsU+cpcEscrGPB4oPlZI=
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A=
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU=
github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E=
github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI=
@@ -496,8 +483,8 @@ github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3d
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.41.0 h1:npo01n6vUlRViIj5fgwiK8vlNIh8bnoxqh3gypKsyAw=
github.com/prometheus/common v0.41.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
@@ -591,10 +578,6 @@ github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso
github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=
github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
@@ -603,8 +586,9 @@ github.com/utahta/go-linenotify v0.5.0 h1:E1tJaB/XhqRY/iz203FD0MaHm10DjQPOq5/Mem
github.com/utahta/go-linenotify v0.5.0/go.mod h1:KsvBXil2wx+ByaCR0e+IZKTbp4pDesc7yjzRigLf6pE=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.44.0 h1:R+gLUhldIsfg1HokMuQjdQ5bh9nuXHPIfvkYUu9eR5Q=
github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY=
github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA=
github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
@@ -626,8 +610,6 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
@@ -660,8 +642,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230306221820-f0f767cdffd6 h1:3p+wVC0x0TCIPgd3LCQlpgVlEtjziEC5v42w7+B8t8M=
golang.org/x/exp v0.0.0-20230306221820-f0f767cdffd6/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo=
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.6.0 h1:bR8b5okrPI3g/gyZakLZHeWxAR8Dn5CyxXv1hLH5g/4=
golang.org/x/image v0.6.0/go.mod h1:MXLdDR43H7cDJq5GEGXEVeeNhPgi+YYEQ2pC1byI1x0=
@@ -677,8 +659,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
golang.org/x/net v0.0.0-20171115151908-9dfe39835686/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -826,8 +808,9 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -864,8 +847,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
@@ -881,9 +864,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
@@ -905,17 +885,16 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y=
gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
gorm.io/driver/postgres v1.4.8 h1:NDWizaclb7Q2aupT0jkwK8jx1HVCNzt+PQ8v/VnxviA=
gorm.io/driver/postgres v1.4.8/go.mod h1:O9MruWGNLUBUWVYfWuBClpf3HeGjOoybY0SNmCs3wsw=
gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U=
gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A=
gorm.io/driver/sqlite v1.4.4 h1:gIufGoR0dQzjkyqDyYSCvsYR6fba1Gw5YKDqKeChxFc=
gorm.io/driver/sqlite v1.4.4/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI=
gorm.io/driver/sqlserver v1.4.2 h1:nMtEeKqv2R/vv9FoHUFWfXfP6SskAgRar0TPlZV1stk=
gorm.io/driver/sqlserver v1.4.2/go.mod h1:XHwBuB4Tlh7DqO0x7Ema8dmyWsQW7wi38VQOAFkrbXY=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
gorm.io/gorm v1.24.2/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
gorm.io/gorm v1.24.6 h1:wy98aq9oFEetsc4CAbKD2SoBCdMzsbSIvSUUFJuHi5s=
gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 h1:9qNbmu21nNThCNnF5i2R3kw2aL27U8ZwbzccNjOmW0g=
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
+8 -46
View File
@@ -1,14 +1,9 @@
package anti_spam
import (
"errors"
"fmt"
"strconv"
"github.com/ArtalkJS/Artalk/internal/config"
"github.com/aliyun/alibaba-cloud-sdk-go/services/green"
"github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
"github.com/ArtalkJS/Artalk/internal/cloud/aliyun"
)
type AliyunParams struct {
@@ -24,44 +19,11 @@ type AliyunParams struct {
// @link https://help.aliyun.com/document_detail/70409.html
// @link https://help.aliyun.com/document_detail/107743.html 接入地址
func Aliyun(p AliyunParams) (isPass bool, err error) {
// Prepare Request
if p.Region == "" {
p.Region = "cn-shanghai"
}
client, err := green.NewClientWithAccessKey(p.Region, p.AccessKeyID, p.AccessKeySecret)
if err != nil {
return false, err
}
reqJSON := fmt.Sprintf(`{"scenes":["antispam"],"tasks":[{"content":%s}]}`, strconv.Quote(p.Content))
// Send Request
textScanReq := green.CreateTextScanRequest()
textScanReq.SetContent([]byte(reqJSON))
textScanResp, err := client.TextScan(textScanReq)
if err != nil {
return false, err
}
if textScanResp.GetHttpStatus() != 200 {
return false, errors.New("response got: " + strconv.Itoa(textScanResp.GetHttpStatus()))
}
// Handle Respone
// @link https://help.aliyun.com/document_detail/70439.html
respRaw := textScanResp.GetHttpContentString()
dataRaw := gjson.Get(respRaw, "data.0.results.0.suggestion")
if !dataRaw.Exists() {
return false, errors.New("unexpected JSON: " + respRaw)
}
// Get Result
suggestion := dataRaw.String()
if config.Instance.Debug {
logrus.Info("[阿里云垃圾检测] ", fmt.Sprintf("%d 请求响应 %s\n%s", p.CommentID, suggestion, respRaw))
}
return (suggestion == "pass"), nil
return aliyun.GreenText(aliyun.GreenTextConf{
AccessKeyId: p.AccessKeyID,
AccessKeySecret: p.AccessKeySecret,
Region: p.Region,
Content: p.Content,
DataID: fmt.Sprintf("comment-%d", p.CommentID),
})
}
+116
View File
@@ -0,0 +1,116 @@
package aliyun
import (
"crypto/hmac"
"crypto/md5"
"crypto/sha1"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"sort"
"strconv"
"strings"
"time"
)
type AliyunApiRequestConf struct {
AccessKeyId string
AccessKeySecret string
BaseURL string
Path string
Version string
Data map[string]interface{}
}
func RequestApi(conf AliyunApiRequestConf) ([]byte, error) {
dataJson := jsonEncode(conf.Data)
date := time.Now().UTC().Format(time.RFC1123)
nonce := strconv.FormatInt(time.Now().Unix(), 10)
contentMD5 := md5Base64(dataJson)
headers := map[string]string{
"Accept": "application/json",
"Content-Type": "application/json",
"Content-MD5": contentMD5,
"Date": date,
"x-acs-version": conf.Version,
"x-acs-signature-nonce": nonce,
"x-acs-signature-version": "1.0",
"x-acs-signature-method": "HMAC-SHA1",
}
rawData := strings.Join([]string{
"POST",
"application/json",
contentMD5,
"application/json",
date,
getSignHeaders(headers),
conf.Path,
}, "\n")
headers["Authorization"] = fmt.Sprintf("acs %v:%v", conf.AccessKeyId, hmacSHA1Base64(conf.AccessKeySecret, rawData))
client := &http.Client{}
req, err := http.NewRequest("POST", conf.BaseURL+conf.Path, strings.NewReader(dataJson))
if err != nil {
return nil, err
}
for k, v := range headers {
req.Header.Set(k, v)
}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
buf, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
return buf, nil
}
func getSignHeaders(headers map[string]string) string {
tmp := map[string]string{}
for k, v := range headers {
if strings.HasPrefix(k, "x-acs-") {
tmp[k] = v
}
}
keys := []string{}
for k := range tmp {
keys = append(keys, k)
}
sort.Strings(keys)
var result []string
for _, k := range keys {
result = append(result, k+":"+tmp[k])
}
return strings.Join(result, "\n")
}
func hmacSHA1Base64(key string, data string) string {
h := hmac.New(sha1.New, []byte(key))
h.Write([]byte(data))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
func md5Base64(text string) string {
h := md5.New()
h.Write([]byte(text))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
func jsonEncode(v interface{}) string {
b, _ := json.Marshal(v)
return string(b)
}
+77
View File
@@ -0,0 +1,77 @@
package aliyun
import (
"encoding/json"
"errors"
)
type GreenTextConf struct {
AccessKeyId string
AccessKeySecret string
Region string
Content string
DataID string
}
func GreenText(conf GreenTextConf) (bool, error) {
if conf.Region == "" {
conf.Region = "cn-shanghai"
}
body, err := RequestApi(AliyunApiRequestConf{
AccessKeyId: conf.AccessKeyId,
AccessKeySecret: conf.AccessKeySecret,
BaseURL: "https://green." + conf.Region + ".aliyuncs.com",
Path: "/green/text/scan",
Version: "2018-05-09",
Data: map[string]interface{}{
"scenes": []string{"antispam"},
"tasks": map[string]interface{}{
"dataId": conf.DataID,
"content": conf.Content,
},
},
})
if err != nil {
return false, err
}
var data GreenTextResponse
err = json.Unmarshal(body, &data)
if err != nil {
return false, err
}
if data.Code != 200 {
return false, errors.New(data.Msg)
}
if len(data.Data) < 1 || len(data.Data[0].Results) < 1 {
return false, errors.New("not expected response: " + string(body))
}
return (data.Data[0].Results[0].Suggestion == "pass"), nil
}
type GreenTextResponse struct {
Code int `json:"code"`
Data []struct {
Code int `json:"code"`
Content string `json:"content"`
DataID string `json:"dataId"`
Msg string `json:"msg"`
Results []struct {
Details []struct {
Contexts []struct {
Context string `json:"context"`
} `json:"contexts"`
Label string `json:"label"`
} `json:"details"`
Label string `json:"label"`
Rate float64 `json:"rate"`
Scene string `json:"scene"`
Suggestion string `json:"suggestion"`
} `json:"results"`
TaskID string `json:"taskId"`
} `json:"data"`
Msg string `json:"msg"`
RequestID string `json:"requestId"`
}
+11 -11
View File
@@ -11,11 +11,11 @@
},
"devDependencies": {
"@rollup/plugin-dynamic-import-vars": "2.0.3",
"@types/node": "18.14.6",
"@typescript-eslint/eslint-plugin": "5.54.1",
"@typescript-eslint/parser": "5.54.1",
"autoprefixer": "10.4.13",
"eslint": "8.35.0",
"@types/node": "18.15.3",
"@typescript-eslint/eslint-plugin": "5.55.0",
"@typescript-eslint/parser": "5.55.0",
"autoprefixer": "10.4.14",
"eslint": "8.36.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.7.0",
@@ -24,14 +24,14 @@
"eslint-plugin-import": "2.27.5",
"postcss": "8.4.21",
"prettier": "2.8.4",
"rollup": "3.18.0",
"sass": "1.58.3",
"terser": "5.16.5",
"rollup": "3.19.1",
"sass": "1.59.3",
"terser": "5.16.6",
"typescript": "4.9.5",
"vite": "4.1.4",
"vite": "4.2.0",
"vite-plugin-checker": "0.5.6",
"vite-plugin-dts": "2.0.2",
"vite-tsconfig-paths": "4.0.5"
"vite-plugin-dts": "2.1.0",
"vite-tsconfig-paths": "4.0.7"
},
"browserslist": [
"supports es6 and supports es6-class and supports es6-generators and supports es6-module-dynamic-import and supports es6-module and supports es6-number and supports es6-string-includes"
+2 -2
View File
@@ -19,13 +19,13 @@
"yaml": "^2.2.1"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue": "^4.1.0",
"@vue/tsconfig": "^0.1.3",
"typescript": "^4.9.5",
"unplugin-auto-import": "^0.15.1",
"unplugin-vue-components": "^0.24.1",
"unplugin-vue-router": "^0.5.4",
"vite": "^4.1.4",
"vite": "^4.2.0",
"vue-tsc": "^1.2.0"
}
}
+2 -2
View File
@@ -22,7 +22,7 @@ onBeforeMount(() => {
}
if (bootParams.user?.email) {
global.getArtalk().ctx.user.update(bootParams.user)
global.getArtalk().ctx.get('user').update(bootParams.user)
} else {
try {
global.importUserDataFromArtalkInstance()
@@ -36,7 +36,7 @@ onBeforeMount(() => {
// 验证登陆身份有效性
global.getArtalk().ctx.getApi().user.loginStatus().then(resp => {
if (resp.is_admin && !resp.is_login) {
global.getArtalk().ctx.user.logout()
global.getArtalk().ctx.get('user').logout()
user.logout()
router.replace('/login')
}
+2 -2
View File
@@ -38,9 +38,9 @@ export function createArtalkInstance() {
export function importUserDataFromArtalkInstance() {
if (!artalk) throw Error("the artalk instance is not exist")
if (!artalk.ctx.user.data.email) throw Error("the user data in artalk instance is invalid")
if (!artalk.ctx.get('user').data.email) throw Error("the user data in artalk instance is invalid")
const userData = artalk.ctx.user.data
const userData = artalk.ctx.get('user').data
useUserStore().$patch((state) => {
state.site = '__ATK_SITE_ALL'
state.name = userData.nick
@@ -38,7 +38,7 @@ function login(username?: string) {
username || '', userForm.value.email, userForm.value.password
).then((resp) => {
const user = resp.user
global.getArtalk()!.ctx.user.update({
global.getArtalk()!.ctx.get('user').update({
nick: user.name,
email: user.email,
link: user.link,
+1
View File
@@ -70,6 +70,7 @@
});
window.artalk = artalk;
window.Artalk = Artalk;
;(function () {
const toTopElem = document.querySelector('.to-top')
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artalk",
"version": "2.5.0",
"version": "2.5.1",
"license": "LGPL-3.0",
"description": "A Selfhosted Comment System",
"keywords": [
+1 -1
View File
@@ -13,7 +13,7 @@ fs.rmSync(outDir, { recursive: true, force: true })
const libraries = []
fs.readdirSync(i18nPath).forEach(f => {
if (['index.ts'].includes(f)) return
if (['index.ts', 'external.ts'].includes(f)) return
const filename = path.join(i18nPath, f)
const lang = path.parse(filename).name
+7 -7
View File
@@ -1,6 +1,7 @@
import { CommentData, ListData } from '~/types/artalk-data'
import * as Utils from '../lib/utils'
import ApiBase from './api-base'
import User from '../lib/user'
/**
* 评论 API
@@ -16,9 +17,9 @@ export default class CommentApi extends ApiBase {
}
if (flatMode) params.flat_mode = flatMode // 平铺模式
if (this.ctx.user.checkHasBasicUserInfo()) {
params.name = this.ctx.user.data.nick
params.email = this.ctx.user.data.email
if (User.checkHasBasicUserInfo()) {
params.name = User.data.nick
params.email = User.data.email
}
if (paramsEditor) paramsEditor(params)
@@ -68,14 +69,13 @@ export default class CommentApi extends ApiBase {
/** 投票 */
public async vote(targetID: number, type: string) {
const params: any = {
site_name: this.ctx.conf.site || '',
target_id: targetID,
type,
}
if (this.ctx.user.checkHasBasicUserInfo()) {
params.name = this.ctx.user.data.nick
params.email = this.ctx.user.data.email
if (User.checkHasBasicUserInfo()) {
params.name = User.data.nick
params.email = User.data.email
}
const data = await this.POST<any>('/vote', params)
-2
View File
@@ -55,7 +55,6 @@ export default class PageApi extends ApiBase {
/** PV */
public async pv() {
const params: any = {
site_name: this.ctx.conf.site || '',
page_key: this.ctx.conf.pageKey || '',
page_title: this.ctx.conf.pageTitle || ''
}
@@ -73,7 +72,6 @@ export default class PageApi extends ApiBase {
) {
const params: any = {
type,
site_name: this.ctx.conf.site || '',
}
if (pageKeys) params.page_keys = Array.isArray(pageKeys) ? pageKeys.join(',') : pageKeys
+6 -4
View File
@@ -1,11 +1,13 @@
import Context from '~/types/context'
import User from '../lib/user'
import $t from '../i18n'
/** 公共请求函数 */
export async function Fetch(ctx: Context, input: RequestInfo, init: RequestInit, timeout?: number): Promise<any> {
// JWT
if (ctx.user.data.token) {
if (User.data.token) {
const headers = new Headers(init.headers) // 保留原有 headers
headers.set('Authorization', `Bearer ${ctx.user.data.token}`)
headers.set('Authorization', `Bearer ${User.data.token}`)
init.headers = headers
}
@@ -20,7 +22,7 @@ export async function Fetch(ctx: Context, input: RequestInfo, init: RequestInit,
const isNoAccess = noAccessCodes.includes(respHttpCode)
if (!resp.ok && !isNoAccess)
throw new Error(`${ctx.$t('reqGot')} ${respHttpCode}`)
throw new Error(`${$t('reqGot')} ${respHttpCode}`)
// 解析获取响应的 json
let json: any = await resp.json()
@@ -95,7 +97,7 @@ function timeoutFetch(ctx: Context, url: RequestInfo, ms: number, opts: RequestI
promise.finally(() => { clearTimeout(timer) })
}
promise = promise.catch((err) => {
throw ((err || {}).name === 'AbortError') ? new Error(ctx.$t('reqAborted')) : err
throw ((err || {}).name === 'AbortError') ? new Error($t('reqAborted')) : err
})
return promise
}
+3 -4
View File
@@ -1,5 +1,6 @@
import { ToFormData } from './request'
import ApiBase from './api-base'
import User from '../lib/user'
/**
* 上传 API
@@ -8,13 +9,11 @@ export default class UploadApi extends ApiBase {
/** 图片上传 */
public async imgUpload(file: File) {
const params: any = {
name: this.ctx.user.data.nick,
email: this.ctx.user.data.email,
name: User.data.nick,
email: User.data.email,
page_key: this.ctx.conf.pageKey,
}
if (this.ctx.conf.site) params.site_name = this.ctx.conf.site
const form = ToFormData(params)
form.set('file', file)
+6 -8
View File
@@ -1,6 +1,7 @@
import { UserData, NotifyData, UserDataForAdmin } from '~/types/artalk-data'
import ApiBase from './api-base'
import { ToFormData } from './request'
import User from '../lib/user'
/**
* 用户 API
@@ -12,8 +13,6 @@ export default class UserApi extends ApiBase {
name, email, password
}
if (this.ctx.conf.site) params.site_name = this.ctx.conf.site
const data = await this.POST<any>('/login', params)
return data as { token: string, user: UserData }
}
@@ -22,7 +21,7 @@ export default class UserApi extends ApiBase {
public userGet(name: string, email: string) {
const ctrl = new AbortController()
const params: any = {
name, email, site_name: (this.ctx.conf.site || '')
name, email
}
const req = this.Fetch(`/user-get`, {
@@ -45,8 +44,8 @@ export default class UserApi extends ApiBase {
/** 用户 · 登录状态 */
public async loginStatus() {
const data = await this.POST<any>('/login-status', {
name: this.ctx.user.data.nick,
email: this.ctx.user.data.email
name: User.data.nick,
email: User.data.email
})
return (data || { is_login: false, is_admin: false }) as { is_login: boolean, is_admin: boolean }
}
@@ -59,15 +58,14 @@ export default class UserApi extends ApiBase {
/** 已读标记 */
public markRead(notifyKey: string, readAll = false) {
const params: any = {
site_name: this.ctx.conf.site || '',
notify_key: notifyKey,
}
if (readAll) {
delete params.notify_key
params.read_all = true
params.name = this.ctx.user.data.nick
params.email = this.ctx.user.data.email
params.name = User.data.nick
params.email = User.data.email
}
return this.POST(`/mark-read`, params)
+3 -1
View File
@@ -10,6 +10,7 @@ import { handelBaseConf } from './config'
import Services from './service'
import * as Stat from './lib/stat'
import ListLite from './list/list-lite'
import Api from './api'
/**
* Artalk
@@ -153,7 +154,8 @@ export default class Artalk {
/** Load count widget */
public static loadCountWidget(conf: Partial<ArtalkConfig>) {
const ctx = new ConcreteContext(handelBaseConf(conf))
const ctx: Context = new ConcreteContext(handelBaseConf(conf))
ctx.inject('api', new Api(ctx))
Stat.initCountWidget({ ctx, pvAdd: false })
}
+4 -2
View File
@@ -39,14 +39,16 @@ class Context implements ContextApi {
this.$root = $root || document.createElement('div')
this.$root.classList.add('artalk')
this.$root.innerHTML = ''
this.api = new Api(this)
}
public inject(depName: string, obj: any) {
this[depName] = obj
}
public get(depName: string) {
return this[depName]
}
public getApi() {
return this.api
}
+2 -1
View File
@@ -1,6 +1,7 @@
import type { CommentData } from '~/types/artalk-data'
import * as Utils from '../lib/utils'
import Editor from './editor'
import User from '../lib/user'
export interface EditModeManager {
editor: Editor
@@ -69,7 +70,7 @@ function cancelEdit(m: EditModeManager) {
m.comment = undefined
m.editor.travelBack()
const { nick, email, link } = m.editor.ctx.user.data
const { nick, email, link } = User.data
ui.$nick.value = nick
ui.$email.value = email
ui.$link.value = link
+2 -1
View File
@@ -4,6 +4,7 @@ import Component from '../lib/component'
import * as Utils from '../lib/utils'
import * as Ui from '../lib/ui'
import marked from '../lib/marked'
import User from '../lib/user'
import initEditorFuncs from './funcs'
import { render, EditorUI } from './ui'
import { PlugManager } from './plug-manager'
@@ -178,7 +179,7 @@ export default class Editor extends Component {
if (!this.ui.$textareaWrap.querySelector('.atk-comment-closed'))
this.ui.$textareaWrap.prepend(Utils.createElement(`<div class="atk-comment-closed">${this.$t('onlyAdminCanReply')}</div>`))
if (!this.ctx.user.data.isAdmin) {
if (!User.data.isAdmin) {
this.ui.$textarea.style.display = 'none'
this.closePlugPanel()
this.ui.$bottom.style.display = 'none'
+3 -2
View File
@@ -1,4 +1,5 @@
import Editor from './editor'
import User from '../lib/user'
import { createMover } from './mover'
import { createPlugManager } from './plug-manager'
import { createReplyManager } from './reply'
@@ -31,7 +32,7 @@ function localStorage(editor: Editor) {
function header(editor: Editor) {
const $inputs = editor.getHeaderInputEls()
Object.entries($inputs).forEach(([key, $input]) => {
$input.value = editor.ctx.user.data[key] || ''
$input.value = User.data[key] || ''
$input.addEventListener('input', () => onHeaderInput(editor, key, $input))
// 设置 Placeholder
@@ -42,7 +43,7 @@ function header(editor: Editor) {
function onHeaderInput(editor: Editor, field: string, $input: HTMLInputElement) {
if (editor.isEditMode) return // 评论编辑模式,不修改个人信息
editor.ctx.user.update({
User.update({
[field]: $input.value.trim()
})
@@ -1,4 +1,5 @@
import Editor from '../editor'
import User from '../../lib/user'
import EditorPlug from './editor-plug'
export default class HeaderInputPlug extends EditorPlug {
@@ -18,7 +19,7 @@ export default class HeaderInputPlug extends EditorPlug {
const link = this.editor.getUI().$link.value.trim()
if (!!link && !/^(http|https):\/\//.test(link)) {
this.editor.getUI().$link.value = `https://${link}`
this.ctx.user.update({ link: this.editor.getUI().$link.value })
User.update({ link: this.editor.getUI().$link.value })
}
})
}
@@ -30,7 +31,7 @@ export default class HeaderInputPlug extends EditorPlug {
/** 远程获取用户数据 */
fetchUserInfo() {
this.ctx.user.logout()
User.logout()
// 获取用户信息
if (this.queryUserInfo.timeout) window.clearTimeout(this.queryUserInfo.timeout) // 清除待发出的请求
@@ -40,26 +41,26 @@ export default class HeaderInputPlug extends EditorPlug {
this.queryUserInfo.timeout = null // 清理
const {req, abort} = this.ctx.getApi().user.userGet(
this.ctx.user.data.nick, this.ctx.user.data.email
User.data.nick, User.data.email
)
this.queryUserInfo.abortFunc = abort
req.then(data => {
if (!data.is_login) {
this.ctx.user.logout()
User.logout()
}
// 未读消息更新
this.ctx.updateNotifies(data.unread)
// 若用户为管理员,执行登陆操作
if (this.ctx.user.checkHasBasicUserInfo() && !data.is_login && data.user?.is_admin) {
if (User.checkHasBasicUserInfo() && !data.is_login && data.user?.is_admin) {
this.showLoginDialog()
}
// 自动填入 link
if (data.user && data.user.link) {
this.editor.getUI().$link.value = data.user.link
this.ctx.user.update({ link: data.user.link })
User.update({ link: data.user.link })
}
})
.catch(() => {})
@@ -1,5 +1,6 @@
import * as Utils from '@/lib/utils'
import Editor from '../editor'
import User from '../../lib/user'
import EditorPlug from './editor-plug'
export default class UploadPlug extends EditorPlug {
@@ -78,7 +79,7 @@ export default class UploadPlug extends EditorPlug {
if (!fileExt || !this.allowImgExts.includes(fileExt[0])) return
// 未登录提示
if (!this.ctx.user.checkHasBasicUserInfo()) {
if (!User.checkHasBasicUserInfo()) {
this.editor.showNotify(this.ctx.$t('uploadLoginMsg'), 'w')
return
}
+2 -1
View File
@@ -1,5 +1,6 @@
import type { CommentData } from '~/types/artalk-data'
import Editor from './editor'
import User from '../lib/user'
export interface SubmitManager {
editor: Editor
@@ -65,7 +66,7 @@ interface CustomSubmit {
// ================== Submit Add =======================
function getSubmitAddParams(m: SubmitManager) {
const { nick, email, link } = m.editor.ctx.user.data
const { nick, email, link } = User.data
const conf = m.editor.ctx.conf
const reply = m.editor.getReplyManager()?.comment
+10
View File
@@ -0,0 +1,10 @@
import type { I18n } from '.'
export const GLOBAL_LOCALES_KEY = "ArtalkI18n"
export function defineLocaleExternal(lang: string, locale: I18n, aliases?: string[]) {
if (!window[GLOBAL_LOCALES_KEY]) window[GLOBAL_LOCALES_KEY] = {}
window[GLOBAL_LOCALES_KEY][lang] = locale
if (aliases) aliases.forEach(l => { window[GLOBAL_LOCALES_KEY][l] = locale })
return locale
}
+1 -9
View File
@@ -1,5 +1,6 @@
import en from './en'
import zhCN from './zh-CN'
import { GLOBAL_LOCALES_KEY } from './external'
export type I18n = typeof en
export type I18nKeys = keyof I18n
@@ -13,15 +14,6 @@ export const internal = {
'zh-CN': zhCN,
}
const GLOBAL_LOCALES_KEY = "ArtalkI18n";
export function defineLocaleExternal(lang: string, locale: I18n, aliases?: string[]) {
if (!window[GLOBAL_LOCALES_KEY]) window[GLOBAL_LOCALES_KEY] = {}
window[GLOBAL_LOCALES_KEY][lang] = locale
if (aliases) aliases.forEach(l => { window[GLOBAL_LOCALES_KEY][l] = locale })
return locale
}
/**
* find a locale object by language name
*/
+1 -1
View File
@@ -1,4 +1,4 @@
import { defineLocaleExternal } from '.'
import { defineLocaleExternal } from './external'
export default defineLocaleExternal('jp', {
/* エディタ */
+1 -1
View File
@@ -1,4 +1,4 @@
import { defineLocaleExternal } from '.'
import { defineLocaleExternal } from './external'
export default defineLocaleExternal('zh-TW', {
/* Editor */
@@ -3,6 +3,7 @@ import Component from '@/lib/component'
import * as Utils from '@/lib/utils'
import * as Ui from '@/lib/ui'
import SidebarHTML from './sidebar-layer.html?raw'
import User from '../lib/user'
import Layer from './layer'
export interface SidebarShowPayload {
@@ -83,7 +84,7 @@ export default class SidebarLayer extends Component {
const query: any = {
pageKey: this.conf.pageKey,
site: this.conf.site || '',
user: JSON.stringify(this.ctx.user.data),
user: JSON.stringify(User.data),
time: +new Date()
}
+5 -4
View File
@@ -1,4 +1,5 @@
import * as Utils from '../utils'
import User from '../user'
import { Checker } from '.'
const AdminChecker: Checker = {
@@ -6,8 +7,8 @@ const AdminChecker: Checker = {
request(checker, inputVal) {
const data = {
name: checker.getUser().data.nick,
email: checker.getUser().data.email,
name: User.data.nick,
email: User.data.email,
password: inputVal
}
@@ -22,11 +23,11 @@ const AdminChecker: Checker = {
},
onSuccess(checker, userToken, inputVal, formEl) {
checker.getUser().update({
User.update({
isAdmin: true,
token: userToken
})
checker.getCtx().trigger('user-changed', checker.getUser().data)
checker.getCtx().trigger('user-changed', User.data)
checker.getCtx().listReload()
},
@@ -57,7 +57,6 @@ export default class CheckerLauncher {
get: (key) => (checkerStore[key]),
getCtx: () => (this.ctx),
getApi: () => (this.ctx.getApi()),
getUser: () => (this.ctx.user),
getLayer: () => layer,
hideInteractInput: () => {
hideInteractInput = true
@@ -191,7 +190,6 @@ export interface CheckerCtx {
set<K extends keyof CheckerStore>(key: K, val: CheckerStore[K]): void
getCtx(): Context
getApi(): Api
getUser(): User
getLayer(): Layer
hideInteractInput(): void
triggerSuccess(): void
+13 -7
View File
@@ -1,13 +1,11 @@
import ArtalkConfig, { LocalUser } from "~/types/artalk-config"
import { LocalUser } from "~/types/artalk-config"
import Context from '~/types/context'
export default class User {
public ctx: Context
class User {
public ctx?: Context
public data: LocalUser
public constructor(ctx: Context) {
this.ctx = ctx
public constructor() {
// 从 localStorage 导入
const localUser = JSON.parse(window.localStorage.getItem('ArtalkUser') || '{}')
this.data = {
@@ -19,6 +17,10 @@ export default class User {
}
}
public setContext(ctx: Context) {
this.ctx = ctx
}
/** 保存用户到 localStorage 中 */
public update(obj: Partial<LocalUser> = {}) {
Object.entries(obj).forEach(([key, value]) => {
@@ -26,7 +28,7 @@ export default class User {
})
window.localStorage.setItem('ArtalkUser', JSON.stringify(this.data))
this.ctx.trigger('user-changed', this.ctx.user.data)
this.ctx?.trigger('user-changed', this.data)
}
/** 注销,清除用户登录状态 */
@@ -42,3 +44,7 @@ export default class User {
return !!this.data.nick && !!this.data.email
}
}
const UserInstance = new User()
export default UserInstance
+59 -2
View File
@@ -1,6 +1,7 @@
import ListLite from './list-lite'
import * as Utils from '../lib/utils'
import * as Ui from '../lib/ui'
import User from '../lib/user'
import $t from '../i18n'
/** 界面刷新 */
@@ -33,7 +34,7 @@ export function renderErrorDialog(list: ListLite, errMsg: string, errData?: any)
const adminBtn = Utils.createElement('<span atk-only-admin-show> | <span style="cursor:pointer;">打开控制台</span></span>')
errEl.appendChild(adminBtn)
if (!list.ctx.user.data.isAdmin) adminBtn.classList.add('atk-hide')
if (!User.data.isAdmin) adminBtn.classList.add('atk-hide')
let sidebarView = ''
@@ -43,7 +44,6 @@ export function renderErrorDialog(list: ListLite, errMsg: string, errData?: any)
create_name: list.ctx.conf.site,
create_urls: `${window.location.protocol}//${window.location.host}`
}
// TODO 真的是飞鸽传书啊
sidebarView = `sites|${JSON.stringify(viewLoadParam)}`
}
@@ -78,3 +78,60 @@ export function versionCheckDialog(list: ListLite, feVer: string, beVer: string)
return false
}
/** 评论排序方式选择下拉菜单 */
export function renderDropdown(conf: {
$dropdownWrap: HTMLElement,
dropdownList: [string, () => void][]
}) {
const { $dropdownWrap, dropdownList } = conf
if ($dropdownWrap.querySelector('.atk-dropdown')) return
// 修改 class
$dropdownWrap.classList.add('atk-dropdown-wrap')
// 插入图标
$dropdownWrap.append(Utils.createElement(`<span class="atk-arrow-down-icon"></span>`))
// 列表项点击事件
let curtActive = 0 // 当前选中
const onItemClick = (i: number, $item: HTMLElement, name: string, action: Function) => {
action()
// set active
curtActive = i
$dropdown.querySelectorAll('.active').forEach((e) => { e.classList.remove('active') })
$item.classList.add('active')
// 关闭层 (临时消失,取消 :hover)
$dropdown.style.display = 'none'
setTimeout(() => { $dropdown.style.display = '' }, 80)
}
// 生成列表元素
const $dropdown = Utils.createElement(`<ul class="atk-dropdown atk-fade-in"></ul>`)
dropdownList.forEach((item, i) => {
const name = item[0] as string
const action = item[1] as Function
const $item = Utils.createElement(`<li class="atk-dropdown-item"><span></span></li>`)
const $link = $item.querySelector<HTMLElement>('span')!
$link.innerText = name
$link.onclick = () => { onItemClick(i, $item, name, action) }
$dropdown.append($item)
if (i === curtActive) $item.classList.add('active') // 默认选中项
})
$dropdownWrap.append($dropdown)
}
/** 删除评论排序方式选择下拉菜单 */
export function removeDropdown(conf: {
$dropdownWrap: HTMLElement
}) {
const { $dropdownWrap } = conf
$dropdownWrap.classList.remove('atk-dropdown-wrap')
$dropdownWrap.querySelector('.atk-arrow-down-icon')?.remove()
$dropdownWrap.querySelector('.atk-dropdown')?.remove()
}
+17 -52
View File
@@ -3,8 +3,10 @@ import Context from '~/types/context'
import { version as ARTALK_VERSION } from '../../package.json'
import * as Utils from '../lib/utils'
import * as Ui from '../lib/ui'
import User from '../lib/user'
import ListHTML from './list.html?raw'
import ListLite from './list-lite'
import * as ListUi from './list-ui'
export default class List extends ListLite {
private $closeCommentBtn!: HTMLElement
@@ -77,14 +79,14 @@ export default class List extends ListLite {
this.$commentCountNum.innerText = String(Number(this.data?.total) || 0)
// 已输入个人信息
if (!!this.ctx.user.data.nick && !!this.ctx.user.data.email) {
if (!!User.data.nick && !!User.data.email) {
this.$openSidebarBtn.classList.remove('atk-hide')
} else {
this.$openSidebarBtn.classList.add('atk-hide')
}
this.$openSidebarBtn.querySelector<HTMLElement>('.atk-text')!
.innerText = (!this.ctx.user.data.isAdmin) ? this.$t('msgCenter') : this.$t('ctrlCenter')
.innerText = (!User.data.isAdmin) ? this.$t('msgCenter') : this.$t('ctrlCenter')
// 关闭评论
if (!!this.data && !!this.data.page && this.data.page.admin_only === true) {
@@ -98,6 +100,10 @@ export default class List extends ListLite {
// 评论列表排序 Dropdown 下拉选择层
if (this.ctx.conf.listSort) {
this.initDropdown()
} else {
ListUi.removeDropdown({
$dropdownWrap: this.$commentCount
})
}
}
@@ -192,63 +198,22 @@ export default class List extends ListLite {
}
}
private dropdownLoaded = false
/** 初始化选择下拉层 */
protected initDropdown() {
if (this.dropdownLoaded) return
this.dropdownLoaded = true
this.$dropdownWrap = this.$commentCount
this.$commentCount.classList.add('atk-dropdown-wrap')
// 插入图标
this.$dropdownWrap.append(Utils.createElement(`<span class="atk-arrow-down-icon"></span>`))
const reloadUseParamsEditor = (func: (p: any) => void) => {
this.paramsEditor = (p) => { func(p) }
this.paramsEditor = func
this.fetchComments(0)
}
// 下拉列表
const dropdownList = [
[this.$t('sortLatest'), () => { reloadUseParamsEditor(p => { p.sort_by = 'date_desc' }) }],
[this.$t('sortBest'), () => { reloadUseParamsEditor(p => { p.sort_by = 'vote' }) }],
[this.$t('sortOldest'), () => { reloadUseParamsEditor(p => { p.sort_by = 'date_asc' }) }],
[this.$t('sortAuthor'), () => { reloadUseParamsEditor(p => { p.view_only_admin = true }) }],
]
// 列表项点击事件
let curtActive = 0 // 当前选中
const onItemClick = (i: number, $item: HTMLElement, name: string, action: Function) => {
action()
// set active
curtActive = i
$dropdown.querySelectorAll('.active').forEach((e) => { e.classList.remove('active') })
$item.classList.add('active')
// 关闭层 (临时消失,取消 :hover)
$dropdown.style.display = 'none'
setTimeout(() => { $dropdown.style.display = '' }, 80)
}
// 生成列表元素
const $dropdown = Utils.createElement(`<ul class="atk-dropdown atk-fade-in"></ul>`)
dropdownList.forEach((item, i) => {
const name = item[0] as string
const action = item[1] as Function
const $item = Utils.createElement(`<li class="atk-dropdown-item"><span></span></li>`)
const $link = $item.querySelector<HTMLElement>('span')!
$link.innerText = name
$link.onclick = () => { onItemClick(i, $item, name, action) }
$dropdown.append($item)
if (i === curtActive) $item.classList.add('active') // 默认选中项
ListUi.renderDropdown({
$dropdownWrap: this.$commentCount,
dropdownList: [
[this.$t('sortLatest'), () => { reloadUseParamsEditor(p => { p.sort_by = 'date_desc' }) }],
[this.$t('sortBest'), () => { reloadUseParamsEditor(p => { p.sort_by = 'vote' }) }],
[this.$t('sortOldest'), () => { reloadUseParamsEditor(p => { p.sort_by = 'date_asc' }) }],
[this.$t('sortAuthor'), () => { reloadUseParamsEditor(p => { p.view_only_admin = true }) }],
]
})
this.$dropdownWrap.append($dropdown)
}
public updateUnread(notifies: NotifyData[]): void {
@@ -37,8 +37,9 @@ export default class PgHolder {
}
public showErr(msg: string) {
const func = this.getAdaptor().showErr
if (func) func(msg)
const that = this.getAdaptor()
const func = that.showErr
if (func) func.bind(that)(msg)
}
public setMode(val: TPgMode) {
+2 -2
View File
@@ -35,8 +35,8 @@ const services = {
// User Store
user(ctx: Context) {
const user = new User(ctx)
return user
User.setContext(ctx)
return User
},
// HTTP API client
+4 -4
View File
@@ -177,6 +177,10 @@
padding-bottom: 10px;
}
&.atk-err .atk-text {
color: var(--at-color-red) !important;
}
.atk-list-read-more-inner {
cursor: pointer;
user-select: none;
@@ -195,10 +199,6 @@
background: var(--at-color-bg);
border-color: var(--at-color-border);
&.atk-err > .atk-text {
color: var(--at-color-red) !important;
}
& > .atk-loading-icon {
height: 15px;
width: 15px;
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="count" data-page-key="https://artalk.js.org/guide/intro.html">0</div>
<script>
var artalk = Artalk.LoadCountWidget({
var artalk = Artalk.loadCountWidget({
server: 'http://localhost:23366',
site: 'ArtalkDocs',
pvEl: '.pv',
+3 -4
View File
@@ -22,14 +22,13 @@ export default interface ContextApi {
/** 依赖注入函数 */
inject<K extends keyof TInjectedServices>(depName: K, obj: TInjectedServices[K]): void
/** 获取依赖对象 */
get<K extends keyof TInjectedServices>(depName: K): TInjectedServices[K]
/** 配置对象 */
// TODO 修改为 getConf() 和 setConf()
conf: ArtalkConfig
/** 用户对象 */
// TODO 修改为 getUser()
user: User
/** marked 依赖对象 */
getMarkedInstance(): TMarked | undefined
+321 -303
View File
File diff suppressed because it is too large. Load diff