mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 15:26:36 +08:00
[优化] 更新认证机制,使用 OPENFLARE_TOKEN 替代 Bearer Token
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { apiRequest } from '@/lib/api/client';
|
||||
import { setStoredOpenFlareToken } from '@/lib/api/auth-token';
|
||||
|
||||
import type {
|
||||
BootstrapTokenPayload,
|
||||
@@ -109,7 +110,10 @@ export function updateSelf(payload: UpdateSelfPayload) {
|
||||
}
|
||||
|
||||
export function generateAccessToken() {
|
||||
return apiRequest<string>('/user/token');
|
||||
return apiRequest<string>('/user/token').then((token) => {
|
||||
setStoredOpenFlareToken(token);
|
||||
return token;
|
||||
});
|
||||
}
|
||||
|
||||
export function bindWeChat(code: string) {
|
||||
|
||||
Reference in New Issue
Block a user