mirror of https://github.com/halo-dev/halo-admin
fix: the problem of incorrect hint of opening developer option (#693)
parent
84c88825a9
commit
acfc86f9f3
|
@ -31,10 +31,14 @@ export default {
|
||||||
...mapActions(['refreshOptionsCache']),
|
...mapActions(['refreshOptionsCache']),
|
||||||
onLogoClick: throttle(async function () {
|
onLogoClick: throttle(async function () {
|
||||||
this.clickCount++
|
this.clickCount++
|
||||||
if (this.clickCount === 10) {
|
if (this.options.developer_mode) {
|
||||||
|
this.$message.info(`当前已启用开发者选项!`)
|
||||||
|
this.clickCount = 0
|
||||||
|
} else if (this.clickCount < 10) {
|
||||||
|
this.$message.info(`再点击 ${10 - this.clickCount} 次即可启用开发者选项!`)
|
||||||
|
} else if (this.clickCount === 10) {
|
||||||
try {
|
try {
|
||||||
await apiClient.option.saveMapView({ developer_mode: true })
|
await apiClient.option.saveMapView({ developer_mode: true })
|
||||||
|
|
||||||
await this.refreshOptionsCache()
|
await this.refreshOptionsCache()
|
||||||
this.$message.success(`开发者选项已启用!`)
|
this.$message.success(`开发者选项已启用!`)
|
||||||
this.clickCount = 0
|
this.clickCount = 0
|
||||||
|
@ -43,14 +47,8 @@ export default {
|
||||||
this.$log.error(e)
|
this.$log.error(e)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
|
||||||
if (this.clickCount >= 5) {
|
|
||||||
if (this.options.developer_mode) {
|
|
||||||
this.$message.info(`当前已启用开发者选项!`)
|
|
||||||
this.clickCount = 0
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.info(`再点击 ${10 - this.clickCount} 次即可启用开发者选项!`)
|
this.$message.info('正在启用开发者选项!')
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue