Skip to content

Commit 8b58742

Browse files
author
Colin Yang
committed
Front - Remved title option of root-showInfo
1 parent f78ad54 commit 8b58742

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed

frontend/tinywebdb-php-vue/src/components/Index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ export default {
7575
setTimeout(() => (this.get_succeed = false), 800)
7676
} catch (e) {
7777
if (e.response && e.response.status === 403) {
78-
this.$root.showInfo('', '获取失败,该标签属于系统保留标签 或 根据设定,浏览器的访问不被允许')
78+
this.$root.showInfo('获取失败,该标签属于系统保留标签 或 根据设定,浏览器的访问不被允许')
7979
} else {
8080
console.error(e)
81-
this.$root.showInfo('', '获取失败,错误信息见console')
81+
this.$root.showInfo('获取失败,错误信息见console')
8282
}
8383
} finally {
8484
onDone()
@@ -91,10 +91,10 @@ export default {
9191
setTimeout(() => (this.store_succeed = false), 800)
9292
} catch (e) {
9393
if (e.response && e.response.status === 403) {
94-
this.$root.showInfo('', '保存失败,该标签属于系统保留标签 或 根据设定,浏览器的访问不被允许')
94+
this.$root.showInfo('保存失败,该标签属于系统保留标签 或 根据设定,浏览器的访问不被允许')
9595
} else {
9696
console.error(e)
97-
this.$root.showInfo('', '保存失败,错误信息见console')
97+
this.$root.showInfo('保存失败,错误信息见console')
9898
}
9999
} finally {
100100
onDone()

frontend/tinywebdb-php-vue/src/components/manage/All.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default {
9898
}
9999
default: {
100100
this.categories = [ { value: '', text: '显示所有' } ]
101-
this.$root.showInfo('', `拉取分类失败,错误码${status}`)
101+
this.$root.showInfo(`拉取分类失败,错误码${status}`)
102102
}
103103
}
104104
this.currentCategory = this.categories[0].value
@@ -130,7 +130,7 @@ export default {
130130
return
131131
}
132132
default: {
133-
this.$root.showInfo('', `数据加载失败,错误码:${status}`)
133+
this.$root.showInfo(`数据加载失败,错误码:${status}`)
134134
}
135135
}
136136
},

frontend/tinywebdb-php-vue/src/components/manage/Backup.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default {
6868
methods: {
6969
async onImportJson (onDone) {
7070
if (this.importJson.file === null) {
71-
this.$root.showInfo('', '请选择一个文件')
71+
this.$root.showInfo('请选择一个文件')
7272
onDone()
7373
return
7474
}
@@ -80,14 +80,14 @@ export default {
8080
switch (status) {
8181
case 0: {
8282
if (result.failed && result.failed.length > 0) {
83-
this.$root.showInfo('', `以下标签导入失败:\`${result.failed.join('`,`')}\``)
83+
this.$root.showInfo(`以下标签导入失败:\`${result.failed.join('`,`')}\``)
8484
} else {
85-
this.$root.showInfo('', '所有标签都导入成功啦')
85+
this.$root.showInfo('所有标签都导入成功啦')
8686
}
8787
break
8888
}
8989
default: {
90-
this.$root.showInfo('', `上传失败,错误码:${status}`)
90+
this.$root.showInfo(`上传失败,错误码:${status}`)
9191
}
9292
}
9393
}

frontend/tinywebdb-php-vue/src/components/manage/Frame.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default {
8484
service.interceptors.response.use(undefined, error => {
8585
if (error.response) {
8686
if (error.response.data.status === 4) {
87-
this.$root.showInfo('', this.token === null ? '请先登录' : '登录已失效,请重新登录')
87+
this.$root.showInfo(this.token === null ? '请先登录' : '登录已失效,请重新登录')
8888
this.token = null
8989
this.$router.push('/manage/login')
9090
return Promise.reject(new Error('请先登录'))
@@ -104,7 +104,7 @@ export default {
104104
this.token = null
105105
this.$router.push('/manage/login')
106106
} catch (e) {
107-
this.$root.showInfo('', '登出失败')
107+
this.$root.showInfo('登出失败')
108108
}
109109
})
110110
},
@@ -128,7 +128,7 @@ export default {
128128
this.$router.push('/manage/all')
129129
}
130130
} catch (e) {
131-
this.$root.showInfo('', '无法连接服务器,详细信息见console')
131+
this.$root.showInfo('无法连接服务器,详细信息见console')
132132
console.error(e)
133133
}
134134
}

frontend/tinywebdb-php-vue/src/components/manage/Init.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666
break
6767
}
6868
default: {
69-
this.$root.showInfo('', `系统初始化失败,错误码${status}`)
69+
this.$root.showInfo(`系统初始化失败,错误码${status}`)
7070
}
7171
}
7272
onDone()

frontend/tinywebdb-php-vue/src/components/manage/Search.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default {
9797
return
9898
}
9999
default: {
100-
this.$root.showInfo('', `搜索失败,错误码${status}`)
100+
this.$root.showInfo(`搜索失败,错误码${status}`)
101101
}
102102
}
103103
},

frontend/tinywebdb-php-vue/src/components/manage/Setting.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default {
120120
async save (settingId, onDone = () => {}) {
121121
let value = (this[settingId] || {}).value
122122
if (value === undefined || value === null) {
123-
this.$root.showInfo('', '设置内容为undefined或null,请刷新页面后重试。如反复出现请联系作者排查问题')
123+
this.$root.showInfo('设置内容为undefined或null,请刷新页面后重试。如反复出现请联系作者排查问题')
124124
return
125125
}
126126
let { status } = (await this.$parent.service.post('setting_update', { settingId, value })).data
@@ -135,7 +135,7 @@ export default {
135135
break
136136
}
137137
default: {
138-
throw new Error(`保存设置'${settingId}'失败,错误码${status}`)
138+
this.$root.showInfo(`保存设置'${settingId}'失败,错误码${status}`)
139139
}
140140
}
141141
},
@@ -145,11 +145,11 @@ export default {
145145
let { status } = (await this.$parent.service.post('erase_data')).data
146146
switch (status) {
147147
case 0: {
148-
this.$root.showInfo('', '数据已清空')
148+
this.$root.showInfo('数据已清空')
149149
break
150150
}
151151
default: {
152-
this.$root.showInfo('', `重置密码失败,错误码${status}`)
152+
this.$root.showInfo(`重置密码失败,错误码${status}`)
153153
}
154154
}
155155
onDone()
@@ -162,11 +162,11 @@ export default {
162162
case 0: {
163163
this.$parent.token = null
164164
this.$router.push('/manage/init')
165-
this.$root.showInfo('', '系统密码已重置,请重新设置新的密码')
165+
this.$root.showInfo('系统密码已重置,请重新设置新的密码')
166166
break
167167
}
168168
default: {
169-
this.$root.showInfo('', `重置密码失败,错误码${status}`)
169+
this.$root.showInfo(`重置密码失败,错误码${status}`)
170170
}
171171
}
172172
onDone()
@@ -179,11 +179,11 @@ export default {
179179
case 0: {
180180
this.$parent.token = null
181181
this.$router.push('/manage/init')
182-
this.$root.showInfo('', '数据库和所有设置已清除')
182+
this.$root.showInfo('数据库和所有设置已清除')
183183
break
184184
}
185185
default: {
186-
this.$root.showInfo('', `清除失败,错误码${status}`)
186+
this.$root.showInfo(`清除失败,错误码${status}`)
187187
}
188188
}
189189
onDone()

frontend/tinywebdb-php-vue/src/components/manage/functional/DataTable.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default {
236236
return JSON.stringify(val, null, 2)
237237
} catch (e) {
238238
console.error('Cannot parse json:', e)
239-
this.$root.showInfo('', '无法解码json,详情见console')
239+
this.$root.showInfo('无法解码json,详情见console')
240240
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
241241
this.showModal.jsonMode = false
242242
return this.showModal.value
@@ -281,11 +281,11 @@ export default {
281281
break
282282
}
283283
case 10: {
284-
this.$root.showInfo('', '标签不存在')
284+
this.$root.showInfo('标签不存在')
285285
break
286286
}
287287
default: {
288-
this.$root.showInfo('', `获取标签信息失败,错误码${status}`)
288+
this.$root.showInfo(`获取标签信息失败,错误码${status}`)
289289
}
290290
}
291291
this.showModal.inProgress = false
@@ -308,17 +308,17 @@ export default {
308308
break
309309
}
310310
case 10: {
311-
this.$root.showInfo('', '编辑失败,目标标签不存在,自动切换为创建标签模式', () => this.$refs.editModal_key.focus())
311+
this.$root.showInfo('编辑失败,目标标签不存在,自动切换为创建标签模式', () => this.$refs.editModal_key.focus())
312312
this.editModal.isCreate = true
313313
break
314314
}
315315
case 30: {
316-
this.$root.showInfo('', '创建失败,目标标签已存在,自动切换为编辑标签模式', () => this.$refs.editModal_value.focus())
316+
this.$root.showInfo('创建失败,目标标签已存在,自动切换为编辑标签模式', () => this.$refs.editModal_value.focus())
317317
this.editModal.isCreate = false
318318
break
319319
}
320320
default: {
321-
this.$root.showInfo('', `${this.editModal.isCreate ? '创建' : '编辑'}失败,错误码${status}`)
321+
this.$root.showInfo(`${this.editModal.isCreate ? '创建' : '编辑'}失败,错误码${status}`)
322322
}
323323
}
324324
this.editModal.inProgress = false
@@ -332,7 +332,7 @@ export default {
332332
break
333333
}
334334
default: {
335-
this.$root.showInfo('', `删除失败,错误码${status}`)
335+
this.$root.showInfo(`删除失败,错误码${status}`)
336336
}
337337
}
338338
})
@@ -360,12 +360,12 @@ export default {
360360
}
361361
}
362362
if (failedKeys.length > 0) {
363-
this.$root.showInfo('', `以下标签删除失败:\`${failedKeys.join('`,`')}\``)
363+
this.$root.showInfo(`以下标签删除失败:\`${failedKeys.join('`,`')}\``)
364364
}
365365
break
366366
}
367367
default: {
368-
this.$root.showInfo('', `删除失败,错误码${status}`)
368+
this.$root.showInfo(`删除失败,错误码${status}`)
369369
}
370370
}
371371
})

frontend/tinywebdb-php-vue/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ new Vue({
7878
showConfirm (title, content, okCallback, cancelCallback) {
7979
this.$refs.confirmModal.show(title, content, okCallback, cancelCallback)
8080
},
81-
showInfo (title, content, hiddenCallback = null) {
82-
this.$refs.infoModal.show(title, content, hiddenCallback)
81+
showInfo (content, hiddenCallback = null) {
82+
this.$refs.infoModal.show('', content, hiddenCallback)
8383
},
8484
showToast (message) {
8585
this.$bvToast.toast(message, {

0 commit comments

Comments
 (0)