mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-06-06 12:50:20 +09:00
修改: app/api/bedrock.ts
修改: app/components/ui-lib.tsx
This commit is contained in:
parent
6bc1612720
commit
225ad30898
@ -190,7 +190,6 @@ export async function handle(
|
||||
}
|
||||
|
||||
// If stream is false, accumulate the response and return as JSON
|
||||
console.log("Body.stream==========" + body.stream);
|
||||
if (body.stream === false) {
|
||||
let fullResponse = {
|
||||
content: "",
|
||||
|
@ -272,19 +272,20 @@ export function Input(props: InputProps) {
|
||||
export function PasswordInput(
|
||||
props: HTMLProps<HTMLInputElement> & {
|
||||
aria?: string;
|
||||
maskWhenShow?: boolean; // New prop to control masking behavior
|
||||
maskWhenShow?: boolean;
|
||||
},
|
||||
) {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [displayValue, setDisplayValue] = useState(props.value as string);
|
||||
const { maskWhenShow, ...inputProps } = props;
|
||||
|
||||
useEffect(() => {
|
||||
if (props.maskWhenShow && visible && props.value) {
|
||||
if (maskWhenShow && visible && props.value) {
|
||||
setDisplayValue(maskSensitiveValue(props.value as string));
|
||||
} else {
|
||||
setDisplayValue(props.value as string);
|
||||
}
|
||||
}, [visible, props.value, props.maskWhenShow]);
|
||||
}, [visible, props.value, maskWhenShow]);
|
||||
|
||||
function changeVisibility() {
|
||||
setVisible(!visible);
|
||||
@ -305,7 +306,7 @@ export function PasswordInput(
|
||||
className={"password-eye"}
|
||||
/>
|
||||
<input
|
||||
{...props}
|
||||
{...inputProps}
|
||||
value={displayValue}
|
||||
onChange={handleChange}
|
||||
type={visible ? "text" : "password"}
|
||||
|
Loading…
Reference in New Issue
Block a user