mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🐛 fix(ds): 解决一些依赖问题
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
// Node
|
||||
import { stringify } from "querystring";
|
||||
import qs from "qs";
|
||||
// Tauri.Genshin
|
||||
import { md5 } from "./tools";
|
||||
import { MD5 } from "./tools";
|
||||
import TGConstant from "../constant/TGConstant";
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ export function getDS (query: string, body: string): string {
|
||||
b: body,
|
||||
q: query,
|
||||
};
|
||||
const md5Str = md5(stringify(params));
|
||||
const md5Str = MD5(qs.stringify(params));
|
||||
const ds = `${params.t},${params.r},${md5Str}`;
|
||||
return ds;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
import crypto from "crypto";
|
||||
import md5 from "js-md5";
|
||||
|
||||
/**
|
||||
* @description 转义正则表达式
|
||||
@@ -47,6 +47,6 @@ export function getRandomString (length: number): string {
|
||||
* @param {string} data 要加密的内容
|
||||
* @returns {string} 加密后的内容
|
||||
*/
|
||||
export function md5 (data: string): string {
|
||||
return crypto.createHash("md5").update(data).digest("hex");
|
||||
export function MD5 (data: string): string {
|
||||
return md5.update(data).hex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user