mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-29 04:00:11 +08:00
✨ Feature: add smms-v2 support
This commit is contained in:
@@ -5,12 +5,27 @@
|
||||
<div class="view-title">
|
||||
SM.MS设置
|
||||
</div>
|
||||
<div class="content">
|
||||
感谢SM.MS提供的优质服务
|
||||
</div>
|
||||
<div style="text-align: center; margin-top: 20px;">
|
||||
<el-button type="success" @click="confirm" round :disabled="defaultPicBed === 'smms'" size="mini">设为默认图床</el-button>
|
||||
</div>
|
||||
<el-form
|
||||
ref="smms"
|
||||
label-position="right"
|
||||
label-width="120px"
|
||||
:model="form"
|
||||
size="mini">
|
||||
<el-form-item
|
||||
label="设定Token"
|
||||
prop="token"
|
||||
:rules="{
|
||||
required: true, message: 'Token不能为空', trigger: 'blur'
|
||||
}">
|
||||
<el-input v-model="form.token" type="password" placeholder="token" @keyup.native.enter="confirm('smmsForm')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="confirm" round>确定</el-button>
|
||||
<el-button type="success" @click="setDefaultPicBed('smms')" round :disabled="defaultPicBed === 'smms'">设为默认图床</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -23,25 +38,58 @@ import mixin from '@/utils/ConfirmButtonMixin'
|
||||
mixins: [mixin]
|
||||
})
|
||||
export default class extends Vue {
|
||||
confirm () {
|
||||
this.letPicGoSaveData({
|
||||
'picBed.smms': true
|
||||
})
|
||||
// @ts-ignore 来自mixin
|
||||
this.setDefaultPicBed('smms')
|
||||
const successNotification = new window.Notification('设置结果', {
|
||||
body: '设置成功'
|
||||
})
|
||||
successNotification.onclick = () => {
|
||||
return true
|
||||
form: ISMMSConfig = {
|
||||
token: ''
|
||||
}
|
||||
created () {
|
||||
const config = this.$db.get('picBed.smms.token') as (string | boolean)
|
||||
if (typeof config !== 'boolean') {
|
||||
this.form.token = config
|
||||
}
|
||||
}
|
||||
confirm () {
|
||||
// @ts-ignore
|
||||
this.$refs.smms.validate((valid) => {
|
||||
if (valid) {
|
||||
this.letPicGoSaveData({
|
||||
'picBed.smms': this.form
|
||||
})
|
||||
const successNotification = new window.Notification('设置结果', {
|
||||
body: '设置成功'
|
||||
})
|
||||
successNotification.onclick = () => {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='stylus'>
|
||||
#smms-view
|
||||
.content
|
||||
text-align center
|
||||
font-size 14px
|
||||
color #eee
|
||||
.el-form
|
||||
label
|
||||
line-height 22px
|
||||
padding-bottom 0
|
||||
color #eee
|
||||
.el-input__inner
|
||||
border-radius 19px
|
||||
&-item
|
||||
margin-bottom 10.5px
|
||||
.el-radio-group
|
||||
width 100%
|
||||
label
|
||||
width 25%
|
||||
.el-radio-button__inner
|
||||
width 100%
|
||||
.el-radio-button:first-child
|
||||
.el-radio-button__inner
|
||||
border-left none
|
||||
border-radius 14px 0 0 14px
|
||||
.el-radio-button:last-child
|
||||
.el-radio-button__inner
|
||||
border-left none
|
||||
border-radius 0 14px 14px 0
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user