Browse Source

修复不能更新积分bug

charles_c 5 months ago
parent
commit
b81f1ca45a
2 changed files with 2 additions and 3 deletions
  1. 1 2
      src/app/models/User.js
  2. 1 1
      src/app/reset-password/page.js

+ 1 - 2
src/app/models/User.js

@@ -17,9 +17,8 @@ const UserSchema = new mongoose.Schema(
     role: { type: String, enum: ROLES, default: "user" },
     role: { type: String, enum: ROLES, default: "user" },
     securityQuestion: {
     securityQuestion: {
       type: String,
       type: String,
-      required: true,
     },
     },
-    securityAnswer: { type: String, required: true },
+    securityAnswer: { type: String },
   },
   },
   { timestamps: true }
   { timestamps: true }
 );
 );

+ 1 - 1
src/app/reset-password/page.js

@@ -55,7 +55,7 @@ export default function ResetPasswordPage() {
       } else {
       } else {
         setAlert({
         setAlert({
           type: "error",
           type: "error",
-          message: data.message || "验证失败,请重试",
+          message: data.error || "验证失败,请重试",
         });
         });
       }
       }
     } catch (error) {
     } catch (error) {