Ver Fonte

修改获取文档id和表格名称的权限

zhou1577692533 há 1 semana atrás
pai
commit
328255ebcc
1 ficheiros alterados com 11 adições e 1 exclusões
  1. 11 1
      src/components/App.tsx

+ 11 - 1
src/components/App.tsx

@@ -65,9 +65,19 @@ function App() {
 
   const handleConfigPermission = useCallback(async () => {
     try {
+      console.log('开始配置权限...');
+      console.log('当前URL:', window.location.href);
+      
       const response = await fetch(`http://localhost:3001/api/configPermission?url=${encodeURIComponent(window.location.href)}`);
       const config = await response.json();
       
+      console.log('服务器返回配置:', config);
+      
+      if (config.error) {
+        console.error('服务器返回错误:', config.error);
+        return;
+      }
+      
       await Dingdocs.base.host.configPermission(
         config.agentId,
         config.corpId,
@@ -78,7 +88,7 @@ function App() {
       );
       console.log('权限配置成功');
     } catch (error: any) {
-      console.warn('权限配置失败:', error);
+      console.error('权限配置失败:', error);
     }
   }, []);