-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add isValid getter to auth store and use it for permission checks (#528)
* Remove commented-out code and unnecessary comments in chat store module. * Sort chat sessions by ID in descending order and sync sessions in chat store. * Make `addChatSession` method asynchronous and await its calls in chat store and sider component. * Add `isValid` getter to auth store and use it for permission checks in admin, bot, chat, and snapshot views. * Refactor snapshot view: remove unused imports, simplify variable names, and improve error handling. * Add API token fetching function in `web/src/api/token.ts` * Refactor bot view to use `fetchAPIToken` and improve variable naming.
- Loading branch information
Showing
6 changed files
with
120 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import request from '@/utils/request/axios' | ||
|
||
export async function fetchAPIToken() { | ||
try { | ||
const response = await request.get('/token_10years') | ||
return response.data | ||
} catch (error) { | ||
throw error | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.