Rap 原分销系统代码Web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

688f976d742c95e72b7ce010cf492df25377500b.svn-base 2.9KB

пре 5 месеци
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="100px">
  3. <el-form-item label="发件人邮箱" prop="fromUser">
  4. <el-input v-model="form.fromUser" style="width: 40%" />
  5. <span style="color: #C0C0C0;margin-left: 10px;">Sender mailbox</span>
  6. </el-form-item>
  7. <el-form-item label="发件用户名" prop="user">
  8. <el-input v-model="form.user" style="width: 40%;" />
  9. <span style="color: #C0C0C0;margin-left: 10px;">Sender usernamex</span>
  10. </el-form-item>
  11. <el-form-item label="邮箱密码" prop="pass">
  12. <el-input v-model="form.pass" type="password" style="width: 40%;" />
  13. <span style="color: #C0C0C0;margin-left: 10px;">email Password</span>
  14. </el-form-item>
  15. <el-form-item label="SMTP地址" prop="host">
  16. <el-input v-model="form.host" style="width: 40%;" />
  17. <span style="color: #C0C0C0;margin-left: 10px;">SMTP address</span>
  18. </el-form-item>
  19. <el-form-item label="SMTP端口" prop="port">
  20. <el-input v-model="form.port" style="width: 40%;" />
  21. <span style="color: #C0C0C0;margin-left: 10px;">SMTP port</span>
  22. </el-form-item>
  23. <el-form-item label="">
  24. <el-button :loading="loading" size="medium" type="primary" @click="doSubmit">保存配置</el-button>
  25. </el-form-item>
  26. </el-form>
  27. </template>
  28. <script>
  29. import { get, update } from '@/api/tools/email'
  30. export default {
  31. name: 'Config',
  32. data() {
  33. return {
  34. loading: false, form: { id: 1, fromUser: '', user: '', pass: '', host: '', port: '', sslEnable: '' },
  35. rules: {
  36. fromUser: [
  37. { required: true, message: '请输入发件人邮箱', trigger: 'blur' },
  38. { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
  39. ],
  40. user: [
  41. { required: true, message: '请输入发件用户名', trigger: 'blur' }
  42. ],
  43. pass: [
  44. { required: true, message: '密码不能为空', trigger: 'blur' }
  45. ],
  46. host: [
  47. { required: true, message: 'SMTP地址不能为空', trigger: 'blur' }
  48. ],
  49. port: [
  50. { required: true, message: 'SMTP端口不能为空', trigger: 'blur' }
  51. ]
  52. }
  53. }
  54. },
  55. created() {
  56. this.init()
  57. },
  58. methods: {
  59. init() {
  60. get().then(res => {
  61. this.form = res
  62. })
  63. },
  64. doSubmit() {
  65. this.$refs['form'].validate((valid) => {
  66. if (valid) {
  67. this.loading = true
  68. update(this.form).then(res => {
  69. this.$notify({
  70. title: '修改成功',
  71. type: 'success',
  72. duration: 2500
  73. })
  74. this.loading = false
  75. }).catch(err => {
  76. this.loading = false
  77. console.log(err.response.data.message)
  78. })
  79. } else {
  80. return false
  81. }
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped>
  88. </style>