mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 08:46:38 +08:00
add release v4.1.4
This commit is contained in:
parent
c522248d39
commit
4df1c7a136
@ -11,6 +11,7 @@
|
||||
* 功能优化:Luma生成视频任务增加自动翻译功能
|
||||
* Bug修复:Suno 和 Luma 任务没有判断用户算力
|
||||
* 功能新增:邮箱注册增加邮箱后缀白名单,防止使用某些垃圾邮箱注册薅羊毛
|
||||
* 功能优化:清空未支付订单时,只清空超过15分钟未支付的订单
|
||||
|
||||
## v4.1.3
|
||||
* 功能优化:重构用户登录模块,给所有的登录组件增加行为验证码功能,支持用户绑定手机,邮箱和微信
|
||||
|
@ -79,6 +79,7 @@ TikaHost = "http://tika:9998"
|
||||
From = "test@163.com" # 发件邮箱人地址
|
||||
Password = "" #邮箱 stmp 服务授权码
|
||||
|
||||
# 支付宝商户支付
|
||||
[AlipayConfig]
|
||||
Enabled = false # 启用支付宝支付通道
|
||||
SandBox = false # 是否启用沙盒模式
|
||||
@ -89,6 +90,7 @@ TikaHost = "http://tika:9998"
|
||||
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
|
||||
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
|
||||
|
||||
# 虎皮椒支付
|
||||
[HuPiPayConfig]
|
||||
Enabled = false
|
||||
AppId = ""
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"geekai/store/vo"
|
||||
"geekai/utils"
|
||||
"geekai/utils/resp"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
@ -102,7 +103,7 @@ func (h *OrderHandler) Remove(c *gin.Context) {
|
||||
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 {
|
||||
resp.ERROR(c, err.Error())
|
||||
return
|
||||
@ -112,8 +113,20 @@ func (h *OrderHandler) Remove(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (h *OrderHandler) Clear(c *gin.Context) {
|
||||
|
||||
err := h.DB.Unscoped().Where("status <> ?", 2).Where("pay_time", 0).Delete(&model.Order{}).Error
|
||||
var orders []model.Order
|
||||
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 {
|
||||
resp.ERROR(c, err.Error())
|
||||
return
|
||||
|
@ -2,7 +2,6 @@ package model
|
||||
|
||||
import (
|
||||
"geekai/core/types"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Order 充值订单
|
||||
@ -20,5 +19,4 @@ type Order struct {
|
||||
PayTime int64
|
||||
PayWay string // 支付渠道
|
||||
PayType string // 支付类型
|
||||
DeletedAt gorm.DeletedAt
|
||||
}
|
||||
|
@ -76,40 +76,37 @@ TikaHost = "http://tika:9998"
|
||||
AccessToken = "GeekMaster" # 执行器 API 通信 token
|
||||
RegistryKey = "chatgpt-plus" # 任务注册 key,需要与 xxl-job 管理后台配置一致,请不要随意改动
|
||||
|
||||
# 支付宝商户支付
|
||||
[AlipayConfig]
|
||||
Enabled = false
|
||||
SandBox = false
|
||||
AppId = "9021000131658023"
|
||||
UserId = "2088721020750581"
|
||||
PrivateKey = "certs/alipay/privateKey.txt"
|
||||
PublicKey = "certs/alipay/appPublicCert.crt"
|
||||
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt"
|
||||
RootCert = "certs/alipay/alipayRootCert.crt"
|
||||
NotifyURL = "https://ai.r9it.com/api/payment/alipay/notify"
|
||||
ReturnURL = ""
|
||||
Enabled = false # 启用支付宝支付通道
|
||||
SandBox = false # 是否启用沙盒模式
|
||||
UserId = "2088721020750581" # 商户ID
|
||||
AppId = "9021000131658023" # App Id
|
||||
PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
|
||||
PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
|
||||
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
|
||||
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
|
||||
|
||||
# 虎皮椒支付
|
||||
[HuPiPayConfig]
|
||||
Enabled = false
|
||||
Name = "wechat"
|
||||
AppId = ""
|
||||
AppSecret = ""
|
||||
ApiURL = "https://api.xunhupay.com"
|
||||
NotifyURL = "https://ai.r9it.com/api/payment/hupipay/notify"
|
||||
ReturnURL = ""
|
||||
|
||||
[SmtpConfig] # 注意,阿里云服务器禁用了25号端口,请使用 465 端口,并开启 TLS 连接
|
||||
UseTls = false
|
||||
Host = "smtp.163.com"
|
||||
Port = 25
|
||||
AppName = "极客学长"
|
||||
From = "test@163.com" # 发件邮箱人地址
|
||||
Password = "" #邮箱 stmp 服务授权码
|
||||
|
||||
[JPayConfig]
|
||||
# 微信商户支付
|
||||
[WechatPayConfig]
|
||||
Enabled = false
|
||||
Name = "wechat" # 请不要改动
|
||||
AppId = "" # 商户 ID
|
||||
PrivateKey = "" # 秘钥
|
||||
ApiURL = "https://payjs.cn"
|
||||
NotifyURL = "https://ai.r9it.com/api/payment/payjs/notify"
|
||||
ReturnURL = ""
|
||||
AppId = "" # 商户应用ID
|
||||
MchId = "" # 商户号
|
||||
SerialNo = "" # API 证书序列号
|
||||
PrivateKey = "certs/alipay/privateKey.txt" # API 证书私钥文件路径,跟支付宝一样,把私钥文件拷贝到对应的路径,证书路径要映射到容器内
|
||||
ApiV3Key = "" # APIV3 私钥,这个是你自己在微信支付平台设置的
|
||||
|
||||
# 易支付
|
||||
[GeekPayConfig]
|
||||
Enabled = true
|
||||
AppId = "" # 商户ID
|
||||
PrivateKey = "" # 商户私钥
|
||||
ApiURL = "https://pay.geekai.cn"
|
||||
Methods = ["alipay", "wxpay", "qqpay", "jdpay", "douyin", "paypal"] # 支持的支付方式
|
@ -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_USER=18888888888
|
||||
VUE_APP_PASS=12345678
|
||||
|
@ -1,6 +1,6 @@
|
||||
VUE_APP_API_HOST=
|
||||
VUE_APP_WS_HOST=
|
||||
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_GIT_URL=https://github.com/yangjian102621/geekai
|
||||
|
@ -8,7 +8,7 @@
|
||||
import {ElConfigProvider} from 'element-plus';
|
||||
import {onMounted} from "vue";
|
||||
import {getSystemInfo} from "@/store/cache";
|
||||
import {isChrome} from "@/utils/libs";
|
||||
import {isChrome, isMobile} from "@/utils/libs";
|
||||
import {showMessageInfo} from "@/utils/dialog";
|
||||
|
||||
const debounce = (fn, delay) => {
|
||||
@ -38,7 +38,7 @@ onMounted(() => {
|
||||
link.href = res.data.logo
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
if (!isChrome()) {
|
||||
if (!isChrome() && !isMobile()) {
|
||||
showMessageInfo("检测到您使用的浏览器不是 Chrome,可能会导致部分功能无法正常使用,建议使用 Chrome 浏览器。")
|
||||
}
|
||||
})
|
||||
|
@ -202,7 +202,7 @@ const pay = (product, payWay) => {
|
||||
loadingText.value = "正在生成支付订单..."
|
||||
let host = process.env.VUE_APP_API_HOST
|
||||
if (host === '') {
|
||||
host = `${location.protocol}://${location.host}`;
|
||||
host = `${location.protocol}//${location.host}`;
|
||||
}
|
||||
httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, {
|
||||
product_id: product.id,
|
||||
|
@ -579,9 +579,12 @@ const fixData = () => {
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
loading.value = true
|
||||
httpGet("/api/admin/config/fixData").then(() => {
|
||||
ElMessage.success("数据修复成功")
|
||||
loading.value = false
|
||||
}).catch(e => {
|
||||
loading.value = false
|
||||
ElMessage.error("数据修复失败:" + e.message)
|
||||
})
|
||||
})
|
||||
|
@ -163,20 +163,6 @@ checkSession().then(user => {
|
||||
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 = () => {
|
||||
// 加载模型
|
||||
httpGet('/api/model/list').then(res => {
|
||||
@ -213,6 +199,21 @@ const loadModels = () => {
|
||||
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)
|
||||
|
||||
|
@ -298,7 +298,7 @@ const pay = (product,payWay) => {
|
||||
});
|
||||
let host = process.env.VUE_APP_API_HOST
|
||||
if (host === '') {
|
||||
host = `${location.protocol}://${location.host}`;
|
||||
host = `${location.protocol}//${location.host}`;
|
||||
}
|
||||
httpPost(`${process.env.VUE_APP_API_HOST}/api/payment/doPay`, {
|
||||
product_id: product.id,
|
||||
|
Loading…
Reference in New Issue
Block a user