0

请查看以下网站:

http://openstrategynetwork.com/joinus

用户名:uzh 密码:osn

现在请填写密码并确认(无需注册)

尽管重复的密码相同,但它总是打印:

Passwords don't match. 

这是为什么?但是,在点击注册按钮后(仍然不需要注册或填写其他字段),css 显示匹配符号。

我正在使用这个useraccounts包:https ://github.com/meteor-useraccounts

这是代码,尤其是我自己的模板: https ://github.com/OpenStratNet/OSN/tree/master/client/templates/account-templates

任何帮助高度赞赏。

编辑(我的配置文件):

// Options
AccountsTemplates.configure({
  // preSignUpHook: function (error, state) {
  //   console.log("love");
  // },
  // defaultLayout: 'emptyLayout',
  showForgotPasswordLink: true,
  overrideLoginErrors: true,
  enablePasswordChange: true,

  // sendVerificationEmail: true,
  // enforceEmailVerification: true,
  //confirmPassword: true,
  //continuousValidation: false,
  showLabels: false,
  //forbidClientAccountCreation: true,
  //formValidationFeedback: true,
  homeRoutePath: '/',
  redirectTimeout: 2000,
  //showAddRemoveServices: false,
  showPlaceholders: true,

  negativeValidation: true,
  positiveValidation: true,
  negativeFeedback: true,
  positiveFeedback: true,

  // Privacy Policy and Terms of Use
  //privacyUrl: 'privacy',
  //termsUrl: 'terms-of-use',
  texts: {
    sep: "OR REGISTER with your social account:",
    title: {
      signUp: "REGISTER by creating a new account:"
    },
    button: {
      signUp: "REGISTER"
    },
    socialSignUp: "",
    socialWith: ""
  }
});

var submitFunction = function(error, state){
  // ...
};


// remove fields and add them back in the right order
AccountsTemplates.removeField('email');
AccountsTemplates.removeField('password');

//all register fields
AccountsTemplates.addFields([
    {
      _id: 'firstName',
      type: 'text',
      placeholder: "First Name*",
      required: true,
      re: /^[^\d]{2,}$/i,
      errStr: "Please enter your first name.",
    },
    {
      _id: 'lastName',
      type: 'text',
      placeholder: "Last Name*",
      required: true,
      re: /^[^\d]{2,}$/i,
      errStr: "Please enter your last name.",
    },
    {
      _id: 'email',
      type: 'email',
      placeholder: "Email Address*",
      required: true,
      displayName: "email",
      re: /.+@(.+){2,}\.(.+){2,}/,
      errStr: 'Invalid email',
    },
    {
      _id: 'institution',
      type: 'text',
      placeholder: "Institution/Company*",
      required: true,
      // re: /^[^\d]{2,}$/i,
      minLength: 2,
      errStr: "Please enter the institution or company you work for.",
    },
    {
      _id: 'interests',
      type: 'text',
      placeholder: "Interests regarding Open Strategy*",
      required: true,
      re: /^[^\d]{2,}$/i,
      errStr: "Please enter the your interests in the institution/company.",
      template: 'interests'
    },
    {
      _id: 'position',
      type: 'text',
      placeholder: "Position",
      re: /^[^\d]{2,}$/i,
      errStr: "Please enter the your position in the institution/company.",
    },
    {
      _id: 'uploadProfile',
      type: 'text',
      template: 'uploadInput'
    },
    {
      _id: 'password',
      type: 'password',
      placeholder: "Password*",
      required: true,
      minLength: 6,
      errStr: 'Password must be at least six characters long',
    },
    {
      _id: 'password_again',
      type: 'password',
      placeholder: "Confirm Password*",
      required: true,
      minLength: 6,
      errStr: 'Password must be at least six characters long',
    }
]);

在再次添加字段之前添加该行AccountsTemplates.removeField('password_again');会产生以下错误:

core.js:591Uncaught 错误:名为 password_again 的字段不存在!AT.removeField @core.js:591(匿名函数)@at_config.js:61(匿名函数)@at_config.js?2f3c438…:136

在那之后:

未捕获的类型错误:无法设置 undefinedAT._init @ client.js:146(匿名函数)的属性 '_id' @ client.js:463runStartupCallbacks @ startup_client.js:30ready @ startup_client.js:32 debug.js:41 模板帮助程序中的异常:TypeError:无法在 http://localhost:3000/packages/kadira_debug.js 处读取 Object.showError ( http://localhost:3000/packages/useraccounts_core.js?e3a764dbf634d8bf2a393797c0a82e9fadef2e7a:1555:41 )处未定义的属性表单?49a4c0aadab9f87c37a2964e832426eebd091e3c:469:23 at withValue ( http://localhost:3000/packages/meteor.js?9730f4ff059088b3f7f14c0672d155218a1802d4:971:17 ) at Store.onTracking ( http://localhost:3000/packages/kadira_debug.js?49a4c0aadab9f87c37a2964e832426eebd091e3c: 157:28) 在 Object.dict.(匿名函数) ( http://localhost:3000/packages/kadira_debug.js?49a4c0aadab9f87c37a2964e832426eebd091e3c:468:39 ) 在http://localhost:3000/packages/peerlibrary_blaze-components.js?015e1eb30bedefb1916866695666 373:21http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:1650:16http://localhost:3000/packages/peerlibrary_components.js? 015e1eb30b191686996f3bedblate16f966c56be6ef6 _withTemplateInstanceFunc ( http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3671:12 ) 在http://localhost:3000/packages/peerlibrary_blaze-components.js?015e1eb30b191686996f3bedbd6f966c5b6ef6c1:391:27

4

0 回答 0