修复构建报错

This commit is contained in:
李志强 2025-11-05 16:12:56 +08:00
parent a7bde8bb72
commit ad8978617c
5 changed files with 35 additions and 2 deletions

View File

@ -41,6 +41,9 @@ export function editUser(userId, data) {
data,
});
}
// 更新用户信息(别名)
export const updateUserInfo = editUser;
// 删除用户
export function deleteUser(userId) {

View File

@ -0,0 +1,13 @@
<template>
<div>
<router-view />
</div>
</template>
<script setup lang="ts">
//
</script>
<style scoped>
</style>

View File

@ -0,0 +1,13 @@
<template>
<div>
<router-view />
</div>
</template>
<script setup lang="ts">
//
</script>
<style scoped>
</style>

View File

@ -9,9 +9,12 @@ import (
"github.com/beego/beego/v2/server/web/context"
)
// 项目版本号
const Version = "1.0.0"
func main() {
// 初始化数据库
models.Init()
models.Init(Version)
// CORS配置已移至router.go中统一管理
// 确保请求体被正确读取(包括 POST、PUT、PATCH

View File

@ -392,7 +392,7 @@ func DeleteUser(id int) error {
}
// Init 初始化数据库
func Init() {
func Init(version string) {
orm.RegisterModel(new(User))
orm.RegisterModel(new(Menu))
orm.RegisterModel(new(ProgramCategory))
@ -430,5 +430,6 @@ func Init() {
// 注意Beego v2 中不需要显式调用 Using默认使用 "default"
fmt.Println("数据库连接成功!")
fmt.Printf("当前项目版本: %s\n", version)
}
}