添加 useWx 方法,支持微信小程序登录等

This commit is contained in:
icssoa
2025-08-26 18:46:57 +08:00
parent 75c90c7964
commit 6c691c7653
5 changed files with 292 additions and 25 deletions

View File

@@ -8,6 +8,11 @@ export const isDev = process.env.NODE_ENV == "development";
// 忽略 token 校验的接口路径
export const ignoreTokens: string[] = [];
// 微信配置
type WxConfig = {
debug: boolean;
};
// 配置类型定义
type Config = {
name: string; // 应用名称
@@ -19,6 +24,7 @@ type Config = {
showDarkButton: boolean; // 是否显示暗色模式切换按钮
isCustomTabBar: boolean; // 是否自定义 tabBar
backTop: boolean; // 是否显示回到顶部按钮
wx: WxConfig; // 微信配置
};
// 根据环境导出最终配置
@@ -30,6 +36,9 @@ export const config = {
showDarkButton: isMp() ? false : true,
isCustomTabBar: true,
backTop: true,
wx: {
debug: false
},
...(isDev ? dev() : prod())
} as Config;