1

来自 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,但是如何按照最佳实践实现指向这些地址的函数呢?

4

1 回答 1

0

有一个名为 HtAuth 的包具有执行此操作的功能。

于 2016-08-30T10:11:10.733 回答