fix: dependency eval

This commit is contained in:
DIYgod
2020-05-24 17:43:07 +08:00
parent 0598ecf16d
commit 3cb392065f
4 changed files with 4 additions and 9 deletions
+1
View File
@@ -64,6 +64,7 @@
"dependencies": {
"clipboard": "2.0.6",
"element-ui": "2.13.2",
"md5.js": "^1.3.5",
"psl": "1.8.0",
"route-recognizer": "0.3.4",
"rss-parser": "3.8.0",
-6
View File
@@ -1,5 +1,3 @@
import crypto from 'crypto';
export function secondToTime(second) {
const hour = Math.floor(second / 3600);
const min = Math.floor((second - hour * 3600) / 60);
@@ -32,7 +30,3 @@ export function commandSandbox(command, data, callback) {
};
returnResults.push(myReturn);
}
export function md5(data) {
return crypto.createHash('md5').update(data).digest('hex');
}
+2 -2
View File
@@ -3,7 +3,7 @@ import ClipboardJS from 'clipboard';
import { getConfig } from '../common/config';
import settingIcon from '../../svg/setting.svg';
import aboutIcon from '../../svg/about.svg';
import { md5 } from '../common/utils.js';
import MD5 from 'md5.js';
let config;
function generateList(type, list) {
@@ -15,7 +15,7 @@ function generateList(type, list) {
type !== 'page-rsshub' || !config.rsshubAccessControl.enabled
? replaced_url
: config.rsshubAccessControl.useCode
? `${replaced_url}?code=${md5(item.path + config.rsshubAccessControl.accessKey)}`
? `${replaced_url}?code=${new MD5().update(item.path + config.rsshubAccessControl.accessKey).digest('hex')}`
: `${replaced_url}?key=${config.rsshubAccessControl.accessKey}`
);
result += `
+1 -1
View File
@@ -4110,7 +4110,7 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
md5.js@^1.3.4:
md5.js@^1.3.4, md5.js@^1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==