瀏覽代碼

修改文件名和路由

dygapp 4 年之前
父節點
當前提交
0997c27278

+ 1 - 1
plub/menu.js

@@ -60,7 +60,7 @@ export default [
     children: [
       {
         name: '系统设置',
-        path: '/advancedConfig/systemctl'
+        path: '/advancedConfig/system'
       },
       {
         name: '时间设置',

+ 17 - 17
src/router/index.js

@@ -6,17 +6,17 @@ import devinfo from '../views/devinfo.vue'
 import advancedConfig from '../views/advancedConfig.vue'
 import wan from '../views/network/wan.vue'
 import lan from '../views/network/lan.vue'
-import systemctl from '../views/systemctl/systemctl.vue'
-import date from '../views/systemctl/date.vue'
-import ping from '../views/systemctl/ping.vue'
+import system from '../views/system/system.vue'
+import date from '../views/system/date.vue'
+import ping from '../views/system/ping.vue'
 import log from '../views/log.vue'
 import cacert from '../views/cert/cacert.vue'
 import devcert from '../views/cert/cert.vue'
-import sslvpn from '../views/vpn/sslvpn.vue'
-import sslservicevpn from '../views/vpn/sslservicevpn.vue'
-import ipsecvpn from '../views/vpn/ipsecvpn.vue'
-import ipsecservicevpn from '../views/vpn/ipsecservicevpn.vue'
-import passwd from '../views/systemctl/passwd.vue'
+import sslClient from '../views/vpn/ssl-client.vue'
+import sslServer from '../views/vpn/ssl-server.vue'
+import ipsecClient from '../views/vpn/ipsec-client.vue'
+import ipsecServer from '../views/vpn/ipsec-server.vue'
+import passwd from '../views/system/passwd.vue'
 const states = process.env.VUE_APP_END || '0'
 
 Vue.use(VueRouter)
@@ -55,9 +55,9 @@ const routes = [
             component: lan
           },
           {
-            path: 'systemctl',
-            name: 'systemctl',
-            component: systemctl
+            path: 'system',
+            name: 'system',
+            component: system
           },
           {
             path: 'date',
@@ -85,14 +85,14 @@ const routes = [
             component: devcert
           },
           {
-            path: 'sslvpn',
-            name: 'sslvpn',
-            component: states === '0' ? sslvpn : sslservicevpn
+            path: 'sslClient',
+            name: 'sslClient',
+            component: states === '0' ? sslClient : sslServer
           },
           {
-            path: 'ipsecvpn',
-            name: 'ipsecvpn',
-            component: states === '0' ? ipsecvpn : ipsecservicevpn
+            path: 'ipsecClient',
+            name: 'ipsecClient',
+            component: states === '0' ? ipsecClient : ipsecServer
           },
           {
             path: 'passwd',

+ 32 - 36
src/store/index.js

@@ -35,17 +35,13 @@ const api = {
   sigcacertquery: '/api/sigcacertquery',
   sigcertreq: '/api/sigcertreq',
   // sslvpn
-  sslvpnstate: '/api/sslvpnstate',
-  sslquery: '/api/sslquery',
-  sslserivcequery: '/api/sslserivcequery',
-  sslvpnclient: '/api/sslvpnclient',
-  sslvpnservice: '/api/sslvpnservice',
+  sslState: '/api/ssl/state',
+  sslClient: '/api/ssl/client',
+  sslServer: '/api/ssl/server',
   // ipsecvpn
-  ipsecvpnstate: '/api/ipsecvpnstate',
-  secclient: '/api/secclient',
-  secservice: '/api/secservice',
-  secclientquery: '/api/secclientquery',
-  ipsecservicequery: '/api/ipsecservicequery',
+  ipsecState: '/api/ipsec/state',
+  ipsecClient: '/api/ipsec/client',
+  ipsecServer: '/api/ipsec/server',
   // 恢复默认配置
   recover: '/api/recover',
   // NTP配置
@@ -102,13 +98,13 @@ export default new Vuex.Store({
     sslquery (state, payload) {
       state.ssldata = payload.data
     },
-    sslserivcequery (state, payload) {
+    sslserverquery (state, payload) {
       state.ssldata = payload.data
     },
-    ipsecservicequery (state, payload) {
+    getIPSecServer (state, payload) {
       state.secdata = payload.data
     },
-    secclientquery (state, payload) {
+    getIPSecClient (state, payload) {
       state.secdata = payload.data
     }
   },
@@ -245,58 +241,58 @@ export default new Vuex.Store({
       const res = await axios.post(`${api.sigcertreq}`, payload)
       return res.data
     },
-    // 启动停止重启sslvpnstate
-    async sslvpnstate ({ commit }, { type } = {}) {
-      const res = await axios.get(`${api.sslvpnstate}?type=${type}`)
+    // 启动停止重启sslState
+    async sslState ({ commit }, { type } = {}) {
+      const res = await axios.get(`${api.sslState}?type=${type}`)
       return res.data
     },
     // 查询sslvpn客户端
     async sslquery ({ commit }) {
-      const res = await axios.get(`${api.sslquery}`)
+      const res = await axios.get(`${api.sslClient}`)
       commit('sslquery', res)
       return res.data
     },
     // 查询sslvpn服务端
-    async sslserivcequery ({ commit }) {
-      const res = await axios.get(`${api.sslserivcequery}`)
-      commit('sslserivcequery', res)
+    async sslserverquery ({ commit }) {
+      const res = await axios.get(`${api.sslServer}`)
+      commit('sslserverquery', res)
       return res.data
     },
     // sslvpn客户端添加
-    async sslvpnclient ({ commit }, payload) {
-      const res = await axios.post(`${api.sslvpnclient}`, payload)
+    async setSSLClient ({ commit }, payload) {
+      const res = await axios.post(`${api.sslClient}`, payload)
       return res.data
     },
     // sslvpn服务端添加
-    async sslvpnservice ({ commit }, payload) {
-      const res = await axios.post(`${api.sslvpnservice}`, payload)
+    async setSSLServer ({ commit }, payload) {
+      const res = await axios.post(`${api.sslServer}`, payload)
       return res.data
     },
     // 启动停止重启ipsecvpnstate
-    async ipsecvpnstate ({ commit }, { type } = {}) {
-      const res = await axios.get(`${api.ipsecvpnstate}?type=${type}`)
+    async ipsecState ({ commit }, { type } = {}) {
+      const res = await axios.get(`${api.ipsecState}?type=${type}`)
       return res.data
     },
     // 查询ipsecvpn客户端
-    async secclientquery ({ commit }) {
-      const res = await axios.get(`${api.secclientquery}`)
-      commit('secclientquery', res)
+    async getIPSecClient ({ commit }) {
+      const res = await axios.get(`${api.ipsecClient}`)
+      commit('getIPSecClient', res)
       return res.data
     },
     // 查询ipsecvpn服务端
-    async ipsecservicequery ({ commit }) {
-      const res = await axios.get(`${api.ipsecservicequery}`)
-      commit('ipsecservicequery', res)
+    async getIPSecServer ({ commit }) {
+      const res = await axios.get(`${api.ipsecServer}`)
+      commit('getIPSecServer', res)
       return res.data
     },
     // ipsecvpn客户端添加
-    async secclient ({ commit }, payload) {
-      const res = await axios.post(`${api.secclient}`, payload)
+    async setIPSecClient ({ commit }, payload) {
+      const res = await axios.post(`${api.ipsecClient}`, payload)
       return res.data
     },
     // ipsecvpn服务端添加
-    async secservice ({ commit }, payload) {
-      const res = await axios.post(`${api.secservice}`, payload)
+    async setIPSecServer ({ commit }, payload) {
+      const res = await axios.post(`${api.ipsecServer}`, payload)
       return res.data
     },
     // 恢复默认配置

+ 1 - 1
src/views/devinfo.vue

@@ -39,7 +39,7 @@
 <script>
 import { mapState, mapActions } from 'vuex'
 export default {
-  name: 'systemctl',
+  name: 'system',
   components: {},
   computed: {
     ...mapState(['devinfo', 'cpudata', 'vpnstate', 'memorydata']),

src/views/systemctl/date.vue → src/views/system/date.vue


+ 1 - 1
src/views/systemctl/systemctl.vue

@@ -20,7 +20,7 @@
 import { mapActions } from 'vuex'
 // mapState
 export default {
-  name: 'systemctl',
+  name: 'system',
   components: {},
   data () {
     return {}

src/views/systemctl/passwd.vue → src/views/system/passwd.vue


src/views/systemctl/ping.vue → src/views/system/ping.vue


+ 4 - 4
src/views/vpn/ipsecvpn.vue

@@ -82,18 +82,18 @@ export default {
   },
   async mounted () {
     await this.sigcacertquery()
-    const res = await this.secclientquery()
+    const res = await this.getIPSecClient()
     if (res.errcode === 0) {
       this.ruleForm = res.data
     }
   },
   methods: {
-    ...mapActions(['sigcacertquery', 'ipsecvpnstate', 'caquery', 'secclient', 'secclientquery']),
+    ...mapActions(['sigcacertquery', 'ipsecState', 'caquery', 'setIPSecClient', 'getIPSecClient']),
     // 提交数据
     async onSubmit () {
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
-        const res = await this.secclient(this.ruleForm)
+        const res = await this.setIPSecClient(this.ruleForm)
         if (res.errcode === 0) {
           this.$message.success('设置成功')
         }
@@ -101,7 +101,7 @@ export default {
     },
     // 启动停止重启
     async reboot (e) {
-      const dw = await this.ipsecvpnstate({ type: e })
+      const dw = await this.ipsecState({ type: e })
       if (dw.errcode === 0) {
         this.$message.success('操作成功')
       }

+ 4 - 4
src/views/vpn/ipsecservicevpn.vue

@@ -89,18 +89,18 @@ export default {
   async mounted () {
     await this.caquery()
     await this.sigcacertquery()
-    const res = this.ipsecservicequery()
+    const res = this.getIPSecServer()
     if (res.errcode === 0) {
       this.ruleForm = res.data
     }
   },
   methods: {
-    ...mapActions(['sigcacertquery', 'ipsecvpnstate', 'caquery', 'secservice', 'ipsecservicequery']),
+    ...mapActions(['sigcacertquery', 'ipsecState', 'caquery', 'setIPSecServer', 'getIPSecServer']),
     // 提交数据
     async onSubmit () {
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
-        const res = await this.secservice(this.ruleForm)
+        const res = await this.setIPSecServer(this.ruleForm)
         if (res.errcode === 0) {
           this.$message.success('设置成功')
         }
@@ -108,7 +108,7 @@ export default {
     },
     // 启动停止重启
     async reboot (e) {
-      const dw = await this.ipsecvpnstate({ type: e })
+      const dw = await this.ipsecState({ type: e })
       if (dw.errcode === 0) {
         this.$message.success('操作成功')
       }

+ 3 - 3
src/views/vpn/sslvpn.vue

@@ -98,12 +98,12 @@ export default {
     }
   },
   methods: {
-    ...mapActions(['sigcacertquery', 'sslvpnstate', 'caquery', 'sslvpnclient', 'sslquery']),
+    ...mapActions(['sigcacertquery', 'sslState', 'caquery', 'setSSLClient', 'sslquery']),
     // 提交数据
     async onSubmit () {
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
-        const res = await this.sslvpnclient(this.ruleForm)
+        const res = await this.setSSLClient(this.ruleForm)
         if (res.errcode === 0) {
           this.$message.success('设置成功')
         }
@@ -111,7 +111,7 @@ export default {
     },
     // 启动停止重启
     async reboot (e) {
-      const dw = await this.sslvpnstate({ type: e })
+      const dw = await this.sslState({ type: e })
       if (dw.errcode === 0) {
         this.$message.success('操作成功')
       }

+ 3 - 3
src/views/vpn/sslservicevpn.vue

@@ -119,12 +119,12 @@ export default {
     }
   },
   methods: {
-    ...mapActions(['sigcacertquery', 'sslvpnstate', 'caquery', 'sslvpnservice', 'sslserivcequery']),
+    ...mapActions(['sigcacertquery', 'sslState', 'caquery', 'setSSLServer', 'sslserivcequery']),
     // 提交数据
     async onSubmit () {
       this.$refs.form.validate(async (valid) => {
         if (!valid) return false
-        const res = await this.sslvpnservice(this.ruleForm)
+        const res = await this.setSSLServer(this.ruleForm)
         if (res.errcode === 0) {
           this.$message.success('设置成功')
         }
@@ -132,7 +132,7 @@ export default {
     },
     // 启动停止重启
     async reboot (e) {
-      const dw = await this.sslvpnstate({ type: e })
+      const dw = await this.sslState({ type: e })
       if (dw.errcode === 0) {
         this.$message.success('操作成功')
       }