Skip to content

Commit

Permalink
starttls和收件人前端设置
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Dec 28, 2023
1 parent 4a7d909 commit cb7fc2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ui/src/components/Email.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const mobile = inject('mobile')
const test_result = ref('')
const { mail_enable, account, pass_code, mail_subject, custom_smtp_server } = storeToRefs(store)
const { mail_enable, account, pass_code, recipient, mail_subject, custom_smtp_server } =
storeToRefs(store)
async function test_email() {
test_result.value = '正在发送……'
Expand Down Expand Up @@ -54,7 +55,13 @@ const email_options = [
<n-form-item label="SMTP服务器" v-if="custom_smtp_server.enable">
<n-input v-model:value="custom_smtp_server.server" />
</n-form-item>
<n-form-item label="SSL端口号" v-if="custom_smtp_server.enable">
<n-form-item label="加密方式" v-if="custom_smtp_server.enable">
<n-radio-group v-model:value="custom_smtp_server.encryption">
<n-radio value="tls" label="SSL/TLS" />
<n-radio value="starttls" label="STARTTLS" />
</n-radio-group>
</n-form-item>
<n-form-item label="端口号" v-if="custom_smtp_server.enable">
<n-input-number v-model:value="custom_smtp_server.ssl_port" />
</n-form-item>
<n-form-item>
Expand Down Expand Up @@ -91,6 +98,9 @@ const email_options = [
</template>
<n-input v-model:value="mail_subject" />
</n-form-item>
<n-form-item label="收件人">
<n-input v-model:value="recipient" />
</n-form-item>
</n-form>
<n-divider />
<div class="email-test mt-16">
Expand Down
4 changes: 4 additions & 0 deletions ui/src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const useConfigStore = defineStore('config', () => {
const mail_enable = ref(false)
const account = ref('')
const pass_code = ref('')
const recipient = ref('')
const custom_smtp_server = ref({})
const package_type = ref('official')
const plan_file = ref('')
Expand Down Expand Up @@ -101,6 +102,7 @@ export const useConfigStore = defineStore('config', () => {
mail_enable.value = response.data.mail_enable != 0
account.value = response.data.account
pass_code.value = response.data.pass_code
recipient.value = response.data.recipient
custom_smtp_server.value = response.data.custom_smtp_server
package_type.value = response.data.package_type == 1 ? 'official' : 'bilibili'
plan_file.value = response.data.planFile
Expand Down Expand Up @@ -174,6 +176,7 @@ export const useConfigStore = defineStore('config', () => {
mail_enable: mail_enable.value ? 1 : 0,
package_type: package_type.value == 'official' ? 1 : 0,
pass_code: pass_code.value,
recipient: recipient.value,
custom_smtp_server: custom_smtp_server.value,
planFile: plan_file.value,
reload_room: reload_room.value.join(','),
Expand Down Expand Up @@ -254,6 +257,7 @@ export const useConfigStore = defineStore('config', () => {
mail_enable,
account,
pass_code,
recipient,
custom_smtp_server,
package_type,
plan_file,
Expand Down

0 comments on commit cb7fc2c

Please sign in to comment.