💪 optimize: 优化代码
This commit is contained in:
parent
a783378148
commit
d813ed168a
|
@ -1,10 +1,10 @@
|
||||||
|
import { generateRsaKey, setResellMerchant } from "@/assets/api"
|
||||||
import FormItem from "@/components/form-item/main"
|
import FormItem from "@/components/form-item/main"
|
||||||
import Form from "@/components/form/main"
|
import Form from "@/components/form/main"
|
||||||
import Ipt from "@/components/input/main"
|
import Ipt from "@/components/input/main"
|
||||||
import { cloneDeep, omit } from "lodash-es"
|
import { omit } from "lodash-es"
|
||||||
import { useEffect, useRef, useState } from "react"
|
import { useEffect, useRef, useState } from "react"
|
||||||
import { Button, Card, Checkbox, Input, Notify, Radio, RadioGroup } from "zent"
|
import { Button, Card, Checkbox, Input, Notify, Radio, RadioGroup } from "zent"
|
||||||
import { setResellMerchant, generateRsaKey } from "@/assets/api"
|
|
||||||
import "./index"
|
import "./index"
|
||||||
export default function Merchant() {
|
export default function Merchant() {
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
|
@ -45,11 +45,7 @@ export default function Merchant() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { merchant, id } = JSON.parse(sessionStorage.getItem("merchant"))
|
const { merchant, id } = JSON.parse(sessionStorage.getItem("merchant"))
|
||||||
const cloneState = cloneDeep(state)
|
setState({ ...state, reseller_id: id, ...merchant })
|
||||||
for (let key in cloneState) {
|
|
||||||
cloneState[key] = merchant[key]
|
|
||||||
}
|
|
||||||
setState({ ...state, reseller_id: id, ...cloneState })
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
/* 获取密钥 */
|
/* 获取密钥 */
|
||||||
|
|
Loading…
Reference in New Issue