- TZImagePickerController/Location (= 3.8.9)
- TZImagePickerController/Basic (3.8.9)
- TZImagePickerController/Location (3.8.9)
+ - WechatOpenSDK-XCFramework (2.0.5)
- YYModel (1.0.4)
- YYText (1.0.7)
- ZipArchive (1.4.0)
- swiftScan
- TabPageViewController
- TZImagePickerController
+ - WechatOpenSDK-XCFramework
- YYModel
- YYText
- ZipArchive
- swiftScan
- TabPageViewController
- TZImagePickerController
+ - WechatOpenSDK-XCFramework
- YYModel
- YYText
- ZipArchive
swiftScan: 0849e7d7c1c641384767a573ee8cb90b88d1ddd9
TabPageViewController: 8bd4104909754416b35a98f3b72a5b674ab20dd5
TZImagePickerController: 456f470b5dea97b37226ec7a694994a8663340b2
+ WechatOpenSDK-XCFramework: b072030c9eeee91dfff1856a7846f70f7b9a88ed
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
-PODFILE CHECKSUM: 2a2c83c3c610795228576bbe8899f7939f0e6d43
+PODFILE CHECKSUM: 06f9ef8c019046f938158cfb86472b866db8d248
COCOAPODS: 1.16.2
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ShenYin/ShenYin.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = G23X75CJ67;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ShenYin/ShenYin.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = G23X75CJ67;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app;
PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
static var appLanguage = AppSupportLanguage.chinse
}
+class DCGlobal {
+
+ /// 高德地图 app key
+ static let mapKey = "01d0c91a330f94bd5819d617a91d37a0"
+
+ /// 腾讯地图 app key
+ static let qqmapKey = "FC6BZ-QCJWB-SOTUF-JLGK6-DTFIK-WCBIF"
+ /// 腾讯地图 Secret Key
+ static let qqmapSecretKey = "ODo3ZcRrsbzB71UTPBbRHeivpxnhSg9X"
+
+ /// 微信开发平台 App ID
+ static let wxAppID = "wxf19317f23b00d8ab"
+ static let wxUniversalLink = "https://www.thisiot.com/flychat"
+ static let wxSecret = "SECRET"
+
+ static let appStoreLink = "https://itunes.apple.com/cn/app/1542713301?mt=8"
+ /// 版本检测
+ static let appStoreVersionURL = "https://itunes.apple.com/cn/lookup?id=1542713301"
+}
case phoneCodeLogin(param:[String:Any])
/// 邮箱验证码登录
case emailCodeLogin(param:[String:Any])
+ /// 苹果登录
+ case appleLogin(param:[String:Any])
+ /// 微信登录
+ case wechatLogin(param:[String:Any])
/// 登录
case login(param:[String:Any])
/// 注销
return "/uc/phone/sms-login"
case .emailCodeLogin(_):
return "/uc/email/login"
+ case .appleLogin(_):
+ return "/uc/apple-login"
+ case .wechatLogin(_):
+ return "/uc/wechat_login"
case .login(_):
return "/uc/sign-in"
case .deactivate:
var method:RequestMethod{
switch self {
- case .register(_),.phoneCodeLogin(_),.emailCodeLogin(_),.login(_),.commitFeedback(_),.voiceRecord(_):
+ case .register(_),.phoneCodeLogin(_),.emailCodeLogin(_),.appleLogin(_),.login(_),.commitFeedback(_),.voiceRecord(_):
return .post
case .updatePwd(_),.updateUserInfo(_),.updatePhone(_),.updateEmail(_),.bindDevice(_),.otaUpdateVersion(_),.voiceRecordCollection(_),.updateVoiceRecord(_):
return .put
case let .emailCodeLogin(para):
params += para
break
+ case let .appleLogin(para):
+ params += para
+ break
+ case let .wechatLogin(para):
+ params += para
+ break
case let .login(para):
params += para
break
{
"images" : [
{
- "filename" : "logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
+ "filename" : "ic_IOS_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
+ "filename" : "ic_IOS_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "WX20250822-154739@2x.png",
+ "filename" : "微信_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
+ "filename" : "微信_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>CFBundleURLTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>CFBundleURLName</key>
+ <string>weixin</string>
+ <key>CFBundleURLSchemes</key>
+ <array>
+ <string>wxf19317f23b00d8ab</string>
+ </array>
+ </dict>
+ </array>
+ <key>LSApplicationQueriesSchemes</key>
+ <array>
+ <string>weixin</string>
+ <string>weixinURLParamsAPI</string>
+ <string>weixinULAPI</string>
+ </array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
-<dict/>
+<dict>
+ <key>com.apple.developer.applesignin</key>
+ <array>
+ <string>Default</string>
+ </array>
+ <key>com.apple.developer.associated-domains</key>
+ <array>
+ <string>applinks:www.thisiot.com</string>
+ </array>
+</dict>
</plist>
class CustomerVC:BaseVC{
let scrollView = UIScrollView()
let toolBar = SendToolBar()
- let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 160))
+ let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 175))
let tableView = UITableView(frame: CGRectZero, style: .plain)
var dataList:[FeedbackContentModel] = []
override func viewDidLoad() {
}
bgView.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(18)
- make.bottom.equalToSuperview()
+ make.bottom.equalToSuperview().inset(10)
make.top.equalToSuperview().inset(60)
}
if (keyPath == "isActive") {
let isOpen = change?[NSKeyValueChangeKey.newKey] as? Bool
if (isOpen == true) {
- YLprogressHUD.showAutoHiden("AI对话开启")
+// YLprogressHUD.showAutoHiden("AI对话开启")
} else {
- YLprogressHUD.showAutoHiden( "AI对话结束")
+// YLprogressHUD.showAutoHiden( "AI对话结束")
PcmSound.sharedInstance().cleanup()
}
}
BleManager.shared.cancel()
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
//
// }
} else {
- YLprogressHUD.showAutoHiden("自动结束")
+// YLprogressHUD.showAutoHiden("自动结束")
///判断当前蓝牙是否连接从而确定是否因为蓝牙断开造成的录音断开
}
}
setupViews(data: model)
}
else{
- YLprogressHUD.showAutoHiden("请求失败")
+ YLprogressHUD.hidden()
+// YLprogressHUD.showAutoHiden("请求失败")
}
}
}
self?.showUploadSuccess()
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
}
@objc func copyAction(){
UIPasteboard.general.string = data.send + "\n" + data.response
- YLprogressHUD.showAutoHiden("已拷贝")
+// YLprogressHUD.showAutoHiden("已拷贝")
}
}
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
-
-
+
+ func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
+ Logger.debug(userActivity.webpageURL?.absoluteString ?? "None")
+ guard IASignWithWeChat.shared.handleOpenUniversalLink(userActivity) == false else { return true }
+ return IAUniversalLinksHandler.shared.handle(userActivity, restorationHandler: restorationHandler)
+ }
+
+ func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
+// JPush.shared.deviceToken(deviceToken)
+ }
+
+ func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
+ return IASignWithWeChat.shared.handleOpen(url)
+ }
+ func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
+ return IASignWithWeChat.shared.handleOpen(url)
+ }
+// func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
+// Logger.verbose("注册远程通知发生错误:", error)
+// }
+//
+// func applicationDidEnterBackground(_ application: UIApplication) {
+// DB.shared.save()
+// JPush.shared.tellAppState(0)
+// Logger.verbose("App 进入后台")
+// }
+//
+// func applicationWillEnterForeground(_ application: UIApplication) {
+// JPush.shared.tellAppState(1)
+// Logger.verbose("App 将要进入前台")
+// }
+//
+// private var previousRefreshTime: TimeInterval = 0.0
+// func applicationDidBecomeActive(_ application: UIApplication) {
+// let date = Date().timeIntervalSince1970
+// if (date - previousRefreshTime > 60.0) {
+// previousRefreshTime = date
+// IANotify.post(.deviceListHasChange)
+// Logger.verbose("刷新设备列表...")
+// }
+// Logger.verbose("applicationDidBecomeActive")
+// }
+//
+// func applicationWillTerminate(_ application: UIApplication) {
+// Logger.verbose("App 将要停止运行")
+// }
+//
+// // iOS10以上静默推送会走该回调
+// func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
+// JPush.shared.handleRemoteNotification(userInfo)
+// completionHandler(.newData)
+// }
}
+class IAUniversalLinksHandler {
+ static let shared = IAUniversalLinksHandler()
+ private init() { }
+
+ func handle(_ userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
+ guard userActivity.activityType == NSUserActivityTypeBrowsingWeb else { return false }
+ guard let webpageURL = userActivity.webpageURL else { return false }
+ Logger.debug(webpageURL.absoluteString)
+ return true
+ }
+}
class AppLaunch:NSObject{
@MainActor static func start(){
// NFX.sharedInstance().start()
-
+ IASignWithWeChat.shared.register()
JoySdkManager.shared.setupSdk()
setupKeyboard()
loadCache()
// to restore the scene back to its current state.
}
-
+ func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
+ IASignWithWeChat.shared.continueUserActivity(userActivity: userActivity)
+ }
}
App.shared.popPage()
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+// YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
}
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
class FeekbackVC:BaseVC{
let bottomView = FeedbackBottomView()
- let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 160))
+ let qaView = QaHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWid, height: 175))
let tableView = UITableView()
var dataList:[FeedbackContentModel] = []
override func viewDidLoad() {
}
phoneView.do { v in
v.textField.placeholder = "请输入手机号码/邮箱"
-
+ v.textField.keyboardType = .emailAddress
}
codeView.do { v in
v.codeButton.addTarget(self, action: #selector(codeButtonAction), for: .touchUpInside)
YLprogressHUD.showLoading()
HttpClient.request(CommomApi.sms(account: text,type: .forget)) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
+ YLprogressHUD.hidden()
self?.codeView.codeButton.start()
}
- YLprogressHUD.showAutoHiden(model.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
@objc func loginAction(){
App.shared.popPage()
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
phoneView.do { v in
// v.textField.text = "13480939445"
v.textField.placeholder = "请输入手机号码/邮箱"
+ v.textField.keyboardType = .emailAddress
}
pwdView.do { v in
v.textField.placeholder = "请输入密码"
}
othersView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
- make.height.equalTo(50)
+ make.height.equalTo(150)
make.left.right.equalToSuperview()
make.top.equalTo(loginBtn.snp.bottom).offset(20)
}
App.shared.didLogin()
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
func updateLayout(){
if regionView.region.isChinese{
phoneView.textField.placeholder = "请输入手机号码"
+ phoneView.textField.keyboardType = .phonePad
}
else{
phoneView.textField.placeholder = "请输入邮箱"
+ phoneView.textField.keyboardType = .emailAddress
}
}
}
HttpClient.request(CommomApi.sms(account: text,type: .reg)) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
self?.codeView.codeButton.start()
+ YLprogressHUD.hidden()
+ }
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
}
- YLprogressHUD.showAutoHiden(model.msg)
}
}
@objc func registerAction(){
App.shared.popPage()
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
YLprogressHUD.showAutoHiden("请输入确认密码")
return
}
-// YLprogressHUD.showLoading()
-// LoginVM.login(phone: phone, code: code) {[weak self] result in
-// if result.isSuccess{
-// YLprogressHUD.showSuccess {
-// self?.view.window?.rootViewController = BaseTC()
-// }
-// }
-// YLprogressHUD.showAutoHiden(result.msg)
-// }
}
}
func updateLayout(){
if regionView.region.isChinese{
phoneView.textField.placeholder = "请输入手机号码"
+ phoneView.textField.keyboardType = .phonePad
}
else{
phoneView.textField.placeholder = "请输入邮箱"
+ phoneView.textField.keyboardType = .emailAddress
}
}
}
HttpClient.request(CommomApi.sms(account: text,type: .login)) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
self?.codeView.codeButton.start()
+ YLprogressHUD.hidden()
+ }
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
}
- YLprogressHUD.showAutoHiden(model.msg)
}
}
@objc func loginAction(){
App.shared.didLogin()
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
func emailLogin(){
App.shared.didLogin()
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
HttpClient.request(CommomApi.sms(account: text,type: .update)) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
self?.codeView.codeButton.start()
+ YLprogressHUD.hidden()
+ }
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
}
- YLprogressHUD.showAutoHiden(model.msg)
}
}
@objc func loginAction(){
}
}
else{
- YLprogressHUD.showAutoHiden(result.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
HttpClient.request(CommomApi.sms(account: self.email,type: .update)) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
self?.codeView.codeButton.start()
+ YLprogressHUD.hidden()
+ }
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
}
- YLprogressHUD.showAutoHiden(model.msg)
}
}
@objc func loginAction(){
App.shared.popToPage(num: 2)
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
YLprogressHUD.showLoading()
HttpClient.request(CommomApi.sms(account: self.phone,type: .update)) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
+ YLprogressHUD.hidden()
self?.codeView.codeButton.start()
}
- YLprogressHUD.showAutoHiden(model.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
@objc func loginAction(){
App.shared.popToPage(num: 2)
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
//
import UIKit
+import DeviceKit
+
class OthersLoginView: BaseView {
+ let toolView = UIView()
let registerLabel = UILabel()
let pwdLabel = UILabel()
let smsLabel = UILabel()
let line1 = UIView()
let line2 = UIView()
+ let thirdView = ThirdLoginView()
override func setupViews() {
- addSubviews([registerLabel,pwdLabel,smsLabel,line1,line2])
+// backgroundColor = .red
+ addSubviews([toolView,thirdView])
+ toolView.addSubviews([registerLabel,pwdLabel,smsLabel,line1,line2])
line1.backgroundColor = .hexString("#666666")
line2.backgroundColor = .hexString("#666666")
}
}
override func setupLayout() {
+ toolView.snp.makeConstraints { make in
+ make.width.equalToSuperview()
+ make.top.left.equalToSuperview()
+ make.height.equalTo(50)
+ }
pwdLabel.snp.makeConstraints { make in
// make.width.equalTo(78)
make.height.equalToSuperview()
make.left.equalTo(pwdLabel.snp.right).offset(15)
make.centerY.equalToSuperview()
}
+ thirdView.snp.makeConstraints { make in
+// make.width.equalToSuperview()
+ make.top.equalToSuperview().inset(60)
+ make.height.equalTo(80)
+ make.centerX.equalToSuperview()
+ }
}
@objc func forgetAction(){
App.shared.goToPage(ForgetVC(type: .forget))
App.shared.goToPage(SmsLoginVC())
}
}
+
+
+class ThirdLoginView: BaseView {
+ let label = UILabel()
+ let wechatView = UIButton(type: .custom)
+ let appleView = UIButton(type: .custom)
+
+ override func setupViews() {
+// backgroundColor = .green
+ addSubviews([label,wechatView,appleView])
+
+
+ label.do { v in
+ v.text = "其他登录方式"
+ v.textColor = .hexString("#666666")
+ v.font = .regular(12)
+ v.textAlignment = .center
+ }
+ if IASignWithWeChat.shared.isInstalled{
+ wechatView.do { v in
+ v.setImage(UIImage(named: "login_wechat"), for: .normal)
+ v.addTarget(self, action: #selector(wechatAction), for: .touchUpInside)
+ }
+ wechatView.isHidden = false
+ }
+ else{
+ wechatView.isHidden = true
+ }
+
+ appleView.do { v in
+ v.setImage(UIImage(named: "login_apple"), for: .normal)
+ v.addTarget(self, action: #selector(appleAction), for: .touchUpInside)
+ }
+ }
+ override func setupLayout() {
+ if IASignWithWeChat.shared.isInstalled {
+ label.snp.makeConstraints { make in
+ make.top.centerX.equalToSuperview()
+ }
+ wechatView.snp.makeConstraints { make in
+ make.size.equalTo(30)
+ make.left.equalToSuperview()
+ make.top.equalTo(label.snp.bottom).offset(20)
+ }
+ appleView.snp.makeConstraints { make in
+ make.size.equalTo(30)
+ make.left.equalTo(wechatView.snp.right).offset(30)
+ make.top.equalTo(label.snp.bottom).offset(20)
+ make.right.equalToSuperview()
+ }
+ }
+ else{
+ label.snp.makeConstraints { make in
+ make.top.left.equalToSuperview()
+ make.width.equalTo(200)
+ make.right.equalToSuperview()
+ }
+ appleView.snp.makeConstraints { make in
+ make.size.equalTo(30)
+ make.centerX.equalToSuperview()
+ make.top.equalTo(label.snp.bottom).offset(20)
+ }
+ }
+ }
+ @objc func wechatAction(){
+ Logger.debug("wechat action")
+ guard IASignWithWeChat.shared.isInstalled else { return }
+// guard agreeAgreementBtn.isSelected else { return "请同意《App隐私政策》".asToastShow() }
+
+ IASignWithWeChat.shared.request { [weak self] msg, code in
+ if let code = code{
+ self?.wechatLogin(with: code)
+ }
+ else{
+// YLprogressHUD.showAutoHiden(msg)
+ }
+ }
+ }
+ @objc func appleAction(){
+ Logger.debug("apple action")
+
+ let manager = AppleLoginManager.shared
+ manager.loginSuccess = {[weak self] (id,token) in
+ guard let self = self else {return}
+// Logger.debug("token = \(id)","emal = \(emal)","name = \(name)")
+ appleLogin(with: id,token: token)
+ }
+ manager.loginFailure = {[weak self] (msg) in
+// YLprogressHUD.showAutoHiden(msg)
+ }
+ manager.appleLoginAction()
+ }
+
+ func appleLogin(with id:String,token:String){
+ var params:[String:Any] = [:]
+ params["deviceName"] = Device.current.name
+ params["deviceCode"] = CacheManager.uuid()
+ params["token"] = token
+ params["userName"] = "DC_\(id)".replacingOccurrences(of: ".", with: "")
+
+// params["userName"] = "DC_\(UUID().uuidString.replacingOccurrences(of: "-", with: "_").prefix(16))"
+
+
+ LoginVM.appleLogin(param: params) { result in
+ if result.isSuccess{
+ YLprogressHUD.showSuccess {
+ App.shared.didLogin()
+ }
+ }
+ YLprogressHUD.showAutoHiden(result.msg)
+ }
+ }
+ func wechatLogin(with token:String){
+ var params:[String:Any] = [:]
+ params["code"] = token
+
+ LoginVM.wechatLogin(param: params) { result in
+ if result.isSuccess{
+ YLprogressHUD.showSuccess {
+ App.shared.didLogin()
+ }
+ }
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
+ }
+ }
+}
v.keyboardType = .default
v.placeholder = "请输入密码"
v.isSecureTextEntry = true
- }
+// v.returnKeyType = .done
+ }
btn.setImage(UIImage(named: "pwd_close"), for: .normal)
btn.setImage(UIImage(named: "pwd_open"), for: .selected)
btn.addTarget(self, action: #selector(btnAction), for: .touchUpInside)
--- /dev/null
+//
+// Untitled.swift
+// ShenYin
+//
+// Created by liangshi on 2025/10/28.
+//
+
+import Foundation
+import AuthenticationServices
+
+@available(iOS 13.0, *)
+class AppleLoginManager: NSObject {
+ static let shared = AppleLoginManager()
+ var loginSuccess:((_ appstore_id: String,_ token: String) -> Void)?
+ var loginFailure:((_ error:String) -> Void)?
+
+ public func appleLoginAction() {
+ let appleIDProvider = ASAuthorizationAppleIDProvider()
+ let request = appleIDProvider.createRequest()
+ request.requestedScopes = [.fullName, .email]
+
+ let authVC = ASAuthorizationController(authorizationRequests: [request])
+ authVC.delegate = self
+ authVC.presentationContextProvider = self
+ authVC.performRequests()
+ }
+}
+
+@available(iOS 13.0, *)
+extension AppleLoginManager:ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding{
+ ///告诉 ASAuthorizationController 展示在哪个 window 上
+ func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
+ return App.shared.window!
+ }
+
+ //返回错误
+ func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
+ var errorMsg = ""
+
+ switch error {
+ case ASAuthorizationError.canceled:
+ errorMsg = "您取消了授权请求";
+ break;
+ case ASAuthorizationError.failed:
+ errorMsg = "授权请求失败";
+ break;
+ case ASAuthorizationError.invalidResponse:
+ errorMsg = "授权请求响应无效";
+ break;
+ case ASAuthorizationError.notHandled:
+ errorMsg = "未能处理授权请求";
+ break;
+ case ASAuthorizationError.unknown:
+ errorMsg = "授权请求失败未知原因";
+
+ break;
+ default:
+ break;
+ }
+ print("授权结果" + errorMsg)
+ self.loginFailure?(errorMsg)
+ }
+
+// //授权结果
+// func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
+// switch authorization.credential {
+// case let credential as ASAuthorizationAppleIDCredential:
+// if let state = credential.state{
+// print(state)
+// }
+//
+// var email = ""
+// var fullName = ""
+// let userID = credential.user
+// print(userID)
+//
+// if let name = credential.fullName,let givenName = name.givenName {
+// fullName = givenName
+// print(fullName)
+// }
+// if let em = credential.email {
+// email = em
+// print(email)
+// }
+// let realUserStatus = credential.realUserStatus
+// print(realUserStatus)
+//
+// if let code = credential.authorizationCode,let authrizationCode = String(data:code , encoding: .utf8){
+// print(authrizationCode)
+// }
+// if let token = credential.identityToken,let identityToken = String(data: token, encoding: .utf8){
+// print(identityToken)
+// }
+//
+// self.loginSuccess?(userID,email,fullName)
+//
+// case let passwordCredential as ASPasswordCredential:
+// let username = passwordCredential.user
+// let password = passwordCredential.password
+// print(username)
+// print(password)
+// default:
+// break
+// }
+// }
+ func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
+ guard let credential = authorization.credential as? ASAuthorizationAppleIDCredential else { return Logger.debug("授权数据类型异常") }
+ guard let identityToken = credential.identityToken,
+ let token = String(data: identityToken, encoding: .utf8) else { return Logger.debug("identity Token 为空") }
+ // let userID = credential.user
+ // let state = credential.state
+ // let fullName = credential.fullName?.familyName
+ // let email = credential.email
+ // let authorizationCode = String(data: credential.authorizationCode!, encoding: .utf8)
+
+ // let realUserStatus = credential.realUserStatus
+
+ Logger.debug("授权完成", "id = \(credential.user)","token = \(token)")
+ self.loginSuccess?(credential.user,token)
+ }
+}
--- /dev/null
+//
+// Untitled.swift
+// ShenYin
+//
+// Created by liangshi on 2025/10/28.
+//
+
+import Foundation
+import WechatOpenSDK
+
+/// 微信登陆
+class IASignWithWeChat:NSObject {
+ private(set) var complete: ((String,String?) -> Void)!
+ static let shared = IASignWithWeChat()
+
+
+ func register() {
+ WXApi.startLog(by: .detail) { log in
+ Logger.debug(log)
+ }
+ WXApi.registerApp(DCGlobal.wxAppID, universalLink: DCGlobal.wxUniversalLink)
+// WXApi.checkUniversalLinkReady { step, result in
+// Logger.debug("step = ",step)
+// Logger.debug("result success = \(result.success),errorInfo = \(result.errorInfo),suggestion = \(result.suggestion)")
+// }
+ }
+
+ func handleOpen(_ url: URL) -> Bool {
+ return WXApi.handleOpen(url, delegate: self)
+ }
+
+ func handleOpenUniversalLink(_ userActivity: NSUserActivity) -> Bool {
+ return WXApi.handleOpenUniversalLink(userActivity, delegate: self)
+ }
+ func continueUserActivity(userActivity: NSUserActivity) {
+ WXApi.handleOpenUniversalLink(userActivity, delegate: self)
+ }
+ private var requestID: String = ""
+ func request(complete: @escaping ( _ message: String,_ code:String?) -> Void) {
+ self.complete = complete
+
+ requestID = String.uuid()
+ WXApi.isWXAppInstalled()
+ let authReq = SendAuthReq()
+ authReq.scope = "snsapi_userinfo"
+ authReq.state = requestID
+ WXApi.send(authReq)
+ }
+ /// true = 已安装微信app
+ var isInstalled: Bool { WXApi.isWXAppInstalled() }
+
+}
+public extension String {
+
+ static func uuid(_ suffix: String = "") -> String {
+ UUID().uuidString.replacingOccurrences(of: "-", with: "").appending(suffix)
+ }
+}
+extension IASignWithWeChat: WXApiDelegate {
+
+ func onResp(_ resp: BaseResp) {
+ // WXSuccess = 0, /**< 成功 */
+ // WXErrCodeCommon = -1, /**< 普通错误类型 */
+ // WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */
+ // WXErrCodeSentFail = -3, /**< 发送失败 */
+ // WXErrCodeAuthDeny = -4, /**< 授权失败 */
+ // WXErrCodeUnsupport = -5, /**< 微信不支持 */
+
+ guard let authResp = resp as? SendAuthResp else { return }
+ Logger.debug(authResp.errStr, authResp.errCode)
+
+ let error = ["成功", "普通错误类型", "用户取消授权", "发送失败", "授权失败", "当前微信版本不支持"][abs(Int(authResp.errCode))]
+ guard authResp.errCode == 0 else { return complete( error,nil) }
+ complete(error,authResp.code)
+ }
+}
completion(model)
}
}
+ static public func appleLogin(param:[String:Any], completion:@escaping (_ result:LoginModel) ->Void) {
+ let api = CommomApi.appleLogin(param: param)
+ HttpClient.request(api) { (model:LoginModel,res) in
+ if model.isSuccess{
+ CacheManager.shared.login(token: model.data)
+ }
+ completion(model)
+ }
+ }
+ static public func wechatLogin(param:[String:Any], completion:@escaping (_ result:LoginModel) ->Void) {
+ let api = CommomApi.wechatLogin(param: param)
+ HttpClient.request(api) { (model:LoginModel,res) in
+ if model.isSuccess{
+ CacheManager.shared.login(token: model.data)
+ }
+ completion(model)
+ }
+ }
+
static public func fetchCountryList(completion:@escaping (_ result:CountryModelRoot) ->Void) {
HttpClient.request(CommomApi.countryList) { (model:CountryModelRoot, res) in
if model.isSuccess{
}
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
CacheManager.shared.logout()
}
}
- YLprogressHUD.showAutoHiden(result.msg)
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
+ }
}
}
}
HttpClient.request(CommomApi.revokeCode) {[weak self] (model:ResponseBaseModel, res) in
if model.isSuccess{
self?.codeView.codeButton.start()
+ YLprogressHUD.hidden()
+ }
+ else{
+ YLprogressHUD.showAutoHiden("请求失败")
}
- YLprogressHUD.showAutoHiden(model.msg)
}
}
@objc func loginAction(){
}
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
}
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
phoneView.do { v in
v.textField.placeholder = "请输入昵称"
+ v.textField.keyboardType = .default
}
loginBtn.set(title: "确定",style: .theme1, target: self, action: #selector(loginAction))
view.addSubviews([phoneView,loginBtn])
self?.refreshUI()
}
else{
- YLprogressHUD.showAutoHiden(model.msg)
+ YLprogressHUD.showAutoHiden("请求失败")
}
}
}
}
@objc func tapAction(_ tap:UITapGestureRecognizer){
+ if !BleManager.shared.isConnetd {
+ return
+ }
let view = tap.view as! ItemView
for item in itemViews {
if view == item {
}
func selectedModeAction(_ mode:JoyGemEQMode){
+ if !BleManager.shared.isConnetd {
+ return
+ }
JoyGemAIManager.shared().device.setEQMode(mode) { err in
Logger.debug("setEQMode:\(err)");
}
}
}
@objc func findAction(){
- App.shared.goToPage(FindVC())
+ if BleManager.shared.isConnetd {
+ App.shared.goToPage(FindVC())
+ }
+
}
}
pod 'SocketRocket'#socket,AI用到
pod 'DGActivityIndicatorView'#扫描雷达
pod 'DeviceKit', '~> 5.4.0'
- pod 'CryptoSwift'
+ pod 'CryptoSwift'#加密
pod 'ZipArchive'#压缩
+
+ # 微信SDK
+# pod 'WechatOpenSDK-Swift'
+ pod 'WechatOpenSDK-XCFramework'
+
+
# pod 'MultiSlider'
# pod 'DSWaveformImage'
--- /dev/null
+000184.9ec81d3cc0d64640bbcbf740208cb0ac.0822
+000184.9ec81d3cc0d64640bbcbf740208cb0ac.0822
+苹果登录修改用户名闪退,估计是是检查token报错
+
+
+https://www.thisiot.com/flychat/apple-app-site-association
+https://www.thisiot.com/flychat/apple-app-site-association
+
+https://www.thisiot.com/flychat/apple-app-site-association
\ No newline at end of file