add release v4.1.4

This commit is contained in:
RockYang 2024-09-20 15:50:04 +08:00
parent c522248d39
commit 4df1c7a136
12 changed files with 68 additions and 53 deletions

View File

@ -11,6 +11,7 @@
* 功能优化Luma生成视频任务增加自动翻译功能 * 功能优化Luma生成视频任务增加自动翻译功能
* Bug修复Suno 和 Luma 任务没有判断用户算力 * Bug修复Suno 和 Luma 任务没有判断用户算力
* 功能新增:邮箱注册增加邮箱后缀白名单,防止使用某些垃圾邮箱注册薅羊毛 * 功能新增:邮箱注册增加邮箱后缀白名单,防止使用某些垃圾邮箱注册薅羊毛
* 功能优化清空未支付订单时只清空超过15分钟未支付的订单
## v4.1.3 ## v4.1.3
* 功能优化:重构用户登录模块,给所有的登录组件增加行为验证码功能,支持用户绑定手机,邮箱和微信 * 功能优化:重构用户登录模块,给所有的登录组件增加行为验证码功能,支持用户绑定手机,邮箱和微信

View File

@ -79,6 +79,7 @@ TikaHost = "http://tika:9998"
From = "test@163.com" # 发件邮箱人地址 From = "test@163.com" # 发件邮箱人地址
Password = "" #邮箱 stmp 服务授权码 Password = "" #邮箱 stmp 服务授权码
# 支付宝商户支付
[AlipayConfig] [AlipayConfig]
Enabled = false # 启用支付宝支付通道 Enabled = false # 启用支付宝支付通道
SandBox = false # 是否启用沙盒模式 SandBox = false # 是否启用沙盒模式
@ -89,6 +90,7 @@ TikaHost = "http://tika:9998"
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书 AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书 RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
# 虎皮椒支付
[HuPiPayConfig] [HuPiPayConfig]
Enabled = false Enabled = false
AppId = "" AppId = ""

View File

@ -15,6 +15,7 @@ import (
"geekai/store/vo" "geekai/store/vo"
"geekai/utils" "geekai/utils"
"geekai/utils/resp" "geekai/utils/resp"
"time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"gorm.io/gorm" "gorm.io/gorm"
@ -102,7 +103,7 @@ func (h *OrderHandler) Remove(c *gin.Context) {
return return
} }
err := h.DB.Unscoped().Where("id = ?", id).Delete(&model.Order{}).Error err := h.DB.Where("id = ?", id).Delete(&model.Order{}).Error
if err != nil { if err != nil {
resp.ERROR(c, err.Error()) resp.ERROR(c, err.Error())
return return
@ -112,8 +113,20 @@ func (h *OrderHandler) Remove(c *gin.Context) {
} }
func (h *OrderHandler) Clear(c *gin.Context) { func (h *OrderHandler) Clear(c *gin.Context) {
var orders []model.Order
err := h.DB.Unscoped().Where("status <> ?", 2).Where("pay_time", 0).Delete(&model.Order{}).Error err := h.DB.Where("status <> ?", 2).Where("pay_time", 0).Find(&orders).Error
if err != nil {
resp.ERROR(c, err.Error())
return
}
deleteIds := make([]uint, 0)
for _, order := range orders {
// 只删除 15 分钟内的未支付订单
if time.Now().After(order.CreatedAt.Add(time.Minute * 15)) {
deleteIds = append(deleteIds, order.Id)
}
}
err = h.DB.Where("id IN ?", deleteIds).Delete(&model.Order{}).Error
if err != nil { if err != nil {
resp.ERROR(c, err.Error()) resp.ERROR(c, err.Error())
return return

View File

@ -2,7 +2,6 @@ package model
import ( import (
"geekai/core/types" "geekai/core/types"
"gorm.io/gorm"
) )
// Order 充值订单 // Order 充值订单
@ -20,5 +19,4 @@ type Order struct {
PayTime int64 PayTime int64
PayWay string // 支付渠道 PayWay string // 支付渠道
PayType string // 支付类型 PayType string // 支付类型
DeletedAt gorm.DeletedAt
} }

View File

@ -76,40 +76,37 @@ TikaHost = "http://tika:9998"
AccessToken = "GeekMaster" # 执行器 API 通信 token AccessToken = "GeekMaster" # 执行器 API 通信 token
RegistryKey = "chatgpt-plus" # 任务注册 key需要与 xxl-job 管理后台配置一致,请不要随意改动 RegistryKey = "chatgpt-plus" # 任务注册 key需要与 xxl-job 管理后台配置一致,请不要随意改动
# 支付宝商户支付
[AlipayConfig] [AlipayConfig]
Enabled = false Enabled = false # 启用支付宝支付通道
SandBox = false SandBox = false # 是否启用沙盒模式
AppId = "9021000131658023" UserId = "2088721020750581" # 商户ID
UserId = "2088721020750581" AppId = "9021000131658023" # App Id
PrivateKey = "certs/alipay/privateKey.txt" PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
PublicKey = "certs/alipay/appPublicCert.crt" PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
RootCert = "certs/alipay/alipayRootCert.crt" RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
NotifyURL = "https://ai.r9it.com/api/payment/alipay/notify"
ReturnURL = ""
# 虎皮椒支付
[HuPiPayConfig] [HuPiPayConfig]
Enabled = false Enabled = false
Name = "wechat"
AppId = "" AppId = ""
AppSecret = "" AppSecret = ""
ApiURL = "https://api.xunhupay.com" ApiURL = "https://api.xunhupay.com"
NotifyURL = "https://ai.r9it.com/api/payment/hupipay/notify"
ReturnURL = ""
[SmtpConfig] # 注意阿里云服务器禁用了25号端口请使用 465 端口,并开启 TLS 连接 # 微信商户支付
UseTls = false [WechatPayConfig]
Host = "smtp.163.com"
Port = 25
AppName = "极客学长"
From = "test@163.com" # 发件邮箱人地址
Password = "" #邮箱 stmp 服务授权码
[JPayConfig]
Enabled = false Enabled = false
Name = "wechat" # 请不要改动 AppId = "" # 商户应用ID
MchId = "" # 商户号
SerialNo = "" # API 证书序列号
PrivateKey = "certs/alipay/privateKey.txt" # API 证书私钥文件路径,跟支付宝一样,把私钥文件拷贝到对应的路径,证书路径要映射到容器内
ApiV3Key = "" # APIV3 私钥,这个是你自己在微信支付平台设置的
# 易支付
[GeekPayConfig]
Enabled = true
AppId = "" # 商户ID AppId = "" # 商户ID
PrivateKey = "" # 秘钥 PrivateKey = "" # 商户私钥
ApiURL = "https://payjs.cn" ApiURL = "https://pay.geekai.cn"
NotifyURL = "https://ai.r9it.com/api/payment/payjs/notify" Methods = ["alipay", "wxpay", "qqpay", "jdpay", "douyin", "paypal"] # 支持的支付方式
ReturnURL = ""

View File

@ -1,4 +1,4 @@
VUE_APP_API_HOST=http://www.geekai.me:6004 VUE_APP_API_HOST=http://localhost:5678
VUE_APP_WS_HOST=ws://localhost:5678 VUE_APP_WS_HOST=ws://localhost:5678
VUE_APP_USER=18888888888 VUE_APP_USER=18888888888
VUE_APP_PASS=12345678 VUE_APP_PASS=12345678

View File

@ -1,6 +1,6 @@
VUE_APP_API_HOST= VUE_APP_API_HOST=
VUE_APP_WS_HOST= VUE_APP_WS_HOST=
VUE_APP_KEY_PREFIX=GeekAI_ VUE_APP_KEY_PREFIX=GeekAI_
VUE_APP_VERSION=v4.1.3 VUE_APP_VERSION=v4.1.4
VUE_APP_DOCS_URL=https://docs.geekai.me VUE_APP_DOCS_URL=https://docs.geekai.me
VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai

View File

@ -8,7 +8,7 @@
import {ElConfigProvider} from 'element-plus'; import {ElConfigProvider} from 'element-plus';
import {onMounted} from "vue"; import {onMounted} from "vue";
import {getSystemInfo} from "@/store/cache"; import {getSystemInfo} from "@/store/cache";
import {isChrome} from "@/utils/libs"; import {isChrome, isMobile} from "@/utils/libs";
import {showMessageInfo} from "@/utils/dialog"; import {showMessageInfo} from "@/utils/dialog";
const debounce = (fn, delay) => { const debounce = (fn, delay) => {
@ -38,7 +38,7 @@ onMounted(() => {
link.href = res.data.logo link.href = res.data.logo
document.head.appendChild(link) document.head.appendChild(link)
}) })
if (!isChrome()) { if (!isChrome() && !isMobile()) {
showMessageInfo("检测到您使用的浏览器不是 Chrome可能会导致部分功能无法正常使用建议使用 Chrome 浏览器。") showMessageInfo("检测到您使用的浏览器不是 Chrome可能会导致部分功能无法正常使用建议使用 Chrome 浏览器。")
} }
}) })

View File

@ -202,7 +202,7 @@ const pay = (product, payWay) => {
loadingText.value = "正在生成支付订单..." loadingText.value = "正在生成支付订单..."
let host = process.env.VUE_APP_API_HOST let host = process.env.VUE_APP_API_HOST
if (host === '') { if (host === '') {
host = `${location.protocol}://${location.host}`; host = `${location.protocol}//${location.host}`;
} }
httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, { httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, {
product_id: product.id, product_id: product.id,

View File

@ -579,9 +579,12 @@ const fixData = () => {
type: 'warning', type: 'warning',
} }
).then(() => { ).then(() => {
loading.value = true
httpGet("/api/admin/config/fixData").then(() => { httpGet("/api/admin/config/fixData").then(() => {
ElMessage.success("数据修复成功") ElMessage.success("数据修复成功")
loading.value = false
}).catch(e => { }).catch(e => {
loading.value = false
ElMessage.error("数据修复失败:" + e.message) ElMessage.error("数据修复失败:" + e.message)
}) })
}) })

View File

@ -163,20 +163,6 @@ checkSession().then(user => {
router.push('/login') router.push('/login')
}) })
if (chatId.value) {
httpGet(`/api/chat/detail?chat_id=${chatId.value}`).then(res => {
title.value = res.data.title
modelId.value = res.data.model_id
roleId.value = res.data.role_id
loadModels()
}).catch(() => {
loadModels()
})
} else {
title.value = "新建对话"
chatId.value = UUID()
}
const loadModels = () => { const loadModels = () => {
// //
httpGet('/api/model/list').then(res => { httpGet('/api/model/list').then(res => {
@ -213,6 +199,21 @@ const loadModels = () => {
showNotify({type: "danger", message: "加载模型失败: " + e.message}) showNotify({type: "danger", message: "加载模型失败: " + e.message})
}) })
} }
if (chatId.value) {
httpGet(`/api/chat/detail?chat_id=${chatId.value}`).then(res => {
title.value = res.data.title
modelId.value = res.data.model_id
roleId.value = res.data.role_id
loadModels()
}).catch(() => {
loadModels()
})
} else {
title.value = "新建对话"
chatId.value = UUID()
loadModels()
}
const url = ref(location.protocol + '//' + location.host + '/mobile/chat/export?chat_id=' + chatId.value) const url = ref(location.protocol + '//' + location.host + '/mobile/chat/export?chat_id=' + chatId.value)

View File

@ -298,7 +298,7 @@ const pay = (product,payWay) => {
}); });
let host = process.env.VUE_APP_API_HOST let host = process.env.VUE_APP_API_HOST
if (host === '') { if (host === '') {
host = `${location.protocol}://${location.host}`; host = `${location.protocol}//${location.host}`;
} }
httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, { httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, {
product_id: product.id, product_id: product.id,