修复权限组编辑图片保存被写死与读取缺列,勾选状态可正常保存回显
This commit is contained in:
parent
93656492ef
commit
4e6e2ba0d1
@ -77,7 +77,7 @@ export async function GET() {
|
||||
canDownload: true,
|
||||
canDownloadSource: true,
|
||||
canShare: true,
|
||||
canEditAssets: false,
|
||||
canEditAssets: true,
|
||||
},
|
||||
},
|
||||
inheritors: {
|
||||
@ -259,6 +259,7 @@ export async function PUT(request: NextRequest) {
|
||||
canDownload?: boolean
|
||||
canDownloadSource?: boolean
|
||||
canShare?: boolean
|
||||
canEditAssets?: boolean
|
||||
}> = Array.isArray(body?.permissions) ? body.permissions : []
|
||||
if (incoming.length === 0) {
|
||||
return NextResponse.json({ error: '素材类型列表不能为空' }, { status: 400 })
|
||||
@ -271,7 +272,7 @@ export async function PUT(request: NextRequest) {
|
||||
canDownload: Boolean(item.canDownload),
|
||||
canDownloadSource: Boolean(item.canDownloadSource),
|
||||
canShare: true,
|
||||
canEditAssets: false,
|
||||
canEditAssets: item.canEditAssets === true,
|
||||
})),
|
||||
)
|
||||
return NextResponse.json({ ok: true })
|
||||
|
||||
@ -40,7 +40,7 @@ export async function GET() {
|
||||
canDownload: true,
|
||||
canDownloadSource: true,
|
||||
canShare: true,
|
||||
canEditAssets: false,
|
||||
canEditAssets: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -114,6 +114,7 @@ export async function PUT(request: NextRequest) {
|
||||
canDownload?: boolean
|
||||
canDownloadSource?: boolean
|
||||
canShare?: boolean
|
||||
canEditAssets?: boolean
|
||||
}> = Array.isArray(body?.permissions) ? body.permissions : []
|
||||
if (!slug) return NextResponse.json({ error: '缺少套餐' }, { status: 400 })
|
||||
if (incoming.length === 0) {
|
||||
@ -127,7 +128,7 @@ export async function PUT(request: NextRequest) {
|
||||
canDownload: Boolean(item.canDownload),
|
||||
canDownloadSource: Boolean(item.canDownloadSource),
|
||||
canShare: item.canShare !== false,
|
||||
canEditAssets: false,
|
||||
canEditAssets: item.canEditAssets === true,
|
||||
})),
|
||||
)
|
||||
return NextResponse.json({ ok: true })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user