Refactor password input again.

pull/51/head
ruibaby 2019-10-18 19:46:58 +08:00
parent f001f0453e
commit 6e4a6263a9
3 changed files with 18 additions and 72 deletions

View File

@ -31,31 +31,7 @@
<a-input v-model="selectedPost.url" /> <a-input v-model="selectedPost.url" />
</a-form-item> </a-form-item>
<a-form-item label="访问密码:"> <a-form-item label="访问密码:">
<a-input <a-input-password v-model="selectedPost.password"/>
v-model="selectedPost.password"
v-if="passwordVisible"
>
<a
href="javascript:void(0);"
slot="addonAfter"
@click="togglePasswordVisible"
>
<a-icon type="eye-invisible" />
</a>
</a-input>
<a-input
type="password"
v-model="selectedPost.password"
v-else
>
<a
href="javascript:void(0);"
slot="addonAfter"
@click="togglePasswordVisible"
>
<a-icon type="eye" />
</a>
</a-input>
</a-form-item> </a-form-item>
<a-form-item label="发表时间:"> <a-form-item label="发表时间:">
@ -183,7 +159,7 @@
<a-button <a-button
class="post-thumb-remove" class="post-thumb-remove"
type="dashed" type="dashed"
@click="handlerRemoveThumb" @click="handleRemoveThumb"
>移除</a-button> >移除</a-button>
</div> </div>
</div> </div>
@ -238,7 +214,6 @@ export default {
return { return {
thumbDrawerVisible: false, thumbDrawerVisible: false,
categoryFormVisible: false, categoryFormVisible: false,
passwordVisible: false,
settingLoading: true, settingLoading: true,
selectedPost: this.post, selectedPost: this.post,
selectedTagIds: this.tagIds, selectedTagIds: this.tagIds,
@ -341,7 +316,7 @@ export default {
this.selectedPost.thumbnail = encodeURI(data.path) this.selectedPost.thumbnail = encodeURI(data.path)
this.thumbDrawerVisible = false this.thumbDrawerVisible = false
}, },
handlerRemoveThumb() { handleRemoveThumb() {
this.selectedPost.thumbnail = null this.selectedPost.thumbnail = null
}, },
handlerCreateCategory() { handlerCreateCategory() {
@ -417,12 +392,8 @@ export default {
}) })
} }
}, },
togglePasswordVisible() {
this.passwordVisible = !this.passwordVisible
},
onClose() { onClose() {
this.$emit('close', false) this.$emit('close', false)
this.passwordVisible = false
}, },
onPostDateChange(value, dateString) { onPostDateChange(value, dateString) {
this.selectedPost.createTime = value.valueOf() this.selectedPost.createTime = value.valueOf()

View File

@ -298,7 +298,7 @@
label="Secret Token" label="Secret Token"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password
v-model="options.smms_api_secret_token" v-model="options.smms_api_secret_token"
placeholder="需要到 sm.ms 官网注册后获取" placeholder="需要到 sm.ms 官网注册后获取"
/> />
@ -333,10 +333,7 @@
label="操作员密码:" label="操作员密码:"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password v-model="options.oss_upyun_password" />
type="password"
v-model="options.oss_upyun_password"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="文件目录:" label="文件目录:"
@ -393,16 +390,13 @@
label="Access Key" label="Access Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.oss_qiniu_access_key" /> <a-input-password v-model="options.oss_qiniu_access_key" />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="Secret Key" label="Secret Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password v-model="options.oss_qiniu_secret_key" />
type="password"
v-model="options.oss_qiniu_secret_key"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="Bucket" label="Bucket"
@ -464,16 +458,13 @@
label="Access Key" label="Access Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.oss_aliyun_access_key" /> <a-input-password v-model="options.oss_aliyun_access_key" />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="Access Secret" label="Access Secret"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password v-model="options.oss_aliyun_access_secret" />
type="password"
v-model="options.oss_aliyun_access_secret"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="图片处理策略:" label="图片处理策略:"
@ -526,16 +517,13 @@
label="Access Key" label="Access Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.bos_baiduyun_access_key" /> <a-input-password v-model="options.bos_baiduyun_access_key" />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="Secret Key" label="Secret Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password v-model="options.bos_baiduyun_secret_key" />
type="password"
v-model="options.bos_baiduyun_secret_key"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="图片处理策略:" label="图片处理策略:"
@ -595,16 +583,13 @@
label="Secret Id" label="Secret Id"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.cos_tencentyun_secret_id" /> <a-input-password v-model="options.cos_tencentyun_secret_id" />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="Secret Key" label="Secret Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password v-model="options.cos_tencentyun_secret_key" />
type="password"
v-model="options.cos_tencentyun_secret_key"
/>
</a-form-item> </a-form-item>
</div> </div>
<a-form-item> <a-form-item>
@ -660,9 +645,8 @@
label="邮箱密码:" label="邮箱密码:"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input <a-input-password
v-model="options.email_password" v-model="options.email_password"
type="password"
placeholder="部分邮箱可能是授权码" placeholder="部分邮箱可能是授权码"
/> />
</a-form-item> </a-form-item>
@ -733,7 +717,7 @@
label="Access key" label="Access key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.api_access_key" /> <a-input-password v-model="options.api_access_key" />
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button <a-button

View File

@ -106,22 +106,13 @@
</span> </span>
<a-form layout="vertical"> <a-form layout="vertical">
<a-form-item label="原密码:"> <a-form-item label="原密码:">
<a-input <a-input-password v-model="passwordParam.oldPassword"/>
type="password"
v-model="passwordParam.oldPassword"
/>
</a-form-item> </a-form-item>
<a-form-item label="新密码:"> <a-form-item label="新密码:">
<a-input <a-input-password v-model="passwordParam.newPassword"/>
type="password"
v-model="passwordParam.newPassword"
/>
</a-form-item> </a-form-item>
<a-form-item label="确认密码:"> <a-form-item label="确认密码:">
<a-input <a-input-password v-model="passwordParam.confirmPassword"/>
type="password"
v-model="passwordParam.confirmPassword"
/>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button <a-button