firemail

标题: MailSpring源码分析--Identity [打印本页]

作者: Qter    时间: 2020-10-12 17:30
标题: MailSpring源码分析--Identity
本帖最后由 Qter 于 2020-10-12 17:59 编辑

从认证网页返回的内容:
  1. "onboarding-store _onIdentityJSONReceived Identity:{"id":"8a3cd9bc-1dc8-4990-a10a-e847cd52b08f","token":"2345f726-f462-4e0c-beef-ff38215acf92","firstName":"cj","lastName":"h","emailAddress":"hechengjin@gmail.com","object":"identity","createdAt":"2020-07-22T12:07:06.000Z","stripePlan":"Basic","stripePlanEffective":"Basic","stripeCustomerId":"cus_Hh4ss83bZPzwmf","stripePeriodEnd":"2020-10-22T12:07:06.000Z","featureUsage":{"snooze":{"quota":15,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"send-later":{"quota":5,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"thread-sharing":{"quota":3,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"link-tracking":{"quota":5,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"open-tracking":{"quota":5,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"contact-profiles":{"quota":3,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"send-reminders":{"quota":5,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"},"translation":{"quota":50,"period":"weekly","usedInPeriod":0,"featureLimitName":"basic-limit"}}}"
复制代码
app\internal_packages\onboarding\lib\onboarding-store.ts
  _onIdentityJSONReceived = async json => {
   await IdentityStore.saveIdentity(json);
  }

  this.listenTo(OnboardingActions.identityJSONReceived, this._onIdentityJSONReceived);

app\internal_packages\onboarding\lib\onboarding-actions.ts
export const identityJSONReceived = Reflux.createAction('identityJSONReceived');
identityJSONReceived.sync = true;

app\internal_packages\onboarding\lib\page-authenticate.tsx
_onDidFinishLoad = webview => {
  OnboardingActions.identityJSONReceived(JSON.parse(atob(result)));
}





欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3