Ver código fonte

新增查询摄像头权限api

Steven 8 meses atrás
pai
commit
e7ded3bcb6

+ 21 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSBaseWKWebViewController.m

@@ -757,6 +757,27 @@ 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
KulexiuForTeacher/KulexiuForTeacher/Common/Define/KSDomain.h

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