ソースを参照

Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev

pixel 3 年 前
コミット
18e5f87801

+ 5 - 2
server/docs/docs.go

@@ -1,6 +1,6 @@
 // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
 // This file was generated by swaggo/swag at
-// 2021-04-30 13:57:23.4731221 +0800 CST m=+1.258292701
+// 2021-05-11 17:25:23.4731221 +0800 CST m=+1.258292701
 
 package docs
 
@@ -3396,6 +3396,7 @@ var doc = `{
                     }
                 },
                 "createdAt": {
+                    "description": "创建时间",
                     "type": "string"
                 },
                 "dataAuthorityId": {
@@ -3422,6 +3423,7 @@ var doc = `{
                     "type": "string"
                 },
                 "updatedAt": {
+                    "description": "更新时间",
                     "type": "string"
                 }
             }
@@ -3696,7 +3698,7 @@ var doc = `{
                     "type": "integer"
                 },
                 "nickName": {
-                    "description": "用户昵称\"",
+                    "description": "用户昵称",
                     "type": "string"
                 },
                 "updatedAt": {
@@ -4105,6 +4107,7 @@ var doc = `{
                     "$ref": "#/definitions/model.SysAuthority"
                 },
                 "oldAuthorityId": {
+                    "description": "旧角色ID",
                     "type": "string"
                 }
             }

+ 4 - 1
server/docs/swagger.json

@@ -3379,6 +3379,7 @@
                     }
                 },
                 "createdAt": {
+                    "description": "创建时间",
                     "type": "string"
                 },
                 "dataAuthorityId": {
@@ -3405,6 +3406,7 @@
                     "type": "string"
                 },
                 "updatedAt": {
+                    "description": "更新时间",
                     "type": "string"
                 }
             }
@@ -3679,7 +3681,7 @@
                     "type": "integer"
                 },
                 "nickName": {
-                    "description": "用户昵称\"",
+                    "description": "用户昵称",
                     "type": "string"
                 },
                 "updatedAt": {
@@ -4088,6 +4090,7 @@
                     "$ref": "#/definitions/model.SysAuthority"
                 },
                 "oldAuthorityId": {
+                    "description": "旧角色ID",
                     "type": "string"
                 }
             }

+ 4 - 1
server/docs/swagger.yaml

@@ -445,6 +445,7 @@ definitions:
           $ref: '#/definitions/model.SysAuthority'
         type: array
       createdAt:
+        description: 创建时间
         type: string
       dataAuthorityId:
         items:
@@ -463,6 +464,7 @@ definitions:
         description: 父角色ID
         type: string
       updatedAt:
+        description: 更新时间
         type: string
     type: object
   model.SysBaseMenu:
@@ -661,7 +663,7 @@ definitions:
         description: 主键ID
         type: integer
       nickName:
-        description: 用户昵称"
+        description: 用户昵称
         type: string
       updatedAt:
         description: 更新时间
@@ -952,6 +954,7 @@ definitions:
       authority:
         $ref: '#/definitions/model.SysAuthority'
       oldAuthorityId:
+        description: 旧角色ID
         type: string
     type: object
 info:

+ 1 - 1
server/model/request/common.go

@@ -8,7 +8,7 @@ type PageInfo struct {
 
 // Find by id structure
 type GetById struct {
-	ID float64 `json:"id" form:"id"`
+	ID float64 `json:"id" form:"id"` // 主键ID
 }
 
 type IdsReq struct {

+ 1 - 1
server/model/response/sys_authority.go

@@ -8,5 +8,5 @@ type SysAuthorityResponse struct {
 
 type SysAuthorityCopyResponse struct {
 	Authority      model.SysAuthority `json:"authority"`
-	OldAuthorityId string             `json:"oldAuthorityId"`
+	OldAuthorityId string             `json:"oldAuthorityId"` // 旧角色ID
 }

+ 4 - 4
server/model/sys_authority.go

@@ -5,12 +5,12 @@ import (
 )
 
 type SysAuthority struct {
-	CreatedAt       time.Time
-	UpdatedAt       time.Time
+	CreatedAt       time.Time      // 创建时间
+	UpdatedAt       time.Time      // 更新时间
 	DeletedAt       *time.Time     `sql:"index"`
 	AuthorityId     string         `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
-	AuthorityName   string         `json:"authorityName" gorm:"comment:角色名"` // 角色名
-	ParentId        string         `json:"parentId" gorm:"comment:父角色ID"` // 父角色ID
+	AuthorityName   string         `json:"authorityName" gorm:"comment:角色名"`                                    // 角色名
+	ParentId        string         `json:"parentId" gorm:"comment:父角色ID"`                                       // 父角色ID
 	DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id"`
 	Children        []SysAuthority `json:"children" gorm:"-"`
 	SysBaseMenus    []SysBaseMenu  `json:"menus" gorm:"many2many:sys_authority_menus;"`

+ 1 - 1
server/model/sys_user.go

@@ -10,7 +10,7 @@ type SysUser struct {
 	UUID        uuid.UUID    `json:"uuid" gorm:"comment:用户UUID"`                                                    // 用户UUID
 	Username    string       `json:"userName" gorm:"comment:用户登录名"`                                                 // 用户登录名
 	Password    string       `json:"-"  gorm:"comment:用户登录密码"`                                                      // 用户登录密码
-	NickName    string       `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`                                     // 用户昵称"
+	NickName    string       `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`                                     // 用户昵称
 	HeaderImg   string       `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
 	Authority   SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
 	AuthorityId string       `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID

+ 2 - 2
server/resource/template/web/table.vue.tpl

@@ -228,7 +228,7 @@ export default {
             type: 'success',
             message: '删除成功'
           })
-          if (this.tableData.length == ids.length) {
+          if (this.tableData.length == ids.length && this.page > 1) {
               this.page--;
           }
           this.deleteVisible = false
@@ -272,7 +272,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
             this.page--;
         }
         this.getTableData();

+ 2 - 2
web/src/components/customPic/index.vue

@@ -33,7 +33,7 @@ export default {
     },
     data(){
         return{
-            path: path,
+            path: path + '/',
         }
     },
     computed:{
@@ -72,4 +72,4 @@ export default {
     height: 80px;
     position: relative;
 }
-</style>
+</style>

+ 1 - 1
web/src/view/example/customer/customer.vue

@@ -125,7 +125,7 @@ export default {
           type: "success",
           message: ""
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/example/upload/upload.vue

@@ -116,7 +116,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 2 - 2
web/src/view/superAdmin/api/api.vue

@@ -199,7 +199,7 @@ export default {
             type:"success",
             message:res.msg
           })
-         if (this.tableData.length == ids.length) {
+         if (this.tableData.length == ids.length && this.page > 1) {
               this.page--;
           }
           this.deleteVisible = false
@@ -265,7 +265,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 1 - 1
web/src/view/superAdmin/authority/authority.vue

@@ -191,7 +191,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 1 - 1
web/src/view/superAdmin/dictionary/sysDictionary.vue

@@ -220,7 +220,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/superAdmin/dictionary/sysDictionaryDetail.vue

@@ -209,7 +209,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();

+ 1 - 1
web/src/view/superAdmin/menu/menu.vue

@@ -324,7 +324,7 @@ export default {
               type: "success",
               message: "删除成功!"
             });
-            if (this.tableData.length == 1) {
+            if (this.tableData.length == 1 && this.page > 1 ) {
               this.page--;
             }
             this.getTableData();

+ 2 - 2
web/src/view/superAdmin/operation/sysOperationRecord.vue

@@ -177,7 +177,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == ids.length) {
+        if (this.tableData.length == ids.length && this.page > 1) {
           this.page--;
         }
         this.deleteVisible = false;
@@ -192,7 +192,7 @@ export default {
           type: "success",
           message: "删除成功"
         });
-        if (this.tableData.length == 1) {
+        if (this.tableData.length == 1 && this.page > 1 ) {
           this.page--;
         }
         this.getTableData();