mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-21 02:56:38 +08:00
Merge branch 'main' into example
This commit is contained in:
commit
599d0f10e8
20
CHANGELOG.md
20
CHANGELOG.md
@ -1,6 +1,26 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## [v1.2.1](https://github.com/honghuangdc/soybean-admin/compare/v1.2.0...v1.2.1) (2024-06-07)
|
||||
|
||||
### 🐞 Bug Fixes
|
||||
|
||||
- **projects**:
|
||||
- fix get user info when page reload - by @soybeanjs [<samp>(ff51b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ff51b72)
|
||||
- fix setupAppVersionNotification render - by @soybeanjs [<samp>(6a6eb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6a6eb9a)
|
||||
|
||||
### 📖 Documentation
|
||||
|
||||
- **projects**: update CHANGELOG - by @soybeanjs [<samp>(fe06b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/fe06b8c)
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **deps**: update deps - by @soybeanjs [<samp>(08827)</samp>](https://github.com/honghuangdc/soybean-admin/commit/08827a4)
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
[](https://github.com/soybeanjs)
|
||||
|
||||
## [v1.2.0](https://github.com/soybeanjs/soybean-admin/compare/v1.1.5...v1.2.0) (2024-06-06)
|
||||
|
||||
### 🚀 Features
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "soybean-admin",
|
||||
"type": "module",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||
"author": {
|
||||
"name": "Soybean",
|
||||
@ -78,7 +78,7 @@
|
||||
"devDependencies": {
|
||||
"@amap/amap-jsapi-types": "0.0.8",
|
||||
"@elegant-router/vue": "0.3.7",
|
||||
"@iconify/json": "2.2.216",
|
||||
"@iconify/json": "2.2.217",
|
||||
"@sa/scripts": "workspace:*",
|
||||
"@sa/uno-preset": "workspace:*",
|
||||
"@soybeanjs/eslint-config": "1.3.6",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/axios",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/color",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/hooks",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/materials",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/fetch",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/scripts",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"bin": {
|
||||
"sa": "./bin.ts"
|
||||
},
|
||||
@ -19,7 +19,7 @@
|
||||
"cac": "6.7.14",
|
||||
"consola": "3.2.3",
|
||||
"enquirer": "2.4.1",
|
||||
"execa": "9.1.0",
|
||||
"execa": "9.2.0",
|
||||
"kolorist": "1.8.0",
|
||||
"npm-check-updates": "16.14.20",
|
||||
"rimraf": "5.0.7"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/uno-preset",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/utils",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@ -100,8 +100,8 @@ importers:
|
||||
specifier: 0.3.7
|
||||
version: 0.3.7
|
||||
'@iconify/json':
|
||||
specifier: 2.2.216
|
||||
version: 2.2.216
|
||||
specifier: 2.2.217
|
||||
version: 2.2.217
|
||||
'@sa/scripts':
|
||||
specifier: workspace:*
|
||||
version: link:packages/scripts
|
||||
@ -267,8 +267,8 @@ importers:
|
||||
specifier: 2.4.1
|
||||
version: 2.4.1
|
||||
execa:
|
||||
specifier: 9.1.0
|
||||
version: 9.1.0
|
||||
specifier: 9.2.0
|
||||
version: 9.2.0
|
||||
kolorist:
|
||||
specifier: 1.8.0
|
||||
version: 1.8.0
|
||||
@ -770,8 +770,8 @@ packages:
|
||||
resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==}
|
||||
engines: {node: '>=18.18'}
|
||||
|
||||
'@iconify/json@2.2.216':
|
||||
resolution: {integrity: sha512-dS2yVIAel1oIAGnaxR+EJyDRjKV9GGm9tUd8Pd8VEF91HB4HJrsMzkvz23GHDWyIITGdinx4ZUjMz3hOAv+D4Q==}
|
||||
'@iconify/json@2.2.217':
|
||||
resolution: {integrity: sha512-+sSR9iKsoThUmgG4wA9xdtyazROIqMOo5h5otOXYRyOQjMNJCpJltq5hEhHInC5aG/DUQmXDiN/YsCoJdCYUbQ==}
|
||||
|
||||
'@iconify/types@2.0.0':
|
||||
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
|
||||
@ -2189,8 +2189,8 @@ packages:
|
||||
echarts@5.5.0:
|
||||
resolution: {integrity: sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==}
|
||||
|
||||
electron-to-chromium@1.4.792:
|
||||
resolution: {integrity: sha512-rkg5/N3L+Y844JyfgPUyuKK0Hk0efo3JNxUDKvz3HgP6EmN4rNGhr2D8boLsfTV/hGo7ZGAL8djw+jlg99zQyA==}
|
||||
electron-to-chromium@1.4.794:
|
||||
resolution: {integrity: sha512-6FApLtsYhDCY0Vglq3AptsdxQ+PJLc6AxlAM0HjEihUAiOPPbkASEsq9gtxUeZY9o0sJIEa3WnF0vVH4VT4iug==}
|
||||
|
||||
emoji-regex@10.3.0:
|
||||
resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==}
|
||||
@ -2313,8 +2313,8 @@ packages:
|
||||
eslint-parser-plain@0.1.0:
|
||||
resolution: {integrity: sha512-oOeA6FWU0UJT/Rxc3XF5Cq0nbIZbylm7j8+plqq0CZoE6m4u32OXJrR+9iy4srGMmF6v6pmgvP1zPxSRIGh3sg==}
|
||||
|
||||
eslint-plugin-es-x@7.6.0:
|
||||
resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==}
|
||||
eslint-plugin-es-x@7.7.0:
|
||||
resolution: {integrity: sha512-aP3qj8BwiEDPttxQkZdI221DLKq9sI/qHolE2YSQL1/9+xk7dTV+tB1Fz8/IaCA+lnLA1bDEnvaS2LKs0k2Uig==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
eslint: '>=8'
|
||||
@ -2442,6 +2442,10 @@ packages:
|
||||
resolution: {integrity: sha512-lSgHc4Elo2m6bUDhc3Hl/VxvUDJdQWI40RZ4KMY9bKRc+hgMOT7II/JjbNDhI8VnMtrCb7U/fhpJIkLORZozWw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
execa@9.2.0:
|
||||
resolution: {integrity: sha512-vpOyYg7UAVKLAWWtRS2gAdgkT7oJbCn0me3gmUmxZih4kd3MF/oo8kNTBTIbkO3yuuF5uB4ZCZfn8BOolITYhg==}
|
||||
engines: {node: ^18.19.0 || >=20.5.0}
|
||||
|
||||
expand-brackets@2.1.4:
|
||||
resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@ -5740,7 +5744,7 @@ snapshots:
|
||||
|
||||
'@humanwhocodes/retry@0.3.0': {}
|
||||
|
||||
'@iconify/json@2.2.216':
|
||||
'@iconify/json@2.2.217':
|
||||
dependencies:
|
||||
'@iconify/types': 2.0.0
|
||||
pathe: 1.1.2
|
||||
@ -6652,7 +6656,7 @@ snapshots:
|
||||
browserslist@4.23.0:
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001629
|
||||
electron-to-chromium: 1.4.792
|
||||
electron-to-chromium: 1.4.794
|
||||
node-releases: 2.0.14
|
||||
update-browserslist-db: 1.0.16(browserslist@4.23.0)
|
||||
|
||||
@ -7317,7 +7321,7 @@ snapshots:
|
||||
tslib: 2.3.0
|
||||
zrender: 5.5.0
|
||||
|
||||
electron-to-chromium@1.4.792: {}
|
||||
electron-to-chromium@1.4.794: {}
|
||||
|
||||
emoji-regex@10.3.0: {}
|
||||
|
||||
@ -7500,7 +7504,7 @@ snapshots:
|
||||
|
||||
eslint-parser-plain@0.1.0: {}
|
||||
|
||||
eslint-plugin-es-x@7.6.0(eslint@9.4.0):
|
||||
eslint-plugin-es-x@7.7.0(eslint@9.4.0):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0)
|
||||
'@eslint-community/regexpp': 4.10.1
|
||||
@ -7528,7 +7532,7 @@ snapshots:
|
||||
'@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0)
|
||||
enhanced-resolve: 5.17.0
|
||||
eslint: 9.4.0
|
||||
eslint-plugin-es-x: 7.6.0(eslint@9.4.0)
|
||||
eslint-plugin-es-x: 7.7.0(eslint@9.4.0)
|
||||
get-tsconfig: 4.7.5
|
||||
globals: 15.3.0
|
||||
ignore: 5.3.1
|
||||
@ -7720,6 +7724,21 @@ snapshots:
|
||||
strip-final-newline: 4.0.0
|
||||
yoctocolors: 2.0.2
|
||||
|
||||
execa@9.2.0:
|
||||
dependencies:
|
||||
'@sindresorhus/merge-streams': 4.0.0
|
||||
cross-spawn: 7.0.3
|
||||
figures: 6.1.0
|
||||
get-stream: 9.0.1
|
||||
human-signals: 7.0.0
|
||||
is-plain-obj: 4.1.0
|
||||
is-stream: 4.0.1
|
||||
npm-run-path: 5.3.0
|
||||
pretty-ms: 9.0.0
|
||||
signal-exit: 4.1.0
|
||||
strip-final-newline: 4.0.0
|
||||
yoctocolors: 2.0.2
|
||||
|
||||
expand-brackets@2.1.4:
|
||||
dependencies:
|
||||
debug: 2.6.9
|
||||
|
@ -19,7 +19,7 @@ export function setupAppVersionNotification() {
|
||||
n?.destroy();
|
||||
}
|
||||
},
|
||||
$t('system.updateCancel')
|
||||
() => $t('system.updateCancel')
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
@ -29,7 +29,7 @@ export function setupAppVersionNotification() {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
$t('system.updateConfirm')
|
||||
() => $t('system.updateConfirm')
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
@ -126,9 +126,6 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
|
||||
// the auth route is initialized
|
||||
// it is not the "not-found" route, then it is allowed to access
|
||||
if (routeStore.isInitAuthRoute && !isNotFoundRoute) {
|
||||
// update user info
|
||||
await authStore.updateUserInfo();
|
||||
|
||||
return null;
|
||||
}
|
||||
// it is captured by the "not-found" route, then check whether the route exists
|
||||
@ -164,6 +161,8 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
|
||||
return location;
|
||||
}
|
||||
|
||||
await authStore.initUserInfo();
|
||||
|
||||
// initialize the auth route
|
||||
await routeStore.initAuthRoute();
|
||||
|
||||
|
@ -92,8 +92,8 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
localStg.set('token', loginToken.token);
|
||||
localStg.set('refreshToken', loginToken.refreshToken);
|
||||
|
||||
// 2. get user info and update store
|
||||
const pass = await updateUserInfo();
|
||||
// 2. get user info
|
||||
const pass = await getUserInfo();
|
||||
|
||||
if (pass) {
|
||||
token.value = loginToken.token;
|
||||
@ -104,7 +104,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
return false;
|
||||
}
|
||||
|
||||
async function updateUserInfo() {
|
||||
async function getUserInfo() {
|
||||
const { data: info, error } = await fetchGetUserInfo();
|
||||
|
||||
if (!error) {
|
||||
@ -117,6 +117,18 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
return false;
|
||||
}
|
||||
|
||||
async function initUserInfo() {
|
||||
const hasToken = getToken();
|
||||
|
||||
if (hasToken) {
|
||||
const pass = await getUserInfo();
|
||||
|
||||
if (!pass) {
|
||||
resetStore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
token,
|
||||
userInfo,
|
||||
@ -125,6 +137,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
loginLoading,
|
||||
resetStore,
|
||||
login,
|
||||
updateUserInfo
|
||||
initUserInfo
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user