这版是公共号授权版

This commit is contained in:
cao123
2026-08-12 11:47:51 +08:00
parent d0776f9676
commit e47df01af9
18 changed files with 365 additions and 378 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
import { BASE_URL, appId } from "../env";
import { BASE_URL } from "../env";
import { base64Encode } from "./crypto";
type RequestProps = {
options: WechatMiniprogram.RequestOption;
@@ -23,6 +23,7 @@ export const request = <T = any>(
return Promise.reject(new Error('请先登录'));
}
const openId = wx.getStorageSync("openId") || "";
const appId = wx.getStorageSync("appId") || "";
header.Authorization = `Basic ${base64Encode(`${openId}:${appId}`)}`
}