mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	Merge branch 'main' into feat/headerNotice
This commit is contained in:
		
						commit
						12492a522f
					
				@ -208,14 +208,15 @@ router.beforeEach((to, _from, next) => {
 | 
			
		||||
  const name = storageSession.getItem("info");
 | 
			
		||||
  NProgress.start();
 | 
			
		||||
  const externalLink = to?.redirectedFrom?.fullPath;
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  // const { t } = i18n.global;
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  if (!externalLink)
 | 
			
		||||
    to.meta.title
 | 
			
		||||
      ? // @ts-ignore
 | 
			
		||||
        (document.title = transformI18n(to.meta.title, to.meta.i18n))
 | 
			
		||||
      : "";
 | 
			
		||||
    to.matched.some(item => {
 | 
			
		||||
      item.meta.title
 | 
			
		||||
        ? (document.title = transformI18n(
 | 
			
		||||
            item.meta.title as string,
 | 
			
		||||
            item.meta?.i18n as boolean
 | 
			
		||||
          ))
 | 
			
		||||
        : "";
 | 
			
		||||
    });
 | 
			
		||||
  if (name) {
 | 
			
		||||
    if (_from?.name) {
 | 
			
		||||
      // 如果路由包含http 则是超链接 反之是普通路由
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,12 @@
 | 
			
		||||
import { i18n } from "../plugins/i18n";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 消息转换
 | 
			
		||||
 * @param message message
 | 
			
		||||
 * @param isI18n  如果true,获取对应的消息,否则返回this
 | 
			
		||||
 * @returns message
 | 
			
		||||
 */
 | 
			
		||||
export function transformI18n(message = "", isI18n: Boolean = false) {
 | 
			
		||||
export function transformI18n(message = "", isI18n = false) {
 | 
			
		||||
  if (!message) {
 | 
			
		||||
    return "";
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,7 @@ class sessionStorageProxy implements ProxyStorage {
 | 
			
		||||
 | 
			
		||||
  // 取
 | 
			
		||||
  public getItem(key: string): any {
 | 
			
		||||
    return JSON.parse(this.storage.getItem(key)) || null;
 | 
			
		||||
    return JSON.parse(this.storage.getItem(key));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // 删
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,8 @@ export const injectResponsiveStorage = (app: App, config: ServerConfigs) => {
 | 
			
		||||
          parentPath: "/",
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: "message.hshome",
 | 
			
		||||
            icon: "el-icon-s-home",
 | 
			
		||||
            i18n: true,
 | 
			
		||||
            icon: "HomeFilled",
 | 
			
		||||
            showLink: true
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user