mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: 修复清空缓存并返回登录页时未清空主题
This commit is contained in:
		
							parent
							
								
									b1bce9f4ce
								
							
						
					
					
						commit
						e50d13a84a
					
				@ -132,6 +132,8 @@ const multiTagsCacheChange = () => {
 | 
			
		||||
/** 清空缓存并返回登录页 */
 | 
			
		||||
function onReset() {
 | 
			
		||||
  router.push("/login");
 | 
			
		||||
  storageLocal.clear();
 | 
			
		||||
  storageSession.clear();
 | 
			
		||||
  const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
 | 
			
		||||
  useAppStoreHook().setLayout(Layout);
 | 
			
		||||
  setEpThemeColor(EpThemeColor);
 | 
			
		||||
@ -139,8 +141,6 @@ function onReset() {
 | 
			
		||||
  toggleClass(Grey, "html-grey", document.querySelector("html"));
 | 
			
		||||
  toggleClass(Weak, "html-weakness", document.querySelector("html"));
 | 
			
		||||
  useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
 | 
			
		||||
  storageLocal.clear();
 | 
			
		||||
  storageSession.clear();
 | 
			
		||||
  resetRouter();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -34,6 +34,7 @@ export const useEpThemeStore = defineStore({
 | 
			
		||||
      const layout = storageLocal.getItem<StorageConfigs>("responsive-layout");
 | 
			
		||||
      this.epTheme = layout?.theme;
 | 
			
		||||
      this.epThemeColor = newColor;
 | 
			
		||||
      if (!layout) return;
 | 
			
		||||
      layout.epThemeColor = newColor;
 | 
			
		||||
      storageLocal.setItem("responsive-layout", layout);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user