forked from nocobase/nocobase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(independent-page): set independent-page * feat(plugin): add fuzhijia clock plugin * feat(clock): complete fuzhijia clock * fix(clock): map issue after refreshing page * fix(clock): tmap clock issue * feat(wxcom-auth): add wxcom auth plugin * fix(merge): merge from main --------- Co-authored-by: jessetalk <>
- Loading branch information
Showing
85 changed files
with
3,786 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @yun002/plugin-dingtalk-auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './dist/client'; | ||
export { default } from './dist/client'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/client/index.js'); |
14 changes: 14 additions & 0 deletions
14
packages/plugins/@yun002/plugin-dingtalk-auth/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "@yun002/plugin-dingtalk-auth", | ||
"version": "1.0.0-alpha.5", | ||
"main": "dist/server/index.js", | ||
"dependencies": { | ||
"dingtalk-h5-remote-debug": "^0.1.3", | ||
"dingtalk-jsapi": "^3.0.33" | ||
}, | ||
"peerDependencies": { | ||
"@nocobase/client": "1.x", | ||
"@nocobase/server": "1.x", | ||
"@nocobase/test": "1.x" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './dist/server'; | ||
export { default } from './dist/server'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/server/index.js'); |
91 changes: 91 additions & 0 deletions
91
packages/plugins/@yun002/plugin-dingtalk-auth/src/client/dingTalkSetting.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React, { useEffect, useMemo } from 'react'; | ||
import { useAPIClient, useAppSpin, useRequest } from '@nocobase/client'; | ||
import { Card, Form, Button, Input, message, Collapse, Divider } from 'antd'; | ||
|
||
interface DingtalkSettingModel { | ||
key: string; | ||
secret: string; | ||
} | ||
|
||
const DingtalkSettingConfiguration: React.FC<any> = () => { | ||
const { render } = useAppSpin(); | ||
const [form] = Form.useForm(); | ||
const apiClient = useAPIClient(); | ||
|
||
const data = useRequest<DingtalkSettingModel>( | ||
{ | ||
url: 'DingtalkSetting:get/1', | ||
}, | ||
{ | ||
onSuccess(data) { | ||
form.setFieldsValue(data.data); | ||
}, | ||
}, | ||
); | ||
|
||
if (data.loading) { | ||
return render(); | ||
} | ||
|
||
const onSubmit = async (values) => { | ||
try { | ||
await apiClient.request({ | ||
url: 'DingtalkSetting:enable', | ||
method: 'POST', | ||
data: values, | ||
}); | ||
message.success('保存成功'); | ||
} catch (err) { | ||
throw err; | ||
} | ||
}; | ||
|
||
const onSync = async () => { | ||
try { | ||
await apiClient.request({ | ||
url: 'DingtalkSetting:sync', | ||
method: 'POST', | ||
}); | ||
message.success('同步成功'); | ||
} catch (err) { | ||
throw err; | ||
} | ||
}; | ||
|
||
return ( | ||
<Collapse bordered={false}> | ||
<Collapse.Panel key="step1" header="2. 对接信息录入"> | ||
<Form form={form} onFinish={onSubmit} layout="vertical"> | ||
<Form.Item name="corpId" required label="Corp Id"> | ||
<Input /> | ||
</Form.Item> | ||
<Form.Item name="key" required label="Client Key"> | ||
<Input /> | ||
</Form.Item> | ||
<Form.Item name="secret" required label="Client Secret"> | ||
<Input /> | ||
</Form.Item> | ||
<Form.Item> | ||
<Button type="primary" htmlType="submit"> | ||
启用 | ||
</Button> | ||
</Form.Item> | ||
</Form> | ||
</Collapse.Panel> | ||
|
||
<Collapse.Panel key="step2" header="3. 同步通讯录"> | ||
<Button type="primary" htmlType="button" onClick={onSync}> | ||
同步通讯录 | ||
</Button> | ||
</Collapse.Panel> | ||
</Collapse> | ||
); | ||
}; | ||
|
||
export const DingtalkSetting = () => { | ||
return ( | ||
<Card> | ||
<DingtalkSettingConfiguration></DingtalkSettingConfiguration> | ||
</Card> | ||
); | ||
}; |
Oops, something went wrong.