Support test email.

pull/3445/head
ruibaby 2019-05-07 01:47:46 +08:00
parent bf02639502
commit 55b12ca6b0
3 changed files with 27 additions and 14 deletions

View File

@ -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 export default optionApi

View File

@ -437,7 +437,11 @@
label="发送协议:" label="发送协议:"
:wrapper-col="wrapperCol" :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>
<a-form-item <a-form-item
label="SSL 端口:" label="SSL 端口:"
@ -486,13 +490,13 @@
label="收件人:" label="收件人:"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input /> <a-input v-model="mailParam.to"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="主题:" label="主题:"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input /> <a-input v-model="mailParam.subject"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="内容:" label="内容:"
@ -501,10 +505,11 @@
<a-input <a-input
type="textarea" type="textarea"
:autosize="{ minRows: 5 }" :autosize="{ minRows: 5 }"
v-model="mailParam.content"
/> />
</a-form-item> </a-form-item>
<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-item>
</a-form> </a-form>
</a-tab-pane> </a-tab-pane>
@ -584,7 +589,8 @@ export default {
aliyunFormHidden: false, aliyunFormHidden: false,
logoDrawerVisible: false, logoDrawerVisible: false,
faviconDrawerVisible: false, faviconDrawerVisible: false,
options: [] options: [],
mailParam: {}
} }
}, },
mounted() { mounted() {
@ -638,6 +644,11 @@ export default {
handleShowFaviconAttachDrawer() { handleShowFaviconAttachDrawer() {
this.faviconDrawerVisible = true this.faviconDrawerVisible = true
}, },
handleTestMailClick() {
optionApi.testMail(this.mailParam).then(response => {
this.$message.info(response.data.message)
})
},
handleSelectFavicon(data) { handleSelectFavicon(data) {
this.options.blog_favicon = data.path this.options.blog_favicon = data.path
this.faviconDrawerVisible = false this.faviconDrawerVisible = false

View File

@ -87,13 +87,6 @@ export default {
} else { } else {
this.$router.replace({ name: 'Dashboard' }) this.$router.replace({ name: 'Dashboard' })
} }
// 1
setTimeout(() => {
this.$notification.success({
message: '欢迎',
description: `欢迎回来`
})
}, 1000)
} }
} }
} }
@ -101,16 +94,17 @@ export default {
<style> <style>
body { body {
height: 100%; height: 100%;
background-color: #f8f8f8; background-color: #f5f5f5;
} }
.container { .container {
background: #f7f7f7;
position: absolute; position: absolute;
top: 45%; top: 45%;
left: 50%; left: 50%;
margin: -160px 0 0 -160px; margin: -160px 0 0 -160px;
width: 320px; width: 320px;
padding: 16px 32px 32px 32px; 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 { .loginLogo {
margin-bottom: 20px; margin-bottom: 20px;