Skip to content

Dev 2.7.9 #1992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
97a39ba
将参数缓存
Jan 6, 2025
7f1b918
媒体库增加分类,图库多选择时优化。
Jan 7, 2025
6e31567
编辑可选择分类
Jan 8, 2025
fcb58df
fix分类编辑
Jan 9, 2025
4c8127b
refactor(jwt): optimize JWT using `New()` instead of create instance …
huiyifyj Jan 13, 2025
17d4b15
[selectComponent.vue]上传组件支持查看大图 (#1982)
will0523 Jan 13, 2025
09c0c3f
将参数缓存,媒体库增加分类,图库多选择时优化。 (#1978)
tesun Jan 13, 2025
935c4d5
Merge branch 'flipped-aurora:main' into main
tesun Jan 17, 2025
38d4f25
fix(breakpoint.vue):修复文件上传进度显示bug&按钮样式优化 (#1986)
GIS142857 Jan 17, 2025
1e727d2
refactor: rename error with `Err` prefix to follow Go conventions (#1…
huiyifyj Jan 17, 2025
ea7fa5c
fix:添加内部 iframe 展示网页,优化 permission 代码
bypanghu Jan 20, 2025
0682000
fix:添加内部 iframe 展示网页,优化 permission 代码
bypanghu Jan 20, 2025
2acca33
俩个uuid库合并一个,更新库到当前版本。
Jan 22, 2025
6a7c114
优化关于我们界面
Azir-11 Jan 26, 2025
9c7abf7
Merge pull request #1991 from Azir-11/main
pixelmaxQm Feb 8, 2025
d33a8a4
Merge pull request #1989 from bypanghu/main
pixelmaxQm Feb 8, 2025
b1d16e6
Merge branch 'flipped-aurora:main' into main
tesun Feb 9, 2025
7dccf8c
Merge branch 'dev-2.7.9' into main
pixelmaxQm Feb 11, 2025
b4166d3
Merge pull request #1990 from tesun/main
pixelmaxQm Feb 11, 2025
7d7c75f
Merge remote-tracking branch 'refs/remotes/origin/main' into dev-2.7.9
piexlmax Feb 11, 2025
3182dd8
feat: 个人中心头像调整,媒体库兼容性调整。
piexlmax Feb 11, 2025
e33b9c2
feat: 版本依赖降低至1.22
piexlmax Feb 11, 2025
9b25f33
feat: 自动化代码前端页面美化,多余按钮收入专家模式
piexlmax Feb 11, 2025
5221f61
feat: 增加单独生成web或者server功能
piexlmax Feb 11, 2025
ca47892
feat: 调整iframe功能
piexlmax Feb 11, 2025
ab081d1
feat: 限制单独生成前后端的情况下的细节配置
piexlmax Feb 12, 2025
c71c6c4
feat: 调整自动化代码在package模式下的生成逻辑
piexlmax Feb 12, 2025
015ea47
feat: 修复全选失败报错的问题
krank666 Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/api/v1/example/enter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import "github.com/flipped-aurora/gin-vue-admin/server/service"
type ApiGroup struct {
CustomerApi
FileUploadAndDownloadApi
AttachmentCategoryApi
}

var (
customerService = service.ServiceGroupApp.ExampleServiceGroup.CustomerService
fileUploadAndDownloadService = service.ServiceGroupApp.ExampleServiceGroup.FileUploadAndDownloadService
attachmentCategoryService = service.ServiceGroupApp.ExampleServiceGroup.AttachmentCategoryService
)
83 changes: 83 additions & 0 deletions server/api/v1/example/exa_attachment_category.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package example

import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)

type AttachmentCategoryApi struct{}

// GetCategoryList
// @Tags GetCategoryList
// @Summary 媒体库分类列表
// @Security AttachmentCategory
// @Produce application/json
// @Success 200 {object} response.Response{data=systemRes.SysAttachmentCategoryResponse,msg=string} "媒体库分类列表"
// @Router /attachmentCategory/getCategoryList [get]
func (a *AttachmentCategoryApi) GetCategoryList(c *gin.Context) {
res, err := attachmentCategoryService.GetCategoryList()
if err != nil {
global.GVA_LOG.Error("获取分类列表失败!", zap.Error(err))
response.FailWithMessage("获取分类列表失败", c)
return
}
response.OkWithData(res, c)
}

// AddCategory
// @Tags AddCategory
// @Summary 添加媒体库分类
// @Security AttachmentCategory
// @accept application/json
// @Produce application/json
// @Param data body example.ExaAttachmentCategory true ""
// @Success 200 {object} response.Response{msg=string} "添加媒体库分类"
// @Router /attachmentCategory/addCategory [post]
func (a *AttachmentCategoryApi) AddCategory(c *gin.Context) {
var req example.ExaAttachmentCategory
if err := c.ShouldBindJSON(&req); err != nil {
global.GVA_LOG.Error("参数错误!", zap.Error(err))
response.FailWithMessage("参数错误", c)
return
}

if err := attachmentCategoryService.AddCategory(&req); err != nil {
global.GVA_LOG.Error("创建/更新失败!", zap.Error(err))
response.FailWithMessage("创建/更新失败:"+err.Error(), c)
return
}
response.OkWithMessage("创建/更新成功", c)
}

// DeleteCategory
// @Tags DeleteCategory
// @Summary 删除分类
// @Security AttachmentCategory
// @accept application/json
// @Produce application/json
// @Param data body common.GetById true "分类id"
// @Success 200 {object} response.Response{msg=string} "删除分类"
// @Router /attachmentCategory/deleteCategory [post]
func (a *AttachmentCategoryApi) DeleteCategory(c *gin.Context) {
var req common.GetById
if err := c.ShouldBindJSON(&req); err != nil {
response.FailWithMessage("参数错误", c)
return
}

if req.ID == 0 {
response.FailWithMessage("参数错误", c)
return
}

if err := attachmentCategoryService.DeleteCategory(&req.ID); err != nil {
response.FailWithMessage("删除失败", c)
return
}

response.OkWithMessage("删除成功", c)
}
10 changes: 6 additions & 4 deletions server/api/v1/example/exa_file_upload_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package example

import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
"github.com/flipped-aurora/gin-vue-admin/server/model/example/request"
exampleRes "github.com/flipped-aurora/gin-vue-admin/server/model/example/response"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"strconv"
)

type FileUploadAndDownloadApi struct{}
Expand All @@ -25,12 +26,13 @@ func (b *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
var file example.ExaFileUploadAndDownload
noSave := c.DefaultQuery("noSave", "0")
_, header, err := c.Request.FormFile("file")
classId, _ := strconv.Atoi(c.DefaultPostForm("classId", "0"))
if err != nil {
global.GVA_LOG.Error("接收文件失败!", zap.Error(err))
response.FailWithMessage("接收文件失败", c)
return
}
file, err = fileUploadAndDownloadService.UploadFile(header, noSave) // 文件上传后拿到文件路径
file, err = fileUploadAndDownloadService.UploadFile(header, noSave, classId) // 文件上传后拿到文件路径
if err != nil {
global.GVA_LOG.Error("上传文件失败!", zap.Error(err))
response.FailWithMessage("上传文件失败", c)
Expand Down Expand Up @@ -85,11 +87,11 @@ func (b *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Param data body request.ExaAttachmentCategorySearch true "页码, 每页大小, 分类id"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页文件列表,返回包括列表,总数,页码,每页数量"
// @Router /fileUploadAndDownload/getFileList [post]
func (b *FileUploadAndDownloadApi) GetFileList(c *gin.Context) {
var pageInfo request.PageInfo
var pageInfo request.ExaAttachmentCategorySearch
err := c.ShouldBindJSON(&pageInfo)
if err != nil {
response.FailWithMessage(err.Error(), c)
Expand Down
17 changes: 8 additions & 9 deletions server/api/v1/system/sys_user.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package system

import (
"github.com/flipped-aurora/gin-vue-admin/server/model/common"
"strconv"
"time"

"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"

"github.com/gin-gonic/gin"
"github.com/redis/go-redis/v9"
"go.uber.org/zap"
Expand Down Expand Up @@ -257,17 +256,17 @@ func (b *BaseApi) SetUserAuthority(c *gin.Context) {
return
}
claims := utils.GetUserInfo(c)
j := &utils.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
claims.AuthorityId = sua.AuthorityId
if token, err := j.CreateToken(*claims); err != nil {
token, err := utils.NewJWT().CreateToken(*claims)
if err != nil {
global.GVA_LOG.Error("修改失败!", zap.Error(err))
response.FailWithMessage(err.Error(), c)
} else {
c.Header("new-token", token)
c.Header("new-expires-at", strconv.FormatInt(claims.ExpiresAt.Unix(), 10))
utils.SetToken(c, token, int((claims.ExpiresAt.Unix()-time.Now().Unix())/60))
response.OkWithMessage("修改成功", c)
return
}
c.Header("new-token", token)
c.Header("new-expires-at", strconv.FormatInt(claims.ExpiresAt.Unix(), 10))
utils.SetToken(c, token, int((claims.ExpiresAt.Unix()-time.Now().Unix())/60))
response.OkWithMessage("修改成功", c)
}

// SetUserAuthorities
Expand Down
Loading