实现缓存策略若干功能

This commit is contained in:
刘祥超
2020-10-04 16:09:50 +08:00
parent 937b07cbf6
commit ed731de9ec
17 changed files with 667 additions and 9 deletions

View File

@@ -0,0 +1,34 @@
Tea.context(function () {
if (this.clusterId == null) {
if (this.clusters.length > 0) {
this.clusterId = this.clusters[0].id
} else {
this.clusterId = 0
}
}
this.isRequesting = false
this.isOk = false
this.message = ""
this.results = []
this.before = function () {
this.isRequesting = true
this.isOk = false
this.message = ""
this.results = []
}
this.success = function (resp) {
this.isOk = true
this.results = resp.data.results
}
this.fail = function (resp) {
this.message = resp.message
}
this.done = function () {
this.isRequesting = false
}
});