mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-18 06:53:41 +08:00
修复一部分类型错误,无影响
This commit is contained in:
@@ -35,7 +35,6 @@ export default function SetPasswordPage() {
|
||||
const onFinish: FormProps<FieldType>["onFinish"] = (values) => {
|
||||
// setLoading(true);
|
||||
// console.log('-------------', values)
|
||||
// @ts-expect-error
|
||||
fetch(`/api/user/${session?.user?.id}`, {
|
||||
method: "PUT",
|
||||
credentials: "include",
|
||||
@@ -61,31 +60,28 @@ export default function SetPasswordPage() {
|
||||
layout="vertical"
|
||||
onFinish={onFinish}
|
||||
>
|
||||
{
|
||||
// @ts-expect-error
|
||||
status === "authenticated" && session?.user?.hasPassword && (
|
||||
<Form.Item
|
||||
name="user[old_password]"
|
||||
label="Old password"
|
||||
rules={[
|
||||
{
|
||||
validator: async (_, value) => {
|
||||
if (!value) {
|
||||
return Promise.reject(new Error("请填写该字段"));
|
||||
}
|
||||
},
|
||||
{status === "authenticated" && session?.user?.hasPassword && (
|
||||
<Form.Item
|
||||
name="user[old_password]"
|
||||
label="Old password"
|
||||
rules={[
|
||||
{
|
||||
validator: async (_, value) => {
|
||||
if (!value) {
|
||||
return Promise.reject(new Error("请填写该字段"));
|
||||
}
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input
|
||||
prefix={<LockOutlined className="site-form-item-icon" />}
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
id="user_old_password"
|
||||
/>
|
||||
</Form.Item>
|
||||
)
|
||||
}
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input
|
||||
prefix={<LockOutlined className="site-form-item-icon" />}
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
id="user_old_password"
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
<Form.Item
|
||||
name="user[password]"
|
||||
|
||||
@@ -127,7 +127,6 @@ export default function UserLoginCore() {
|
||||
// 手动获取一遍session
|
||||
getSession()
|
||||
.then((value) => {
|
||||
// @ts-expect-error
|
||||
if (!value?.user?.hasPassword) {
|
||||
if (result_url === "/") {
|
||||
result_url = "/login/set-password";
|
||||
|
||||
Reference in New Issue
Block a user