|
|
@@ -52,7 +52,6 @@ function App() {
|
|
|
const [documentInfo, setDocumentInfo] = useState<{ uuid: string; currentSheet: string } | null>(null);
|
|
|
const [customTableId, setCustomTableId] = useState<string>('');
|
|
|
const [customTableName, setCustomTableName] = useState<string>('');
|
|
|
- const [authCode, setAuthCode] = useState('');
|
|
|
|
|
|
const loadApiList = useCallback(async () => {
|
|
|
try {
|
|
|
@@ -95,21 +94,6 @@ function App() {
|
|
|
}
|
|
|
}, []);
|
|
|
|
|
|
- const handleGetAuthCode = useCallback(async () => {
|
|
|
- try {
|
|
|
- const urlParams = new URLSearchParams(window.location.search);
|
|
|
- const corpId = urlParams.get('corpId') || '';
|
|
|
- console.log('corpId:', corpId);
|
|
|
- const result = await Dingdocs.base.host.getAuthCode(corpId);
|
|
|
- console.log('免登录码:', result);
|
|
|
- const authCode = result.code;
|
|
|
- setAuthCode(authCode || '获取失败');
|
|
|
- } catch (error: any) {
|
|
|
- console.error('获取免登录码失败:', error);
|
|
|
- setAuthCode('获取失败: ' + error);
|
|
|
- }
|
|
|
- }, []);
|
|
|
-
|
|
|
const handleApiChange = (apiId: string) => {
|
|
|
const api = apiList.find(item => item.id === apiId);
|
|
|
if (api) {
|
|
|
@@ -216,23 +200,6 @@ function App() {
|
|
|
|
|
|
<div className="content">
|
|
|
<Card size="small" className="main-card">
|
|
|
- <div className="auth-code-section">
|
|
|
- <Typography.Title level={5} className="auth-code-title">免登录码获取</Typography.Title>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- onClick={handleGetAuthCode}
|
|
|
- className="auth-code-btn"
|
|
|
- >
|
|
|
- 获取免登录码
|
|
|
- </Button>
|
|
|
- {authCode && (
|
|
|
- <div className="auth-code-result">
|
|
|
- <Typography.Text className="auth-code-label">免登录码:</Typography.Text>
|
|
|
- <code className="auth-code-value">{authCode}</code>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </div>
|
|
|
-
|
|
|
<div className="form-item">
|
|
|
<Typography.Text className="label">选择 API</Typography.Text>
|
|
|
<Select
|