Skip to content

Commit

Permalink
fix: pid/rid/spam field when importing artrans
Browse files Browse the repository at this point in the history
  • Loading branch information
imaegoo committed Apr 10, 2023
1 parent 86dbf3a commit f67aa0c
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/.vuepress/theme/layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<!-- Twikoo -->
<div id="twikoo"></div>
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected].14/dist/twikoo.all.min.js" ref="twikooJs"></component>
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/[email protected].15/dist/twikoo.all.min.js" ref="twikooJs"></component>
</div>
</template>
</ParentLayout>
Expand Down
12 changes: 6 additions & 6 deletions docs/en/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exports.main = require('twikoo-func').main
8. 创建完成后,点击“twikoo"进入云函数详情页,进入“函数代码”标签,点击“文件 - 新建文件”,输入 `package.json`,回车
9. 复制以下代码、粘贴到代码框中,点击“保存并安装依赖”
``` json
{ "dependencies": { "twikoo-func": "1.6.14" } }
{ "dependencies": { "twikoo-func": "1.6.15" } }
```

### 命令行部署
Expand Down Expand Up @@ -248,7 +248,7 @@ twikoo:

``` html
<div id="tcomment"></div>
<script src="https://cdn.staticfile.org/twikoo/1.6.14/twikoo.all.min.js"></script>
<script src="https://cdn.staticfile.org/twikoo/1.6.15/twikoo.all.min.js"></script>
<script>
twikoo.init({
envId: '您的环境id', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
Expand All @@ -266,10 +266,10 @@ twikoo.init({

如果遇到默认 CDN 加载速度缓慢,可更换其他 CDN 镜像。以下为可供选择的公共 CDN,其中一些 CDN 可能需要数天时间同步最新版本:

* `https://cdn.staticfile.org/twikoo/1.6.14/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.14/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.14/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/[email protected].14/dist/twikoo.all.min.js`
* `https://cdn.staticfile.org/twikoo/1.6.15/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.15/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.15/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/[email protected].15/dist/twikoo.all.min.js`

## 开启管理面板(腾讯云环境)

Expand Down
12 changes: 6 additions & 6 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports.main = require('twikoo-func').main
8. 创建完成后,点击“twikoo"进入云函数详情页,进入“函数代码”标签,点击“文件 - 新建文件”,输入 `package.json`,回车
9. 复制以下代码、粘贴到代码框中,点击“保存并安装依赖”
``` json
{ "dependencies": { "twikoo-func": "1.6.14" } }
{ "dependencies": { "twikoo-func": "1.6.15" } }
```

### 命令行部署
Expand Down Expand Up @@ -244,7 +244,7 @@ twikoo:

``` html
<div id="tcomment"></div>
<script src="https://cdn.staticfile.org/twikoo/1.6.14/twikoo.all.min.js"></script>
<script src="https://cdn.staticfile.org/twikoo/1.6.15/twikoo.all.min.js"></script>
<script>
twikoo.init({
envId: '您的环境id', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
Expand All @@ -262,10 +262,10 @@ twikoo.init({

如果遇到默认 CDN 加载速度缓慢,可更换其他 CDN 镜像。以下为可供选择的公共 CDN,其中一些 CDN 可能需要数天时间同步最新版本:

* `https://cdn.staticfile.org/twikoo/1.6.14/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.14/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.14/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/[email protected].14/dist/twikoo.all.min.js`
* `https://cdn.staticfile.org/twikoo/1.6.15/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.15/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.15/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/[email protected].15/dist/twikoo.all.min.js`

## 开启管理面板(腾讯云环境)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo",
"version": "1.6.14",
"version": "1.6.15",
"description": "A simple comment system.",
"keywords": [
"twikoojs",
Expand Down
2 changes: 1 addition & 1 deletion src/client/version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const version = '1.6.14'
const version = '1.6.15'

export { version }
4 changes: 2 additions & 2 deletions src/client/view/components/TkAdminExport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export default {
collection
})
if (result.result.data) {
this.downloadJson(`${collection}.json`, result.result.data)
this.downloadJson(`twikoo-${collection}.json`, result.result.data)
}
} finally {
this.loading = false
}
},
downloadJson (fileName, json) {
const jsonStr = (json instanceof Object) ? JSON.stringify(json) : json
const jsonStr = (json instanceof Object) ? JSON.stringify(json, null, 2) : json
const url = window.URL || window.webkitURL || window
const blob = new Blob([jsonStr])
const saveLink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
Expand Down
2 changes: 1 addition & 1 deletion src/server/function/twikoo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo-func",
"version": "1.6.14",
"version": "1.6.15",
"description": "A simple comment system.",
"author": "imaegoo <[email protected]> (https://github.com/imaegoo)",
"license": "MIT",
Expand Down
14 changes: 7 additions & 7 deletions src/server/function/twikoo/utils/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ const fn = {
ip: '',
isSpam: post.isSpam[0] === 'true' || post.isDeleted[0] === 'true',
master: false,
pid: parent ? parent.$['dsq:id'] : null,
rid: root ? root.$['dsq:id'] : null,
pid: parent ? parent.$['dsq:id'] : undefined,
rid: root ? root.$['dsq:id'] : undefined,
created: new Date(post.createdAt[0]).getTime(),
updated: Date.now()
})
Expand Down Expand Up @@ -157,8 +157,8 @@ const fn = {
isSpam: false,
ua: comment.ua || '',
link: comment.link,
pid: comment.rid ? `artalk${comment.rid}` : '',
rid: comment.rid ? `artalk${comment.rid}` : '',
pid: comment.rid && comment.rid !== '0' ? `artalk${comment.rid}` : undefined,
rid: comment.rid && comment.rid !== '0' ? `artalk${comment.rid}` : undefined,
master: false,
comment: DOMPurify.sanitize(marked.marked(comment.content)),
url: getRelativeUrl(comment.page_key),
Expand Down Expand Up @@ -201,11 +201,11 @@ const fn = {
ip: comment.ip,
mail: comment.email,
mailMd5: md5(comment.email),
isSpam: comment.is_pending,
isSpam: comment.is_pending === 'true',
ua: comment.ua || '',
link: comment.link,
pid: comment.rid ? `artalk${comment.rid}` : '',
rid: comment.rid ? `artalk${comment.rid}` : '',
pid: comment.rid && comment.rid !== '0' ? `artalk${comment.rid}` : undefined,
rid: comment.rid && comment.rid !== '0' ? `artalk${comment.rid}` : undefined,
master: false,
comment: DOMPurify.sanitize(marked.marked(comment.content)),
url: getRelativeUrl(comment.page_key),
Expand Down
4 changes: 2 additions & 2 deletions src/server/self-hosted/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tkserver",
"version": "1.6.14",
"version": "1.6.15",
"description": "A simple comment system.",
"keywords": [
"twikoo",
Expand Down Expand Up @@ -31,7 +31,7 @@
"get-user-ip": "^1.0.1",
"lokijs": "^1.5.12",
"mongodb": "^3.6.3",
"twikoo-func": "1.6.14",
"twikoo-func": "1.6.15",
"uuid": "^8.3.2"
}
}
2 changes: 1 addition & 1 deletion src/server/vercel-min/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "dependencies": { "twikoo-vercel": "1.6.14" } }
{ "dependencies": { "twikoo-vercel": "1.6.15" } }
4 changes: 2 additions & 2 deletions src/server/vercel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo-vercel",
"version": "1.6.14",
"version": "1.6.15",
"description": "A simple comment system.",
"author": "imaegoo <[email protected]> (https://github.com/imaegoo)",
"license": "MIT",
Expand All @@ -13,7 +13,7 @@
"dependencies": {
"get-user-ip": "^1.0.1",
"mongodb": "^3.6.3",
"twikoo-func": "1.6.14",
"twikoo-func": "1.6.15",
"uuid": "^8.3.2"
}
}

0 comments on commit f67aa0c

Please sign in to comment.