mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
修复配置文件打不开的问题
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export default async ({}) =>{
|
||||
const config = (await window.api.sql('select * from config where id=1', 'findOne', {})) as ConfigType
|
||||
return JSON.parse(config.content) as ConfigDataType
|
||||
}
|
||||
return JSON.parse(config.content) as ConfigDataType
|
||||
}
|
||||
@@ -5,10 +5,7 @@ import { useState } from 'react'
|
||||
export const Setting = () => {
|
||||
// const config = useLoaderData() as ConfigDataType
|
||||
const [keys, setKeys] = useState<string[]>([])
|
||||
const {config} = useLoaderData() as {
|
||||
config: ConfigDataType
|
||||
}
|
||||
console.log("config:", config)
|
||||
const config = useLoaderData() as ConfigDataType
|
||||
const submit = useSubmit()
|
||||
return (
|
||||
<Form method="POST">
|
||||
|
||||
@@ -32,8 +32,9 @@ const router = createHashRouter([
|
||||
{
|
||||
index: true,
|
||||
element: <Setting/>,
|
||||
action: SettingAction,
|
||||
loader: SettingLoader
|
||||
loader: SettingLoader,
|
||||
action: SettingAction
|
||||
|
||||
},
|
||||
{
|
||||
path: "category",
|
||||
|
||||
1
types.d.ts
vendored
1
types.d.ts
vendored
@@ -22,6 +22,7 @@ type ConfigType = {
|
||||
content: string
|
||||
}
|
||||
|
||||
|
||||
type ConfigDataType = {
|
||||
shortCut: string
|
||||
llm: {
|
||||
|
||||
Reference in New Issue
Block a user