有一个带有方法的角项目:
createUSer() {
let params = new HttpParams()
params.append("email","sdfsd@sdsvvvvdf.com")
params.append("password","sdfdfd121")
this.htpClien.get(this.baseUrsl+"createEmployee",
{params:params}).subscribe(sub=>{
})
}
和我的firebase函数中的函数:
exports.createEmployee = functions.https.onRequest((request, response)=>{
if (request.method === 'GET') {
let email = request.query.email;
let password = request.query.password;
admin.auth().createUser({
email: email,
emailVerified: false,
password: password,
disabled: false
}).then(succes => {
response.send(succes.uid)
}).catch(er => {
response.send(er)
})
}
});
通过“postman”进行测试时,一切都按照应有的方式进行,但是当我通过Angular解决它时,我会收到电子邮件和密码的“未定义”值...我做错了什么?:S