From 6f3b8ed997bd18875ed4be7e345abdf8e29798ce Mon Sep 17 00:00:00 2001 From: moondie <528893699@qq.com> Date: Fri, 2 Feb 2024 12:18:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BD=99=E9=A2=9D=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=94=AF=E6=8C=81=E8=B7=A8=E5=9F=9F=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=20(#61)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 查询余额接口支持跨域请求 * 改正智谱倍率 --- common/model-ratio.go | 4 ++-- router/dashboard.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/model-ratio.go b/common/model-ratio.go index b743ed26..0f4044ca 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -84,8 +84,8 @@ func init() { "chatglm_std": {0.3572, ChannelTypeZhipu}, // ¥0.005 / 1k tokens "chatglm_lite": {0.1429, ChannelTypeZhipu}, // ¥0.002 / 1k tokens "glm-3-turbo": {0.3572, ChannelTypeZhipu}, // ¥0.005 / 1k tokens - "glm-4": {0.7143, ChannelTypeZhipu}, // ¥0.01 / 1k tokens - "glm-4v": {0.7143, ChannelTypeZhipu}, // ¥0.01 / 1k tokens + "glm-4": {7.143, ChannelTypeZhipu}, // ¥0.1 / 1k tokens + "glm-4v": {7.143, ChannelTypeZhipu}, // ¥0.1 / 1k tokens "embedding-2": {0.0357, ChannelTypeZhipu}, // ¥0.0005 / 1k tokens "cogview-3": {17.8571, ChannelTypeZhipu}, // ¥0.25 / 1张图片 "qwen-turbo": {0.5715, ChannelTypeAli}, // ¥0.008 / 1k tokens // https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing diff --git a/router/dashboard.go b/router/dashboard.go index 39ed1f93..fa3cac88 100644 --- a/router/dashboard.go +++ b/router/dashboard.go @@ -8,6 +8,7 @@ import ( ) func SetDashboardRouter(router *gin.Engine) { + router.Use(middleware.CORS()) apiRouter := router.Group("/") apiRouter.Use(gzip.Gzip(gzip.DefaultCompression)) apiRouter.Use(middleware.GlobalAPIRateLimit())