Browse Source

新增查询摄像头权限api

Steven 7 months ago
parent
commit
978706447b

+ 20 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m

@@ -749,6 +749,26 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         NSString *url = [content ks_stringValueForKey:@"url"];
         [self openOutLink:url];
     }
+    else if ([parm ks_stringValueForKey:@"checkDeviceCamera"]) { // 检测相机权限
+        NSMutableDictionary *sendContent = [NSMutableDictionary dictionaryWithDictionary:[parm ks_dictionaryValueForKey:@"content"]];
+        
+        [RecordCheckManager checkCameraPremissionAvaiableCallback:^(PREMISSIONTYPE type) {
+            
+            if (type == PREMISSIONTYPE_YES) {
+                [sendContent setValue:@(YES) forKey:@"status"];
+                NSMutableDictionary *sendParm = [NSMutableDictionary dictionaryWithDictionary:parm];
+                [sendParm setValue:sendContent forKey:@"content"];
+                [self postMessage:sendParm];
+
+            }
+            else if (type == PREMISSIONTYPE_NO) {
+                [sendContent setValue:@(NO) forKey:@"status"];
+                NSMutableDictionary *sendParm = [NSMutableDictionary dictionaryWithDictionary:parm];
+                [sendParm setValue:sendContent forKey:@"content"];
+                [self postMessage:sendParm];
+            }
+        }];
+    }
 }
 
 - (void)openOutLink:(NSString *)url {

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Common/Define/KSDomain.h

@@ -39,6 +39,6 @@
 #define WhiteBoardHostURL ([NSString stringWithFormat:@"https://%@",WHITE_BOARD])
 
 // 云教练
-#define CLOUD_URL ([NSString stringWithFormat:@"https://%@/%@",ACCOMPANY_DOMAIN, @"klx-music-score?systemType=student"])
+#define CLOUD_URL ([NSString stringWithFormat:@"https://%@/%@",ACCOMPANY_DOMAIN, @"klx-music-score"])
 
 #endif /* KSDomain_h */