meteor accounts-ui-bootstrap-3 电子邮件注册表单不显示电子邮件字段
meteor accounts-ui-bootstrap-3 email signup form does NOT show email field
流星新手。
配置帐户时遇到问题-ui-bootstrap-3。 {{> loginButtons}} 显示正常,但单击时没有电子邮件地址字段!
在服务器>accounts.js我有
// setup accounts on meteor startup
Meteor.startup(function(){
// configure accounts
Accounts.config({
sendVerificationEmail: true,
forbidClientAccountCreation: false
});
});
我安装了以下软件包:
meteor-platform
autopublish
insecure
jquery
iron:router
dburles:google-maps
accounts-password
twbs:bootstrap
ian:accounts-ui-bootstrap-3
accounts-facebook
email
accounts-google
accounts-twitter
几个问题:
正如 uZar 所指出的,需要安装 accounts-base。
此外,需要在客户端和服务器端配置帐户。
在服务器上:
Meteor.startup(function(){
// setup to send email
smtp = {
username: 'xxxxx', // eg: server@gentlenode.com
password: 'xxxxx', // eg: 3eeP1gtizk5eziohfervU
server: 'xxxxx', // eg: mail.gandi.net
port: 587
};
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port + '/';
// configure accounts
Accounts.config({
sendVerificationEmail: true,
forbidClientAccountCreation: false
});
...
});
在客户端:
// configure accounts
Accounts.ui.config({
passwordSignupFields: 'USERNAME_AND_EMAIL'
});
如果要在注册中添加字段,在客户端:
Accounts.ui.config({
requestPermissions: {},
extraSignupFields: [{
fieldName: 'terms',
fieldLabel: 'I accept the terms and conditions',
inputType: 'checkbox',
visible: true,
validate: function(value, errorFunction){
if (value != 'true') {
errorFunction("You must accept the terms and conditions.");
return false;
} else {
return true;
}
},
saveToProfile: false
}]
});
流星新手。
配置帐户时遇到问题-ui-bootstrap-3。 {{> loginButtons}} 显示正常,但单击时没有电子邮件地址字段!
在服务器>accounts.js我有
// setup accounts on meteor startup
Meteor.startup(function(){
// configure accounts
Accounts.config({
sendVerificationEmail: true,
forbidClientAccountCreation: false
});
});
我安装了以下软件包:
meteor-platform
autopublish
insecure
jquery
iron:router
dburles:google-maps
accounts-password
twbs:bootstrap
ian:accounts-ui-bootstrap-3
accounts-facebook
email
accounts-google
accounts-twitter
几个问题:
正如 uZar 所指出的,需要安装 accounts-base。
此外,需要在客户端和服务器端配置帐户。
在服务器上:
Meteor.startup(function(){
// setup to send email
smtp = {
username: 'xxxxx', // eg: server@gentlenode.com
password: 'xxxxx', // eg: 3eeP1gtizk5eziohfervU
server: 'xxxxx', // eg: mail.gandi.net
port: 587
};
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port + '/';
// configure accounts
Accounts.config({
sendVerificationEmail: true,
forbidClientAccountCreation: false
});
...
});
在客户端:
// configure accounts
Accounts.ui.config({
passwordSignupFields: 'USERNAME_AND_EMAIL'
});
如果要在注册中添加字段,在客户端:
Accounts.ui.config({
requestPermissions: {},
extraSignupFields: [{
fieldName: 'terms',
fieldLabel: 'I accept the terms and conditions',
inputType: 'checkbox',
visible: true,
validate: function(value, errorFunction){
if (value != 'true') {
errorFunction("You must accept the terms and conditions.");
return false;
} else {
return true;
}
},
saveToProfile: false
}]
});