删除部分代码

This commit is contained in:
cao123
2026-09-01 17:51:32 +08:00
parent 4f75a19965
commit ed5f5a7d9a
2 changed files with 3 additions and 14 deletions
-3
View File
@@ -63,9 +63,6 @@ Page({
return; return;
} }
const bool = await app.login("video");
if (!bool) return;
// 开启防截屏(仅限当前页面生命周期内) // 开启防截屏(仅限当前页面生命周期内)
//@ts-ignore //@ts-ignore
wx.setVisualEffectOnCapture({ wx.setVisualEffectOnCapture({
+3 -11
View File
@@ -1,5 +1,4 @@
import { BASE_URL, appId } from "../env"; import { BASE_URL } from "../env";
import { base64Encode } from "./crypto";
type RequestProps = { type RequestProps = {
options: WechatMiniprogram.RequestOption; options: WechatMiniprogram.RequestOption;
loadingTitle?: string; loadingTitle?: string;
@@ -21,19 +20,12 @@ const generateFingerprint = (): string => {
export const request = <T = any>( export const request = <T = any>(
{ options, loadingTitle = "加载中", isLoading = true, needLogin = true }: RequestProps { options, loadingTitle = "加载中", isLoading = true }: RequestProps
): Promise<T> => { ): Promise<T> => {
const app = getApp<IAppOption>();
const header: any = { const header: any = {
"X-Fingerprint": generateFingerprint(), "X-Fingerprint": generateFingerprint(),
}; };
if (needLogin) {
if (!app.checkLoginState()) {
return Promise.reject(new Error('请先登录'));
}
const openId = wx.getStorageSync("openId") || "";
header.Authorization = `Basic ${base64Encode(`${openId}:${appId}`)}`
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {