Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
fedd9cae
提交
fedd9cae
authored
3月 23, 2021
作者:
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip: cache miss
上级
5bf90eea
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
8 行增加
和
5 行删除
+8
-5
main.ts
src/main.ts
+4
-1
projectSetting.ts
src/settings/projectSetting.ts
+1
-1
index.ts
src/utils/auth/index.ts
+1
-1
memory.ts
src/utils/cache/memory.ts
+1
-1
persistent.ts
src/utils/cache/persistent.ts
+1
-1
没有找到文件。
src/main.ts
浏览文件 @
fedd9cae
...
...
@@ -32,6 +32,9 @@ import { isDevMode } from '/@/utils/env';
// Register global components
registerGlobComp
(
app
);
// Multilingual configuration
await
setupI18n
(
app
);
// Configure routing
setupRouter
(
app
);
...
...
@@ -45,7 +48,7 @@ import { isDevMode } from '/@/utils/env';
setupErrorHandle
(
app
);
// Mount when the route is ready
await
Promise
.
all
([
setupI18n
(
app
),
router
.
isReady
()]
);
await
router
.
isReady
(
);
app
.
mount
(
'#app'
,
true
);
...
...
src/settings/projectSetting.ts
浏览文件 @
fedd9cae
...
...
@@ -23,7 +23,7 @@ const setting: ProjectConfig = {
permissionMode
:
PermissionModeEnum
.
ROLE
,
// Permission-related cache is stored in sessionStorage or localStorage
permissionCacheType
:
CacheTypeEnum
.
SESSION
,
permissionCacheType
:
CacheTypeEnum
.
LOCAL
,
// color
themeColor
:
primaryColor
,
...
...
src/utils/auth/index.ts
浏览文件 @
fedd9cae
...
...
@@ -17,5 +17,5 @@ export function getAuthCache<T>(key: BasicKeys) {
export
function
setAuthCache
(
key
:
BasicKeys
,
value
)
{
const
fn
=
isLocal
?
Persistent
.
setLocal
:
Persistent
.
setSession
;
return
fn
(
key
,
value
);
return
fn
(
key
,
value
,
true
);
}
src/utils/cache/memory.ts
浏览文件 @
fedd9cae
...
...
@@ -59,7 +59,7 @@ export class Memory<T = any, V = any> {
}
item
.
time
=
new
Date
().
getTime
()
+
this
.
alive
;
item
.
timeoutId
=
setTimeout
(()
=>
{
this
.
remove
(
key
);
//
this.remove(key);
},
expires
);
return
value
;
...
...
src/utils/cache/persistent.ts
浏览文件 @
fedd9cae
...
...
@@ -69,7 +69,7 @@ export class Persistent {
static
setSession
(
key
:
SessionKeys
,
value
:
SessionStore
[
SessionKeys
],
immediate
=
false
):
void
{
sessionMemory
.
set
(
key
,
toRaw
(
value
));
immediate
&&
ss
.
set
(
APP_SESSION_CACHE_KEY
,
sessionMemory
);
immediate
&&
ss
.
set
(
APP_SESSION_CACHE_KEY
,
sessionMemory
.
getCache
);
}
static
removeSession
(
key
:
SessionKeys
):
void
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论