🔨 Refactor: most config handle by picgo-core

for config syncing with picgo-core && picgo-plugins
This commit is contained in:
Molunerfinn
2019-12-26 20:15:41 +08:00
parent fec4360043
commit 3418560c63
30 changed files with 293 additions and 231 deletions
+3 -1
View File
@@ -90,7 +90,9 @@ export default class extends Vue {
// @ts-ignore
this.$refs.aliyun.validate((valid) => {
if (valid) {
this.$db.set('picBed.aliyun', this.form)
this.letPicGoSaveData({
'picBed.aliyun': this.form
})
const successNotification = new window.Notification('设置结果', {
body: '设置成功'
})
+3 -1
View File
@@ -81,7 +81,9 @@ export default class extends Vue {
// @ts-ignore
this.$refs.github.validate((valid) => {
if (valid) {
this.$db.set('picBed.github', this.form)
this.letPicGoSaveData({
'picBed.github': this.form
})
const successNotification = new Notification('设置结果', {
body: '设置成功'
})
+3 -1
View File
@@ -58,7 +58,9 @@ export default class extends Vue {
// @ts-ignore
this.$refs.imgur.validate((valid) => {
if (valid) {
this.$db.set('picBed.imgur', this.form)
this.letPicGoSaveData({
'picBed.imgur': this.form
})
const successNotification = new Notification('设置结果', {
body: '设置成功'
})
+6 -2
View File
@@ -56,7 +56,9 @@ export default class extends Vue {
// @ts-ignore
const result = await this.$refs.configForm.validate()
if (result !== false) {
this.$db.set(`picBed.${this.type}`, result)
this.letPicGoSaveData({
[`picBed.${this.type}`]: result
})
const successNotification = new Notification('设置结果', {
body: '设置成功'
})
@@ -66,7 +68,9 @@ export default class extends Vue {
}
}
setDefaultPicBed (type: string) {
this.$db.set('picBed.current', type)
this.letPicGoSaveData({
'picBed.current': type
})
// @ts-ignore 来自mixin的数据
this.defaultPicBed = type
const successNotification = new Notification('设置默认图床', {
+3 -1
View File
@@ -98,7 +98,9 @@ export default class extends Vue {
// @ts-ignore
this.$refs.qiniu.validate((valid) => {
if (valid) {
this.$db.set('picBed.qiniu', this.form)
this.letPicGoSaveData({
'picBed.qiniu': this.form
})
const successNotification = new Notification('设置结果', {
body: '设置成功'
})
+3 -1
View File
@@ -24,7 +24,9 @@ import mixin from '@/utils/ConfirmButtonMixin'
})
export default class extends Vue {
confirm () {
this.$db.set('picBed.smms', true)
this.letPicGoSaveData({
'picBed.smms': true
})
// @ts-ignore 来自mixin
this.setDefaultPicBed('smms')
const successNotification = new window.Notification('设置结果', {
+3 -1
View File
@@ -114,7 +114,9 @@ export default class extends Vue {
// @ts-ignore
this.$refs.tcyun.validate((valid) => {
if (valid) {
this.$db.set('picBed.tcyun', this.form)
this.letPicGoSaveData({
'picBed.tcyun': this.form
})
const successNotification = new window.Notification('设置结果', {
body: '设置成功'
})
+3 -1
View File
@@ -89,7 +89,9 @@ export default class extends Vue {
// @ts-ignore
this.$refs.tcyun.validate((valid) => {
if (valid) {
this.$db.set('picBed.upyun', this.form)
this.letPicGoSaveData({
'picBed.upyun': this.form
})
const successNotification = new Notification('设置结果', {
body: '设置成功'
})
+8 -6
View File
@@ -91,12 +91,14 @@ export default {
confirm (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$db.set('picBed.weibo', {
username: this.form.username,
password: this.form.password,
quality: this.quality,
cookie: this.form.cookie,
chooseCookie: this.chooseCookie
this.letPicGoSaveData({
'picBed.weibo': {
username: this.form.username,
password: this.form.password,
quality: this.quality,
cookie: this.form.cookie,
chooseCookie: this.chooseCookie
}
})
const successNotification = new window.Notification('设置结果', {
body: '设置成功'