forked from twikoojs/twikoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(0.3.1): 头像获取优化,修复 bug (twikoojs#51)
* 新增 支持自定义头像CDN twikoojs#16 * 新增 支持访客使用QQ头像作为评论头像 twikoojs#45 * 修复 邮件中的链接 URL #hash 不正确 twikoojs#48 * 重构 引入 eslint 代码检查,并优化代码
- Loading branch information
Showing
23 changed files
with
188 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.md | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true | ||
es2021: true, | ||
node: true | ||
}, | ||
extends: [ | ||
'plugin:vue/essential', | ||
'standard' | ||
], | ||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly' | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 11, | ||
ecmaVersion: 12, | ||
sourceType: 'module' | ||
}, | ||
plugins: [ | ||
'vue' | ||
], | ||
rules: { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<template #page-bottom> | ||
<div class="page-edit"> | ||
<div id="twikoo"></div> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/dist/twikoo.all.min.js" ref="twikooJs"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/twikoo.all.min.js" ref="twikooJs"></script> | ||
</div> | ||
</template> | ||
</ParentLayout> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ Butterfly 目前支持 Twikoo,请查看 [Butterfly 安裝文檔(四) 主題配 | |
|
||
``` html | ||
<div id="tcomment"></div> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/dist/twikoo.all.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/twikoo.all.min.js"></script> | ||
<script>twikoo.init({ envId: '您的环境id', el: '#tcomment' })</script> | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "twikoo", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A simple comment system based on Tencent CloudBase (tcb).", | ||
"author": "imaegoo <[email protected]> (https://github.com/imaegoo)", | ||
"license": "MIT", | ||
|
@@ -16,31 +16,32 @@ | |
"scripts": { | ||
"dev": "webpack-dev-server", | ||
"serve": "webpack-dev-server", | ||
"build": "webpack", | ||
"build": "webpack --mode production", | ||
"analyze": "webpack --profile --json > stats.json && webpack-bundle-analyzer stats.json", | ||
"login": "tcb login", | ||
"logout": "tcb logout", | ||
"deploy": "tcb fn deploy twikoo --force", | ||
"lint": "eslint", | ||
"lint": "eslint src/** --ignore-path .eslintignore", | ||
"docs:dev": "vuepress dev docs", | ||
"docs:build": "vuepress build docs" | ||
}, | ||
"devDependencies": { | ||
"@cloudbase/cli": "^1.0.7", | ||
"copy-webpack-plugin": "^6.3.2", | ||
"copy-webpack-plugin": "^6.4.0", | ||
"css-loader": "^3.6.0", | ||
"eslint": "^7.13.0", | ||
"eslint": "^7.15.0", | ||
"eslint-config-standard": "^16.0.2", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.1.0", | ||
"eslint-plugin-vue": "^7.2.0", | ||
"svg-inline-loader": "^0.8.2", | ||
"vue-loader": "^15.9.5", | ||
"vue-template-compiler": "^2.6.12", | ||
"vuepress": "^1.7.1", | ||
"webpack": "^4.44.1", | ||
"webpack-bundle-analyzer": "^4.1.0", | ||
"webpack-bundle-analyzer": "^4.2.0", | ||
"webpack-cli": "^3.3.12", | ||
"webpack-dev-server": "^3.11.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function isQQ (mail) { | ||
return /^[1-9][0-9]{4,10}$/.test(mail) || | ||
/^[1-9][0-9]{4,10}@qq.com$/.test(mail) | ||
} | ||
|
||
function getQQAvatar (qq) { | ||
const qqNum = qq.replace(/@qq.com/g, '') | ||
return `https://thirdqq.qlogo.cn/g?b=sdk&nk=${qqNum}&s=140` | ||
} | ||
|
||
export { | ||
isQQ, | ||
getQQAvatar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.