Skip to content

Commit

Permalink
fix: 修复代理主机&端口初始默认值问题
Browse files Browse the repository at this point in the history
  • Loading branch information
song-xiao-lin authored and b1rdfree committed Mar 1, 2024
1 parent 4c77a6a commit 2f8e9d2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ClientCertificate {
}

const defHost = "127.0.0.1"
const defPort = "8083"
export const MITMServerStartForm: React.FC<MITMServerStartFormProp> = React.memo((props) => {
const [hostHistoryList, setHostHistoryList] = useState<string[]>([])

Expand Down Expand Up @@ -85,12 +86,16 @@ export const MITMServerStartForm: React.FC<MITMServerStartFormProp> = React.memo
})
getRemoteValue(MITMConsts.MITMDefaultServer).then((e) => {
if (!!e) {
form.setFieldsValue({host: e || defHost})
form.setFieldsValue({host: e})
} else {
form.setFieldsValue({host: defHost})
}
})
getRemoteValue(MITMConsts.MITMDefaultPort).then((e) => {
if (!!e) {
form.setFieldsValue({port: e})
} else {
form.setFieldsValue({port: defPort})
}
})
getRemoteValue(MITMConsts.MITMDefaultEnableHTTP2).then((e) => {
Expand Down

0 comments on commit 2f8e9d2

Please sign in to comment.