修复bug

This commit is contained in:
al 2024-07-22 16:41:33 +08:00
parent 1e19a199d1
commit dcf5e05e91
9 changed files with 12 additions and 19 deletions

View File

@ -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 }) {

View File

@ -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() {

View File

@ -295,7 +295,6 @@ export default function PersonSpaceIntroduce() {
} else {
// router.push("/pay");
router.push(
process.env.NEXT_PUBLIC_WEB_URL +
"/webView/" +
encodeURIComponent(
"/zone/pay/" +

View File

@ -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];

View File

@ -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,
`<a class="text-btn" href="${el}" target="_blank">#网页链接</a>`
);
});
console.log("matches", matches);
console.log("text", text);
// console.log("matches", matches);
// console.log("text", text);
}
// 返回找到的链接数组

View File

@ -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;
}

View File

@ -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");

View File

@ -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(),

View File

@ -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;
}
}