来自 Backand 在https://github.com/backand/backand-ionic2-starter中提供的示例
我可以在服务中看到(https://github.com/backand/backand-ionic2-starter/blob/master/app/services/backandService.ts):
urls:{
signup:string,
token:string,
requestResetPassword: string,
resetPassword: string,
changePassword: string,
socialLoginWithCode: string,
socialSignupWithCode: string,
socialLoginWithToken: string
} = {
signup: '/1/user/signup',
token: '/token',
requestResetPassword: '/1/user/requestResetPassword',
resetPassword: '/1/user/resetPassword',
changePassword: '/1/user/changePassword',
socialLoginWithCode: '/1/user/PROVIDER/code',
socialSignupWithCode: '/1/user/PROVIDER/signupCode',
socialLoginWithToken: '/1/user/PROVIDER/token'
};
所以我的猜测是,在 socialLoginWithCode、socialSignupWithCode 或 socialLoginWithToken、PROVIDER 中声明的字符串应该是 facebook、twitter 或 google,但是如何按照最佳实践实现指向这些地址的函数呢?