浏览代码

format🥚 :格式化id字段

zhangwenjian 4 年之前
父节点
当前提交
9e38b69796

+ 2 - 2
src/api/file.js

@@ -14,7 +14,7 @@ export const sysfiledirAcionAdd = data => request({
 })
 
 export const sysfiledirAcionEdit = data => request({
-  url: '/api/v1/sysfiledir/' + data.ID,
+  url: '/api/v1/sysfiledir/' + data.id,
   method: 'PUT',
   data
 })
@@ -42,7 +42,7 @@ export const sysfileinfoAdd = data => request({
 })
 
 export const sysfileinfoEdit = data => request({
-  url: '/api/v1/sysfileinfo/' + data.ID,
+  url: '/api/v1/sysfileinfo/' + data.id,
   method: 'put',
   data
 })

+ 1 - 1
src/api/syscategory.js

@@ -29,7 +29,7 @@ export function addSysCategory(data) {
 // 修改SysCategory
 export function updateSysCategory(data) {
   return request({
-    url: '/api/v1/syscategory/' + data.ID,
+    url: '/api/v1/syscategory/' + data.id,
     method: 'put',
     data: data
   })

+ 1 - 1
src/api/system/config.js

@@ -38,7 +38,7 @@ export function addConfig(data) {
 // 修改参数配置
 export function updateConfig(data) {
   return request({
-    url: '/api/v1/config/' + data.ID,
+    url: '/api/v1/config/' + data.id,
     method: 'put',
     data: data
   })

+ 2 - 2
src/api/system/sys-login-log.js

@@ -20,9 +20,9 @@ export function getSysLoginlog(ID) {
 // 删除SysLoginlog
 export function delSysLoginlog(data) {
   return request({
-    url: '/api/v1/sys-login-log',
+    url: '/api/v1/sys-login-log/' + data.splice(0, 1),
     method: 'delete',
-    data: data
+    data: '{"ids":[' + data + ']}'
   })
 }
 

+ 2 - 2
src/api/system/sys-opera-log.js

@@ -20,9 +20,9 @@ export function listSysOperlog(query) {
 // 删除SysOperlog
 export function delSysOperlog(data) {
   return request({
-    url: '/api/v1/sys-opera-log',
+    url: '/api/v1/sys-opera-log/' + data.splice(0, 1),
     method: 'delete',
-    data: data
+    data: '{"ids":[' + data + ']}'
   })
 }
 

+ 4 - 4
src/components/FileChoose/index.vue

@@ -24,7 +24,7 @@
             <div class="file-footer-inner">
               <div
                 v-for="(item,index) in fileList"
-                :key="item.ID"
+                :key="item.id"
                 class="file-footer-item"
                 :class=" item.open ? 'file-active' : '' "
                 @click="handleChoose(item,index)"
@@ -244,7 +244,7 @@ export default {
     },
     handleChoose(e, index) {
       if (this.multiple) {
-        const fileIndex = this.resultList.findIndex(item => item.ID === e.ID)
+        const fileIndex = this.resultList.findIndex(item => item.id === e.id)
         if (e.open) {
           if (fileIndex < 0) {
             return false
@@ -272,7 +272,7 @@ export default {
         for (let i = 0; i < this.fileList.length; i++) {
           this.fileList[i].open = false
           for (let j = 0; j < this.resultList.length; j++) {
-            if (this.resultList[j].ID === this.fileList[i].ID) {
+            if (this.resultList[j].id === this.fileList[i].id) {
               this.fileList[i].open = true
             }
             continue
@@ -280,7 +280,7 @@ export default {
         }
       } else {
         for (let i = 0; i < this.fileList.length; i++) {
-          if (this.resultList.every(e => e.ID === this.fileList[i].ID)) {
+          if (this.resultList.every(e => e.id === this.fileList[i].id)) {
             this.fileList[i].open = true
           } else {
             this.fileList[i].open = false

+ 7 - 7
src/components/FileManage/Left.vue

@@ -21,7 +21,7 @@
                 v-show="node.childNodes.length > 0"
                 :class="node.expanded ? 'el-icon-folder-opened icon' : 'el-icon-folder icon'"
               />
-              <span v-if="rename.status && rename.node.ID === data.ID">
+              <span v-if="rename.status && rename.node.id === data.id">
                 <input
                   ref="nodeInput"
                   v-focus="rename.status"
@@ -142,7 +142,7 @@ export default {
   },
   methods: {
     handleNodeClick(e) {
-      const result = this.treeFindPath(this.data, node => node.ID === e.ID)
+      const result = this.treeFindPath(this.data, node => node.id === e.id)
       eventBus.$emit('treeNodeClick', {
         treeNodePath: result,
         currentNode: e
@@ -198,12 +198,12 @@ export default {
       d.label = this.$refs.nodeInput.value
       console.log(d)
       sysfiledirAcionEdit({
-        ID: d.ID,
+        id: d.id,
         label: d.label,
         pId: d.pId
       }).then(ret => {
         if (ret.code === 200) {
-          this.$refs.tree.updateKeyChildren(n.ID, d)
+          this.$refs.tree.updateKeyChildren(n.id, d)
         }
       })
     },
@@ -225,10 +225,10 @@ export default {
         case 1:
           sysfiledirAcionAdd({
             label: '新建文件夹',
-            pId: this.rightData.currentData.ID
+            pId: this.rightData.currentData.id
           }).then(ret => {
             if (ret.code === 200) {
-              this.$refs.tree.append(ret.data, this.rightData.currentData.ID)
+              this.$refs.tree.append(ret.data, this.rightData.currentData.id)
               this.getDirList()
             }
           })
@@ -244,7 +244,7 @@ export default {
           console.log(this.rename)
           break
         case 4:
-          sysfiledirAcionDel(this.rightData.currentData.ID).then(ret => {
+          sysfiledirAcionDel(this.rightData.currentData.id).then(ret => {
             if (ret.code === 200) {
               this.$refs.tree.remove(this.rightData.currentNode)
             }

+ 5 - 5
src/components/FileManage/Right.vue

@@ -7,7 +7,7 @@
             <el-breadcrumb separator-class="el-icon-arrow-right" class="dir">
               <el-breadcrumb-item
                 v-for="item in treePath.treeNodePath"
-                :key="item.ID"
+                :key="item.id"
               >{{ item.label }}</el-breadcrumb-item>
             </el-breadcrumb>
           </el-col>
@@ -339,7 +339,7 @@ export default {
       this.getList()
     },
     getList() {
-      const pId = this.treePath.currentNode.ID
+      const pId = this.treePath.currentNode.id
       if (pId) {
         sysfileinfoList({
           pId,
@@ -374,7 +374,7 @@ export default {
           size: `${item.size}`,
           url: item.path,
           fullUrl: item.full_path,
-          pId: this.treePath.currentNode.ID
+          pId: this.treePath.currentNode.id
         })
       })
       return Promise.all(path)
@@ -395,13 +395,13 @@ export default {
           break
         case 2:
           this.tableData.forEach((item, index) => {
-            if (item.ID === this.rightData.currentData.ID) {
+            if (item.id === this.rightData.currentData.id) {
               this.tableData[index].open = true
             }
           })
           break
         case 3:
-          sysfileinfoDelete(this.rightData.currentData.ID).then(ret => {
+          sysfileinfoDelete(this.rightData.currentData.id).then(ret => {
             if (ret.code === 200) {
               this.getList()
             }

+ 1 - 0
src/utils/request.js

@@ -20,6 +20,7 @@ service.interceptors.request.use(
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
       config.headers['Authorization'] = 'Bearer ' + getToken()
+      config.headers['Content-Type'] = 'application/json'
     }
     return config
   },

+ 4 - 4
src/views/config/index.vue

@@ -267,14 +267,14 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.ID)
+      this.ids = selection.map(item => item.id)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
-      const ID = row.ID || this.ids
+      const ID = row.id || this.ids
       getConfig(ID).then(response => {
         this.form = response.data
         this.open = true
@@ -286,7 +286,7 @@ export default {
     submitForm: function() {
       this.$refs['form'].validate(valid => {
         if (valid) {
-          if (this.form.ID !== undefined) {
+          if (this.form.id !== undefined) {
             updateConfig(this.form).then(response => {
               if (response.code === 200) {
                 this.msgSuccess('修改成功')
@@ -312,7 +312,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const configIds = row.ID || this.ids
+      const configIds = row.id || this.ids
       this.$confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',

+ 3 - 3
src/views/loginlog/index.vue

@@ -259,7 +259,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.ID)
+      this.ids = selection.map(item => item.id)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
@@ -267,7 +267,7 @@ export default {
     handleUpdate(row) {
       this.reset()
       const ID =
-                row.ID || this.ids
+                row.id || this.ids
       getSysLoginlog(ID).then(response => {
         this.form = response.data
         this.open = true
@@ -277,7 +277,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      var Ids = (row.ID && [row.ID]) || this.ids
+      var Ids = (row.id && [row.id]) || this.ids
 
       this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
         confirmButtonText: '确定',

+ 2 - 2
src/views/operlog/index.vue

@@ -237,7 +237,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.operId)
+      this.ids = selection.map(item => Number(item.id))
       this.multiple = !selection.length
     },
     /** 详细按钮操作 */
@@ -247,7 +247,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const operIds = row.ID || this.ids
+      const operIds = row.id || this.ids
       this.$confirm('是否确认删除日志编号为"' + operIds + '"的数据项?', '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',

+ 4 - 4
src/views/syscategory/index.vue

@@ -297,14 +297,14 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.ID)
+      this.ids = selection.map(item => item.id)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
-      const ID = row.ID || this.ids
+      const ID = row.id || this.ids
       getSysCategory(ID).then(response => {
         this.form = response.data
         this.open = true
@@ -316,7 +316,7 @@ export default {
     submitForm: function() {
       this.$refs['form'].validate(valid => {
         if (valid) {
-          if (this.form.ID !== undefined) {
+          if (this.form.id !== undefined) {
             updateSysCategory(this.form).then(response => {
               if (response.code === 200) {
                 this.msgSuccess('修改成功')
@@ -342,7 +342,7 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      var Ids = (row.ID && [row.ID]) || this.ids
+      var Ids = (row.id && [row.id]) || this.ids
 
       this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
         confirmButtonText: '确定',