From dcf5e05e910511c2c178e5854318b5692b61d041 Mon Sep 17 00:00:00 2001 From: al Date: Mon, 22 Jul 2024 16:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/bill/[type]/page.jsx | 3 --- app/my/relationship/page.js | 3 --- app/space/person_space_introduce/[mid]/page.js | 1 - components/Photos/index.js | 4 ++-- components/PostItem/index.js | 8 ++++---- utils/baseRequest.js | 2 +- utils/crypto.js | 4 ++-- utils/requireAPI.js | 4 ++-- utils/storeInfo.js | 2 +- 9 files changed, 12 insertions(+), 19 deletions(-) diff --git a/app/bill/[type]/page.jsx b/app/bill/[type]/page.jsx index 8970726..422cdf7 100644 --- a/app/bill/[type]/page.jsx +++ b/app/bill/[type]/page.jsx @@ -1,9 +1,6 @@ "use client"; import React, { useState, useEffect } from "react"; -import { Toast } from "antd-mobile"; -import { generateSignature } from "@/utils/crypto"; -import webviewBaseRequest from "@/utils/webviewBaseRequest"; import Link from "next/link"; export default function BillDetail({ params }) { diff --git a/app/my/relationship/page.js b/app/my/relationship/page.js index d02d46d..742ef44 100644 --- a/app/my/relationship/page.js +++ b/app/my/relationship/page.js @@ -14,11 +14,8 @@ import { useRouter } from "next/navigation"; import { useSearchParams, usePathname, useParams } from "next/navigation"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; -import Empty from "@/components/Empty"; import styles from "./index.module.scss"; import { handleFollow } from "@/api/public"; -import webviewBaseRequest from "@/utils/webviewBaseRequest"; -import { generateSignature } from "@/utils/crypto"; import requireAPI from "@/utils/requireAPI"; import InfiniteScrollContent from "@/components/InfiniteScrollContent"; export default function Relationship() { diff --git a/app/space/person_space_introduce/[mid]/page.js b/app/space/person_space_introduce/[mid]/page.js index 4025ab7..89fa12e 100644 --- a/app/space/person_space_introduce/[mid]/page.js +++ b/app/space/person_space_introduce/[mid]/page.js @@ -295,7 +295,6 @@ export default function PersonSpaceIntroduce() { } else { // router.push("/pay"); router.push( - process.env.NEXT_PUBLIC_WEB_URL + "/webView/" + encodeURIComponent( "/zone/pay/" + diff --git a/components/Photos/index.js b/components/Photos/index.js index 8151eb5..eb7fe80 100644 --- a/components/Photos/index.js +++ b/components/Photos/index.js @@ -40,7 +40,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) { if (newPhotos.length > 9) { newPhotos = newPhotos.slice(0, 9); } - console.log("newPhotos", newPhotos); + // console.log("newPhotos", newPhotos); setCurrentPhotos(newPhotos); } }, [media]); @@ -114,7 +114,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) { const handleSeeAllPhotos = (e) => { e.stopPropagation(); e.preventDefault(); - console.log(e); + // console.log(e); setSeeAllPhotos((old) => { if (old) { const newPhotos = [...photos]; diff --git a/components/PostItem/index.js b/components/PostItem/index.js index f2b0b18..db75f58 100644 --- a/components/PostItem/index.js +++ b/components/PostItem/index.js @@ -42,7 +42,7 @@ export default function PostItem({ // 使用正则表达式的exec或match方法查找匹配项 // exec在全局搜索中需要循环调用,而match在全局模式下直接返回所有匹配项 - var matches = text.match(urlPattern); + var matches = text?.match(urlPattern); // // 如果没有找到匹配项,返回空数组 // if (!matches) { @@ -51,14 +51,14 @@ export default function PostItem({ if (matches) { matches?.forEach((el) => { - console.log("index", text.indexOf(el)); + // console.log("index", text.indexOf(el)); text = text.replace( el, `#网页链接` ); }); - console.log("matches", matches); - console.log("text", text); + // console.log("matches", matches); + // console.log("text", text); } // 返回找到的链接数组 diff --git a/utils/baseRequest.js b/utils/baseRequest.js index e10f179..747976a 100644 --- a/utils/baseRequest.js +++ b/utils/baseRequest.js @@ -12,6 +12,6 @@ export default function baseRequest() { b_ts: b_ts, b_token: token, }; - console.log("baseRequest",baseRequest) + // console.log("baseRequest",baseRequest) return baseRequest; } diff --git a/utils/crypto.js b/utils/crypto.js index 5ee8c4e..65d44f9 100644 --- a/utils/crypto.js +++ b/utils/crypto.js @@ -18,7 +18,7 @@ export function cryptoPassword(password) { const a2 = payload.substring(3, len - 3); const a3 = payload.substring(len - 3); - const crypto = requireAPI("crypto"); + const crypto = require("crypto"); const md5Hash = crypto.createHash("md5"); md5Hash.update(a1 + a3 + a2); const encryptedPassword = md5Hash.digest("hex"); @@ -49,7 +49,7 @@ export function generateSignature(body) { const a2 = payload.substring(10, len - 10); const a3 = payload.substring(len - 10); - const crypto = requireAPI("crypto"); + const crypto = require("crypto"); const md5Hash = crypto.createHash("md5"); md5Hash.update(a1 + a3 + a2); const signature = md5Hash.digest("hex"); diff --git a/utils/requireAPI.js b/utils/requireAPI.js index fdd0f9b..ebbb91f 100644 --- a/utils/requireAPI.js +++ b/utils/requireAPI.js @@ -24,7 +24,7 @@ export default function customFetch(method, url, options = {}, mid) { newBody.mid = mid; } const body = JSON.stringify({ ...base, ...newBody }); - console.log("newBody", body); + // console.log("newBody", body); // 合并选项 const mergedOptions = { ...defaultOptions, body }; @@ -45,7 +45,7 @@ export default function customFetch(method, url, options = {}, mid) { resolve(data); }) .catch((error) => { - console.log("error", error); + // console.log("error", error); // Toast.show({ // icon: "fail", // content: error.toString(), diff --git a/utils/storeInfo.js b/utils/storeInfo.js index 5f64286..647daca 100644 --- a/utils/storeInfo.js +++ b/utils/storeInfo.js @@ -18,7 +18,7 @@ export function get(key) { typeof window.localStorage !== "undefined" ) { let data = localStorage.getItem(key); - console.log(key, data); + // console.log(key, data); return data?.indexOf("{") != -1 ? JSON.parse(data) : data; } }