mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
fixed bug for audio and video downloading
This commit is contained in:
parent
ff9142ddd4
commit
6e03f4b363
@ -1,4 +1,7 @@
|
||||
# 更新日志
|
||||
## v4.1.7
|
||||
* Bug修复:手机邮箱相关的注册问题 [#IB0HS5](https://gitee.com/blackfox/geekai/issues/IB0HS5)
|
||||
* Bug修复:音乐视频无法下载,思维导图下载后看不清文字[#IB0N2E](https://gitee.com/blackfox/geekai/issues/IB0N2E)
|
||||
## v4.1.6
|
||||
* 功能新增:**支持OpenAI实时语音对话功能** :rocket: :rocket: :rocket:, Beta 版,目前没有做算力计费控制,目前只有 VIP 用户可以使用。
|
||||
* 功能优化:优化MysQL容器配置文档,解决MysQL容器资源占用过高问题
|
||||
|
@ -130,29 +130,9 @@ func (h *UserHandler) Register(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// check if the username is existing
|
||||
var item model.User
|
||||
session := h.DB.Session(&gorm.Session{})
|
||||
if data.Mobile != "" {
|
||||
session = session.Where("mobile = ?", data.Mobile)
|
||||
data.Username = data.Mobile
|
||||
} else if data.Email != "" {
|
||||
session = session.Where("email = ?", data.Email)
|
||||
data.Username = data.Email
|
||||
} else if data.Username != "" {
|
||||
session = session.Where("username = ?", data.Username)
|
||||
}
|
||||
session.First(&item)
|
||||
if item.Id > 0 {
|
||||
resp.ERROR(c, "该用户名已经被注册")
|
||||
return
|
||||
}
|
||||
|
||||
salt := utils.RandString(8)
|
||||
user := model.User{
|
||||
Username: data.Username,
|
||||
Mobile: data.Mobile,
|
||||
Email: data.Email,
|
||||
Password: utils.GenPassword(data.Password, salt),
|
||||
Avatar: "/images/avatar/user.png",
|
||||
Salt: salt,
|
||||
@ -162,6 +142,26 @@ func (h *UserHandler) Register(c *gin.Context) {
|
||||
Power: h.App.SysConfig.InitPower,
|
||||
}
|
||||
|
||||
// check if the username is existing
|
||||
var item model.User
|
||||
session := h.DB.Session(&gorm.Session{})
|
||||
if data.Mobile != "" {
|
||||
session = session.Where("mobile = ?", data.Mobile)
|
||||
user.Username = data.Mobile
|
||||
user.Mobile = data.Mobile
|
||||
} else if data.Email != "" {
|
||||
session = session.Where("email = ?", data.Email)
|
||||
user.Username = data.Email
|
||||
user.Email = data.Email
|
||||
} else if data.Username != "" {
|
||||
session = session.Where("username = ?", data.Username)
|
||||
}
|
||||
session.First(&item)
|
||||
if item.Id > 0 {
|
||||
resp.ERROR(c, "该用户名已经被注册")
|
||||
return
|
||||
}
|
||||
|
||||
// 被邀请人也获得赠送算力
|
||||
if data.InviteCode != "" {
|
||||
user.Power += h.App.SysConfig.InvitePower
|
||||
|
@ -225,6 +225,9 @@ export function showLoginDialog(router) {
|
||||
}
|
||||
|
||||
export const replaceImg =(img) => {
|
||||
if (!img.startsWith("http")) {
|
||||
img = `${location.protocol}//${location.host}/${img}`
|
||||
}
|
||||
const devHost = process.env.VUE_APP_API_HOST
|
||||
const localhost = "http://localhost:5678"
|
||||
if (img.includes(localhost)) {
|
||||
|
@ -23,7 +23,7 @@
|
||||
请选择生成思维导图的AI模型
|
||||
</div>
|
||||
<div class="param-line">
|
||||
<el-select v-model="modelID" placeholder="请选择模型" @change="changeModel" style="width:100%">
|
||||
<el-select v-model="modelID" placeholder="请选择模型" style="width:100%">
|
||||
<el-option
|
||||
v-for="item in models"
|
||||
:key="item.id"
|
||||
@ -243,6 +243,8 @@ const downloadImage = () => {
|
||||
canvas.height = svgElement.offsetHeight
|
||||
let context = canvas.getContext('2d')
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
context.fillStyle = 'white';
|
||||
context.fillRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
image.onload = function () {
|
||||
context.drawImage(image, 0, 0)
|
||||
|
@ -14,7 +14,7 @@ module.exports = defineConfig({
|
||||
]
|
||||
},
|
||||
|
||||
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
|
||||
publicPath: '/',
|
||||
|
||||
outputDir: 'dist',
|
||||
crossorigin: "anonymous",
|
||||
|
Loading…
Reference in New Issue
Block a user