Files

30 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PSID 与登录状态流程
[返回外部入口接入说明](./README.md)
通过 `/external-entry` 携带 PSID 进入应用时,按照以下流程保存身份信息并决定是否调用 Facebook Identity 绑定接口。
```mermaid
flowchart TD
A["外部链接进入 /external-entry"] --> B{"是否携带有效 PSID"}
B -- "是" --> C["将 PSID 保存到本地存储"]
B -- "否" --> D["跳过 PSID 保存"]
C --> E["等待 Auth 状态初始化完成"]
D --> E
E --> F{"是否为正式登录用户?"}
F -- "否:Guest 或未登录" --> G["不调用绑定接口"]
F -- "是:Email / Google / Facebook" --> H{"是否存在有效 PSID"}
H -- "否" --> G
H -- "是" --> I["派发 Facebook Identity 绑定请求"]
I --> J["调用绑定接口"]
I --> K["立即跳转到 target 页面"]
J --> L{"绑定结果"}
L -- "成功" --> M["绑定完成"]
L -- "失败" --> N["记录警告并保留原登录状态"]
G --> K
M --> O["不影响当前页面"]
N --> O
```
绑定请求不会阻塞目标页面跳转。通过外部入口进入时如果是 Guest 或未登录状态,本次入口不会调用绑定接口,之后登录也不会自动补调本次绑定。