更新 README.md
parent
eb34f5270c
commit
c03b273813
24
README.md
24
README.md
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
### resources\admin-views\src\pages\amis\index.tsx
|
||||
|
||||
自定义登录页面, 删除高度 `20px` 的 `div`
|
||||
|
||||
```tsx
|
||||
return (
|
||||
<>
|
||||
|
|
@ -25,6 +27,8 @@ return (
|
|||
|
||||
### resources\admin-views\src\components\AmisRender\CustomComponents\components\WangEditor\index.tsx
|
||||
|
||||
WangEditor 编辑器上传图片时, 把登录授权的 `token` 带上
|
||||
|
||||
```tsx
|
||||
// 编辑器配置
|
||||
const editorConfig: Partial<IEditorConfig> = {
|
||||
|
|
@ -49,3 +53,23 @@ const editorConfig: Partial<IEditorConfig> = {
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
### resources\admin-views\src\pages\login\form.tsx
|
||||
|
||||
自定义登录页面, 重复请求接口 `admin-api/captcha` 获取图形验证码
|
||||
|
||||
```tsx
|
||||
// 读取 localStorage, 设置初始值
|
||||
useEffect(() => {
|
||||
const rememberPassword = !!loginParams
|
||||
setRememberPassword(rememberPassword)
|
||||
if (formRef.current && rememberPassword) {
|
||||
const parseParams = JSON.parse(decodeURIComponent(window.atob(loginParams)))
|
||||
formRef.current.setFieldsValue(parseParams)
|
||||
}
|
||||
|
||||
// if (appSettings.login_captcha) {
|
||||
// getCaptcha.run()
|
||||
// }
|
||||
}, [loginParams])
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue