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