We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在User\Login\index.tsx,用户登录成功后,保存数据到currentUser //保存用户等信息 if (msg) { flushSync(() => { setInitialState((s) => ({ ...s, currentUser: msg.data,
})); }); }
currentUser 的定义 declare namespace API { type CurrentUser = { user_id?: number; owner_id?:number; username?:string; fullname?: string;
**access_token?:string;** is_admin?:number; role_id?:number; avatar?: string; email?: string; signature?: string; title?: string; group?: string; tags?: { key?: string; label?: string }[]; notifyCount?: number; unreadCount?: number; country?: string; access?: string; geographic?: { province?: { label?: string; key?: string }; city?: { label?: string; key?: string }; }; address?: string; phone?: string;
};
在requestErrorConfig.ts中的requestInterceptors里面如何取出这个currentUser 里面的access_token并加到headers中去? 考虑到安全性,不使用localStorage
OS:
Node:
浏览器 | browser:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🧐 问题描述 | Problem description
💻 示例代码 | Sample code
在User\Login\index.tsx,用户登录成功后,保存数据到currentUser
//保存用户等信息
if (msg) {
flushSync(() => {
setInitialState((s) => ({
...s,
currentUser: msg.data,
currentUser 的定义
declare namespace API {
type CurrentUser = {
user_id?: number;
owner_id?:number;
username?:string;
fullname?: string;
};
在requestErrorConfig.ts中的requestInterceptors里面如何取出这个currentUser 里面的access_token并加到headers中去? 考虑到安全性,不使用localStorage
🚑 其他信息 | Other information
OS:
Node:
浏览器 | browser:
The text was updated successfully, but these errors were encountered: