mirror of https://github.com/halo-dev/halo
Support test email.
parent
bf02639502
commit
55b12ca6b0
|
@ -29,4 +29,12 @@ optionApi.save = options => {
|
|||
})
|
||||
}
|
||||
|
||||
optionApi.testMail = param => {
|
||||
return service({
|
||||
url: `/api/admin/options/test_mail`,
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export default optionApi
|
||||
|
|
|
@ -437,7 +437,11 @@
|
|||
label="发送协议:"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-input v-model="options.email_protocol" />
|
||||
<!-- <a-input v-model="options.email_protocol" /> -->
|
||||
<a-select v-model="options.email_protocol">
|
||||
<a-select-option value="">无</a-select-option>
|
||||
<a-select-option value="SSL">SSL</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="SSL 端口:"
|
||||
|
@ -486,13 +490,13 @@
|
|||
label="收件人:"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-input />
|
||||
<a-input v-model="mailParam.to"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="主题:"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-input />
|
||||
<a-input v-model="mailParam.subject"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="内容:"
|
||||
|
@ -501,10 +505,11 @@
|
|||
<a-input
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 5 }"
|
||||
v-model="mailParam.content"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary">发送</a-button>
|
||||
<a-button type="primary" @click="handleTestMailClick">发送</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-tab-pane>
|
||||
|
@ -584,7 +589,8 @@ export default {
|
|||
aliyunFormHidden: false,
|
||||
logoDrawerVisible: false,
|
||||
faviconDrawerVisible: false,
|
||||
options: []
|
||||
options: [],
|
||||
mailParam: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -638,6 +644,11 @@ export default {
|
|||
handleShowFaviconAttachDrawer() {
|
||||
this.faviconDrawerVisible = true
|
||||
},
|
||||
handleTestMailClick() {
|
||||
optionApi.testMail(this.mailParam).then(response => {
|
||||
this.$message.info(response.data.message)
|
||||
})
|
||||
},
|
||||
handleSelectFavicon(data) {
|
||||
this.options.blog_favicon = data.path
|
||||
this.faviconDrawerVisible = false
|
||||
|
|
|
@ -87,13 +87,6 @@ export default {
|
|||
} else {
|
||||
this.$router.replace({ name: 'Dashboard' })
|
||||
}
|
||||
// 延迟 1 秒显示欢迎信息
|
||||
setTimeout(() => {
|
||||
this.$notification.success({
|
||||
message: '欢迎',
|
||||
description: `欢迎回来`
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -101,16 +94,17 @@ export default {
|
|||
<style>
|
||||
body {
|
||||
height: 100%;
|
||||
background-color: #f8f8f8;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.container {
|
||||
background: #f7f7f7;
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
left: 50%;
|
||||
margin: -160px 0 0 -160px;
|
||||
width: 320px;
|
||||
padding: 16px 32px 32px 32px;
|
||||
box-shadow: 0px 0px 20px 0px rgba(76, 50, 50, 0.08);
|
||||
box-shadow: -4px 7px 46px 2px rgba(0,0,0,.1);
|
||||
}
|
||||
.loginLogo {
|
||||
margin-bottom: 20px;
|
||||
|
|
Loading…
Reference in New Issue