优化缓存机制

This commit is contained in:
kuaifan 2021-12-19 17:29:58 +08:00
parent f69de50ed1
commit 5c2a82b7ee
10 changed files with 52 additions and 17 deletions

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.3.81",
"version": "0.3.88",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",

15
public/css/app.css vendored
View File

@ -4502,6 +4502,7 @@ body .ivu-select-dropdown.select-node .ivu-select-item .option-title {
}
body .ivu-select-dropdown.select-node .ivu-select-item .ivu-tag {
flex-shrink: 0;
margin-left: 18px;
margin-right: 0;
transform: scale(0.9);
@ -9295,16 +9296,20 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
}
.project-management .project-name {
line-height: 1;
display: flex;
align-items: center;
}
.project-management .project-name .ivu-tag {
height: 18px;
line-height: 18px;
padding: 0 4px;
margin: 0 -2px 0 0;
transform: scale(0.8);
transform-origin: left bottom;
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.project-management .project-percent {
@ -10367,5 +10372,9 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
padding: 0 4px;
transform: scale(0.8);
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -742,7 +742,10 @@
* @returns {*}
*/
urlAddParams(url, params) {
if (typeof params === "object" && params !== null) {
if ($A.isJson(params)) {
if (url) {
url = this.removeURLParameter(url, Object.keys(params))
}
url+= "";
url+= url.indexOf("?") === -1 ? '?' : '';
for (var key in params) {

View File

@ -217,6 +217,12 @@ export default {
},
mounted() {
if ($A.getObject(this.$route.query, '_cc')) {
this.$store.state.method.clearLocal();
this.$store.dispatch("saveUserInfo", this.userInfo);
$A.messageSuccess("清除成功");
}
//
this.$store.dispatch("getUserInfo");
this.$store.dispatch("getTaskPriority");
//
@ -420,9 +426,7 @@ export default {
this.archivedProjectShow = true;
return;
case 'clearCache':
this.$store.state.method.clearLocal();
this.$store.dispatch("saveUserInfo", this.userInfo);
$A.messageSuccess("清除成功");
this.$store.dispatch("clearCache");
return;
case 'signout':
$A.modalConfirm({

View File

@ -298,10 +298,20 @@ export default {
*/
logout({state, dispatch}) {
state.method.clearLocal();
dispatch("saveUserInfo", {}).then(() => {
const from = window.location.pathname == '/' ? '' : encodeURIComponent(window.location.href);
$A.goForward({path: '/login', query: from ? {from: from} : {}}, true);
});
dispatch("saveUserInfo", {});
const from = ["/", "/login"].includes(window.location.pathname) ? "" : encodeURIComponent(window.location.href);
window.location.href = $A.urlAddParams(window.systemInformation.origin + "login", from ? {from: from} : {})
},
/**
* 清除缓存
* @param state
* @param dispatch
*/
clearCache({state, dispatch}) {
state.method.clearLocal();
dispatch("saveUserInfo", state.userInfo);
window.location.href = $A.urlAddParams(window.location.href, {'_cc': $A.randomString(6)})
},
/** *****************************************************************************************/

View File

@ -15,6 +15,7 @@ body {
flex: 1;
}
.ivu-tag {
flex-shrink: 0;
margin-left: 18px;
margin-right: 0;
transform: scale(0.9);

View File

@ -14,14 +14,18 @@
margin-bottom: 24px;
}
.project-name {
line-height: 1;
display: flex;
align-items: center;
.ivu-tag {
height: 18px;
line-height: 18px;
padding: 0 4px;
margin: 0 -2px 0 0;
transform: scale(0.8);
transform-origin: left bottom;
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
}
.project-percent {

View File

@ -22,6 +22,10 @@
padding: 0 4px;
transform: scale(0.8);
transform-origin: right center;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
}
}