feat: update app workflows and permissions

This commit is contained in:
2026-07-09 17:34:00 +08:00
parent 43e6133c21
commit 8e356973bd
44 changed files with 2944 additions and 307 deletions
+53 -1
View File
@@ -33,7 +33,7 @@ enum WeChatShareScene: Int, CaseIterable, Sendable {
}
/// 微信分享请求结果。
enum WeChatShareResult: Equatable, Sendable {
enum WeChatShareResult: Equatable, Error, Sendable {
case success
case cancelled
case notInstalled
@@ -55,6 +55,25 @@ enum WeChatShareResult: Equatable, Sendable {
}
}
/// 微信小程序分享版本。
enum WeChatMiniProgramType: Int, Equatable, Sendable {
/// 正式版。
case release = 0
/// 开发版。
case test = 1
/// 体验版。
case preview = 2
/// 当前编译配置下实际传给微信 SDK 的小程序版本。
var resolvedForCurrentBuild: WeChatMiniProgramType {
#if DEBUG
return .test
#else
return self
#endif
}
}
/// 网页分享载荷,供邀请等业务模块调用微信分享。
struct WeChatWebPageSharePayload: Equatable, Sendable {
let title: String
@@ -71,3 +90,36 @@ struct WeChatTextSharePayload: Equatable, Sendable {
struct WeChatImageSharePayload: Equatable, Sendable {
let imageData: Data
}
/// 微信小程序分享载荷。
struct WeChatMiniProgramSharePayload: Equatable, Sendable {
let title: String
let description: String
let webpageURL: String
let userName: String
let path: String?
let miniProgramType: WeChatMiniProgramType
let withShareTicket: Bool
let disableForward: Bool
/// 初始化小程序分享载荷。
init(
title: String,
description: String,
webpageURL: String,
userName: String,
path: String? = nil,
miniProgramType: WeChatMiniProgramType = .release,
withShareTicket: Bool = false,
disableForward: Bool = false
) {
self.title = title
self.description = description
self.webpageURL = webpageURL
self.userName = userName
self.path = path
self.miniProgramType = miniProgramType
self.withShareTicket = withShareTicket
self.disableForward = disableForward
}
}