index.blade.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. @extends('layouts.base')
  2. @section('title', '站点设置')
  3. @section('content')
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. padding-left: 20px;
  8. border-radius: 10px;
  9. }
  10. .panel .active a {
  11. background-color: #29ba9c!important;
  12. border-radius: 18px!important;
  13. color:#fff;
  14. }
  15. .panel a{
  16. border:none!important;
  17. background-color:#fff!important;
  18. }
  19. .content{
  20. background: #eff3f6;
  21. padding: 10px!important;
  22. }
  23. .con{
  24. padding-bottom:20px;
  25. position:relative;
  26. min-height:100vh;
  27. background-color:#fff;
  28. border-radius: 8px;
  29. }
  30. .con .setting .block{
  31. padding:10px;
  32. background-color:#fff;
  33. border-radius: 8px;
  34. }
  35. .con .setting .block .title{
  36. display:flex;
  37. align-items:center;
  38. margin-bottom:15px;
  39. }
  40. .confirm-btn{
  41. width: calc(100% - 266px);
  42. position:fixed;
  43. bottom:0;
  44. right:0;
  45. margin-right:10px;
  46. line-height:63px;
  47. background-color: #ffffff;
  48. box-shadow: 0px 8px 23px 1px
  49. rgba(51, 51, 51, 0.3);
  50. background-color:#fff;
  51. text-align:center;
  52. }
  53. b{
  54. font-size:14px;
  55. }
  56. </style>
  57. <div id='re_content' >
  58. @include('layouts.newTabs')
  59. <div class="con">
  60. <div class="setting">
  61. <div class="block">
  62. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>HTTPS设置</b></div>
  63. <el-form ref="form" :model="form" label-width="15%">
  64. <el-form-item label="强制HTTPS">
  65. <template>
  66. <el-switch
  67. v-model="form.https"
  68. active-value="1"
  69. inactive-value="0"
  70. >
  71. </el-switch>
  72. </template>
  73. </el-form-item>
  74. <el-form-item label="域名">
  75. <el-input v-model="form.host" style="width:70%;"></el-input>
  76. </el-form-item>
  77. </el-form>
  78. </div>
  79. </div>
  80. <div class="confirm-btn">
  81. <el-button type="primary" @click="onSubmit">提交</el-button>
  82. </div>
  83. </div>
  84. </div>
  85. <script>
  86. var app = new Vue({
  87. el: '#re_content',
  88. delimiters: ['[[', ']]'],
  89. data() {
  90. // 默认数据
  91. let temp = JSON.parse('{!! $setting !!}');
  92. if (!temp || temp.length === 0) {
  93. temp = {
  94. https: 0,
  95. host: '',
  96. }
  97. }
  98. return {
  99. form: temp,
  100. loading: false,
  101. formLoading: false,
  102. centerDialogVisible: false,
  103. }
  104. },
  105. mounted: function () {
  106. },
  107. methods: {
  108. onSubmit() {
  109. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  110. if (this.formLoading) {
  111. return;
  112. }
  113. this.formLoading = true;
  114. this.$refs.form.validate((valid) => {
  115. console.log(valid)
  116. });
  117. this.$http.post("{!! yzWebUrl('siteSetting.store.index') !!}", {'setting': this.form}).then(response => {
  118. //console.log(response.data);
  119. // return;
  120. if (response.data.result) {
  121. this.$message({
  122. message: response.data.msg,
  123. type: 'success'
  124. });
  125. } else {
  126. this.$message({
  127. message: response.data.msg,
  128. type: 'error'
  129. });
  130. }
  131. this.formLoading = false;
  132. loading.close();
  133. location.reload();
  134. }, response => {
  135. console.log(response);
  136. });
  137. },
  138. }
  139. });
  140. </script>
  141. @endsection