修复bug
This commit is contained in:
parent
1e19a199d1
commit
dcf5e05e91
|
@ -1,9 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useEffect } from "react";
|
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";
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function BillDetail({ params }) {
|
export default function BillDetail({ params }) {
|
||||||
|
|
|
@ -14,11 +14,8 @@ import { useRouter } from "next/navigation";
|
||||||
import { useSearchParams, usePathname, useParams } from "next/navigation";
|
import { useSearchParams, usePathname, useParams } from "next/navigation";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
|
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
|
||||||
import Empty from "@/components/Empty";
|
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
import { handleFollow } from "@/api/public";
|
import { handleFollow } from "@/api/public";
|
||||||
import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
|
||||||
import { generateSignature } from "@/utils/crypto";
|
|
||||||
import requireAPI from "@/utils/requireAPI";
|
import requireAPI from "@/utils/requireAPI";
|
||||||
import InfiniteScrollContent from "@/components/InfiniteScrollContent";
|
import InfiniteScrollContent from "@/components/InfiniteScrollContent";
|
||||||
export default function Relationship() {
|
export default function Relationship() {
|
||||||
|
|
|
@ -295,7 +295,6 @@ export default function PersonSpaceIntroduce() {
|
||||||
} else {
|
} else {
|
||||||
// router.push("/pay");
|
// router.push("/pay");
|
||||||
router.push(
|
router.push(
|
||||||
process.env.NEXT_PUBLIC_WEB_URL +
|
|
||||||
"/webView/" +
|
"/webView/" +
|
||||||
encodeURIComponent(
|
encodeURIComponent(
|
||||||
"/zone/pay/" +
|
"/zone/pay/" +
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
||||||
if (newPhotos.length > 9) {
|
if (newPhotos.length > 9) {
|
||||||
newPhotos = newPhotos.slice(0, 9);
|
newPhotos = newPhotos.slice(0, 9);
|
||||||
}
|
}
|
||||||
console.log("newPhotos", newPhotos);
|
// console.log("newPhotos", newPhotos);
|
||||||
setCurrentPhotos(newPhotos);
|
setCurrentPhotos(newPhotos);
|
||||||
}
|
}
|
||||||
}, [media]);
|
}, [media]);
|
||||||
|
@ -114,7 +114,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
||||||
const handleSeeAllPhotos = (e) => {
|
const handleSeeAllPhotos = (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(e);
|
// console.log(e);
|
||||||
setSeeAllPhotos((old) => {
|
setSeeAllPhotos((old) => {
|
||||||
if (old) {
|
if (old) {
|
||||||
const newPhotos = [...photos];
|
const newPhotos = [...photos];
|
||||||
|
|
|
@ -42,7 +42,7 @@ export default function PostItem({
|
||||||
|
|
||||||
// 使用正则表达式的exec或match方法查找匹配项
|
// 使用正则表达式的exec或match方法查找匹配项
|
||||||
// exec在全局搜索中需要循环调用,而match在全局模式下直接返回所有匹配项
|
// exec在全局搜索中需要循环调用,而match在全局模式下直接返回所有匹配项
|
||||||
var matches = text.match(urlPattern);
|
var matches = text?.match(urlPattern);
|
||||||
|
|
||||||
// // 如果没有找到匹配项,返回空数组
|
// // 如果没有找到匹配项,返回空数组
|
||||||
// if (!matches) {
|
// if (!matches) {
|
||||||
|
@ -51,14 +51,14 @@ export default function PostItem({
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
matches?.forEach((el) => {
|
matches?.forEach((el) => {
|
||||||
console.log("index", text.indexOf(el));
|
// console.log("index", text.indexOf(el));
|
||||||
text = text.replace(
|
text = text.replace(
|
||||||
el,
|
el,
|
||||||
`<a class="text-btn" href="${el}" target="_blank">#网页链接</a>`
|
`<a class="text-btn" href="${el}" target="_blank">#网页链接</a>`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
console.log("matches", matches);
|
// console.log("matches", matches);
|
||||||
console.log("text", text);
|
// console.log("text", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回找到的链接数组
|
// 返回找到的链接数组
|
||||||
|
|
|
@ -12,6 +12,6 @@ export default function baseRequest() {
|
||||||
b_ts: b_ts,
|
b_ts: b_ts,
|
||||||
b_token: token,
|
b_token: token,
|
||||||
};
|
};
|
||||||
console.log("baseRequest",baseRequest)
|
// console.log("baseRequest",baseRequest)
|
||||||
return baseRequest;
|
return baseRequest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ export function cryptoPassword(password) {
|
||||||
const a2 = payload.substring(3, len - 3);
|
const a2 = payload.substring(3, len - 3);
|
||||||
const a3 = payload.substring(len - 3);
|
const a3 = payload.substring(len - 3);
|
||||||
|
|
||||||
const crypto = requireAPI("crypto");
|
const crypto = require("crypto");
|
||||||
const md5Hash = crypto.createHash("md5");
|
const md5Hash = crypto.createHash("md5");
|
||||||
md5Hash.update(a1 + a3 + a2);
|
md5Hash.update(a1 + a3 + a2);
|
||||||
const encryptedPassword = md5Hash.digest("hex");
|
const encryptedPassword = md5Hash.digest("hex");
|
||||||
|
@ -49,7 +49,7 @@ export function generateSignature(body) {
|
||||||
const a2 = payload.substring(10, len - 10);
|
const a2 = payload.substring(10, len - 10);
|
||||||
const a3 = payload.substring(len - 10);
|
const a3 = payload.substring(len - 10);
|
||||||
|
|
||||||
const crypto = requireAPI("crypto");
|
const crypto = require("crypto");
|
||||||
const md5Hash = crypto.createHash("md5");
|
const md5Hash = crypto.createHash("md5");
|
||||||
md5Hash.update(a1 + a3 + a2);
|
md5Hash.update(a1 + a3 + a2);
|
||||||
const signature = md5Hash.digest("hex");
|
const signature = md5Hash.digest("hex");
|
||||||
|
|
|
@ -24,7 +24,7 @@ export default function customFetch(method, url, options = {}, mid) {
|
||||||
newBody.mid = mid;
|
newBody.mid = mid;
|
||||||
}
|
}
|
||||||
const body = JSON.stringify({ ...base, ...newBody });
|
const body = JSON.stringify({ ...base, ...newBody });
|
||||||
console.log("newBody", body);
|
// console.log("newBody", body);
|
||||||
|
|
||||||
// 合并选项
|
// 合并选项
|
||||||
const mergedOptions = { ...defaultOptions, body };
|
const mergedOptions = { ...defaultOptions, body };
|
||||||
|
@ -45,7 +45,7 @@ export default function customFetch(method, url, options = {}, mid) {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("error", error);
|
// console.log("error", error);
|
||||||
// Toast.show({
|
// Toast.show({
|
||||||
// icon: "fail",
|
// icon: "fail",
|
||||||
// content: error.toString(),
|
// content: error.toString(),
|
||||||
|
|
|
@ -18,7 +18,7 @@ export function get(key) {
|
||||||
typeof window.localStorage !== "undefined"
|
typeof window.localStorage !== "undefined"
|
||||||
) {
|
) {
|
||||||
let data = localStorage.getItem(key);
|
let data = localStorage.getItem(key);
|
||||||
console.log(key, data);
|
// console.log(key, data);
|
||||||
return data?.indexOf("{") != -1 ? JSON.parse(data) : data;
|
return data?.indexOf("{") != -1 ? JSON.parse(data) : data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue