Browse Source

Merge pull request #1077 from colinin/refresh-token

 feat: 启用刷新token.
pull/1091/head
yx lin 1 year ago
committed by GitHub
parent
commit
c524358dec
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      apps/vben5/apps/app-antd/src/locales/index.ts
  2. 3
      apps/vben5/apps/app-antd/src/locales/langs/en-US/component.json
  3. 3
      apps/vben5/apps/app-antd/src/locales/langs/zh-CN/component.json
  4. 1
      apps/vben5/apps/app-antd/src/preferences.ts
  5. 11
      apps/vben5/packages/effects/hooks/src/use-app-config.ts

3
apps/vben5/apps/app-antd/src/locales/index.ts

@ -16,7 +16,7 @@ import antdEnLocale from 'ant-design-vue/es/locale/en_US';
import antdDefaultLocale from 'ant-design-vue/es/locale/zh_CN'; import antdDefaultLocale from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { getLocalizationApi } from '#/api/core'; import { useAbpConfigApi } from '#/api/core/useAbpConfigApi';
const antdLocale = ref<Locale>(antdDefaultLocale); const antdLocale = ref<Locale>(antdDefaultLocale);
@ -101,6 +101,7 @@ async function loadAntdLocale(lang: SupportedLanguagesType) {
*/ */
async function loadAbpLocale(lang: SupportedLanguagesType) { async function loadAbpLocale(lang: SupportedLanguagesType) {
const abpStore = useAbpStore(); const abpStore = useAbpStore();
const { getLocalizationApi } = useAbpConfigApi();
let localization = abpStore.localization; let localization = abpStore.localization;
if (lang !== localization?.currentCulture.cultureName) { if (lang !== localization?.currentCulture.cultureName) {

3
apps/vben5/apps/app-antd/src/locales/langs/en-US/component.json

@ -116,5 +116,8 @@
"requiresAllDesc": "If checked, you need to have all the selected permissions.", "requiresAllDesc": "If checked, you need to have all the selected permissions.",
"permissions": "Required Permissions" "permissions": "Required Permissions"
} }
},
"table": {
"selectedItemWellBeDeleted": "Multiple items selected will be deleted!"
} }
} }

3
apps/vben5/apps/app-antd/src/locales/langs/zh-CN/component.json

@ -116,5 +116,8 @@
"requiresAllDesc": "如果勾选,则需要拥有所有选择的权限.", "requiresAllDesc": "如果勾选,则需要拥有所有选择的权限.",
"permissions": "需要的权限" "permissions": "需要的权限"
} }
},
"table": {
"selectedItemWellBeDeleted": "选择的多个项目将被删除!"
} }
} }

1
apps/vben5/apps/app-antd/src/preferences.ts

@ -8,6 +8,7 @@ import { defineOverridesPreferences } from '@vben/preferences';
export const overridesPreferences = defineOverridesPreferences({ export const overridesPreferences = defineOverridesPreferences({
// overrides // overrides
app: { app: {
enableRefreshToken: true,
name: import.meta.env.VITE_APP_TITLE, name: import.meta.env.VITE_APP_TITLE,
}, },
}); });

11
apps/vben5/packages/effects/hooks/src/use-app-config.ts

@ -15,11 +15,18 @@ export function useAppConfig(
? window._VBEN_ADMIN_PRO_APP_CONF_ ? window._VBEN_ADMIN_PRO_APP_CONF_
: (env as VbenAdminProAppConfigRaw); : (env as VbenAdminProAppConfigRaw);
const { VITE_GLOB_API_URL, VITE_GLOB_CLIENT_ID, VITE_GLOB_CLIENT_SECRET } = const {
config; VITE_GLOB_API_URL,
VITE_GLOB_AUTHORITY,
VITE_GLOB_AUDIENCE,
VITE_GLOB_CLIENT_ID,
VITE_GLOB_CLIENT_SECRET,
} = config;
return { return {
apiURL: VITE_GLOB_API_URL, apiURL: VITE_GLOB_API_URL,
authority: VITE_GLOB_AUTHORITY,
audience: VITE_GLOB_AUDIENCE,
clientId: VITE_GLOB_CLIENT_ID, clientId: VITE_GLOB_CLIENT_ID,
clientSecret: VITE_GLOB_CLIENT_SECRET, clientSecret: VITE_GLOB_CLIENT_SECRET,
}; };

Loading…
Cancel
Save