mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-04 12:56:02 +00:00
feat: 用户账户系统
This commit is contained in:
@@ -16,6 +16,16 @@ export function registerPlugins (app) {
|
||||
.use(router)
|
||||
.use(store)
|
||||
|
||||
// 读取用户令牌
|
||||
const token = localStorage.getItem('user-token')
|
||||
|
||||
if (token) {
|
||||
store.state.user.jwtToken = token
|
||||
}
|
||||
|
||||
// 所有axios请求均携带用户令牌
|
||||
axios.defaults.headers.common['Authorization'] = `Bearer ${store.state.user.jwtToken}`
|
||||
|
||||
app.config.globalProperties.$axios = axios
|
||||
store.commit('initializeFetch')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user