mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
use absolute path for all routes
This commit is contained in:
parent
3b26735998
commit
f943669e18
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,5 +1,16 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## v3.1.2
|
||||||
|
1. 功能新增:新增七牛云 OSS 实现,目前已支持三种文件上传服务:Local, Minio, QiNiu OSS。
|
||||||
|
2. 功能新增:新增桌面版,使用 electron 套壳网页版。
|
||||||
|
3. Bug修复:自动去除众筹核销时候转账单号中的空格,防止复制的时候多复制了空格。
|
||||||
|
4. 功能优化:ChatPlus.vue 页面支持通过 chat_id path variable 来定位到指定的聊天。
|
||||||
|
5. 功能优化:取消导出聊天页面的授权验证
|
||||||
|
6. 功能优化:所有路由跳转都使用绝对路径
|
||||||
|
|
||||||
|
## v3.1.1
|
||||||
|
紧急修复版本,采用弹窗的方式显示验证码,解决验证码在低分辨率下被掩盖的Bug
|
||||||
|
|
||||||
## v3.1.0(大版本更新)
|
## v3.1.0(大版本更新)
|
||||||
1. 功能重构:将聊天模型独立拆分,以便支持多平台模型,目前已经内置支持 OPenAI,Azure 以及 ChatGLM,用户可以在这两个平台的模型中随意切换,体验不同的模型聊天。
|
1. 功能重构:将聊天模型独立拆分,以便支持多平台模型,目前已经内置支持 OPenAI,Azure 以及 ChatGLM,用户可以在这两个平台的模型中随意切换,体验不同的模型聊天。
|
||||||
2. 功能重构:重写系统 API 授权机制,使用 JWT 替换传统的 session 会话授权,使得 API 授权变得更加灵活。
|
2. 功能重构:重写系统 API 授权机制,使用 JWT 替换传统的 session 会话授权,使得 API 授权变得更加灵活。
|
||||||
|
@ -145,6 +145,8 @@ func authorizeMiddleware(s *AppServer, client *redis.Client) gin.HandlerFunc {
|
|||||||
c.Request.URL.Path == "/api/user/register" ||
|
c.Request.URL.Path == "/api/user/register" ||
|
||||||
c.Request.URL.Path == "/api/reward/notify" ||
|
c.Request.URL.Path == "/api/reward/notify" ||
|
||||||
c.Request.URL.Path == "/api/mj/notify" ||
|
c.Request.URL.Path == "/api/mj/notify" ||
|
||||||
|
c.Request.URL.Path == "/api/chat/history" ||
|
||||||
|
c.Request.URL.Path == "/api/chat/detail" ||
|
||||||
strings.HasPrefix(c.Request.URL.Path, "/api/sms/") ||
|
strings.HasPrefix(c.Request.URL.Path, "/api/sms/") ||
|
||||||
strings.HasPrefix(c.Request.URL.Path, "/api/captcha/") ||
|
strings.HasPrefix(c.Request.URL.Path, "/api/captcha/") ||
|
||||||
strings.HasPrefix(c.Request.URL.Path, "/static/") ||
|
strings.HasPrefix(c.Request.URL.Path, "/static/") ||
|
||||||
|
@ -35,14 +35,9 @@ func (h *ChatHandler) Update(c *gin.Context) {
|
|||||||
// History 获取聊天历史记录
|
// History 获取聊天历史记录
|
||||||
func (h *ChatHandler) History(c *gin.Context) {
|
func (h *ChatHandler) History(c *gin.Context) {
|
||||||
chatId := c.Query("chat_id") // 会话 ID
|
chatId := c.Query("chat_id") // 会话 ID
|
||||||
user, err := utils.GetLoginUser(c, h.db)
|
|
||||||
if err != nil {
|
|
||||||
resp.NotAuth(c)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var items []model.HistoryMessage
|
var items []model.HistoryMessage
|
||||||
var messages = make([]vo.HistoryMessage, 0)
|
var messages = make([]vo.HistoryMessage, 0)
|
||||||
res := h.db.Where("chat_id = ? AND user_id = ?", chatId, user.Id).Find(&items)
|
res := h.db.Where("chat_id = ?", chatId).Find(&items)
|
||||||
if res.Error != nil {
|
if res.Error != nil {
|
||||||
resp.ERROR(c, "No history message")
|
resp.ERROR(c, "No history message")
|
||||||
return
|
return
|
||||||
|
@ -102,7 +102,7 @@ const exportChat = () => {
|
|||||||
justify-content center
|
justify-content center
|
||||||
|
|
||||||
.chat-box {
|
.chat-box {
|
||||||
max-width 800px;
|
width 800px;
|
||||||
// 变量定义
|
// 变量定义
|
||||||
--content-font-size: 16px;
|
--content-font-size: 16px;
|
||||||
--content-color: #c1c1c1;
|
--content-color: #c1c1c1;
|
||||||
|
@ -356,7 +356,7 @@ onMounted(() => {
|
|||||||
ElMessage.error("加载会话列表失败!")
|
ElMessage.error("加载会话列表失败!")
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
router.push('login')
|
router.push('/login')
|
||||||
});
|
});
|
||||||
|
|
||||||
const clipboard = new Clipboard('.copy-reply');
|
const clipboard = new Clipboard('.copy-reply');
|
||||||
@ -417,7 +417,7 @@ const newChat = function () {
|
|||||||
|
|
||||||
// 切换会话
|
// 切换会话
|
||||||
const changeChat = (chat) => {
|
const changeChat = (chat) => {
|
||||||
router.push("/chat/"+chat.chat_id)
|
router.push("/chat/" + chat.chat_id)
|
||||||
loadChat(chat)
|
loadChat(chat)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -750,7 +750,7 @@ const logout = function () {
|
|||||||
activelyClose.value = true;
|
activelyClose.value = true;
|
||||||
httpGet('/api/user/logout').then(() => {
|
httpGet('/api/user/logout').then(() => {
|
||||||
removeUserToken();
|
removeUserToken();
|
||||||
router.push('login');
|
router.push('/login');
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage.error('注销失败!');
|
ElMessage.error('注销失败!');
|
||||||
})
|
})
|
||||||
|
@ -17,7 +17,7 @@ checkSession().then(() => {
|
|||||||
router.push("/chat")
|
router.push("/chat")
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
router.push("login")
|
router.push("/login")
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
<el-row class="text-line">
|
<el-row class="text-line">
|
||||||
还没有账号?
|
还没有账号?
|
||||||
<el-link type="primary" @click="router.push('register')">注册新账号</el-link>
|
<el-link type="primary" @click="router.push('/register')">注册新账号</el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -66,9 +66,9 @@ const password = ref(process.env.VUE_APP_PASS);
|
|||||||
|
|
||||||
checkSession().then(() => {
|
checkSession().then(() => {
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
router.push('mobile')
|
router.push('/mobile')
|
||||||
} else {
|
} else {
|
||||||
router.push('chat')
|
router.push('/chat')
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
@ -94,7 +94,7 @@ const login = function () {
|
|||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
router.push('/mobile')
|
router.push('/mobile')
|
||||||
} else {
|
} else {
|
||||||
router.push('chat')
|
router.push('/chat')
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
ElMessage.error('登录失败,' + e.message)
|
ElMessage.error('登录失败,' + e.message)
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<el-row class="text-line">
|
<el-row class="text-line">
|
||||||
已经有账号?
|
已经有账号?
|
||||||
<el-link type="primary" @click="router.push('login')">登录</el-link>
|
<el-link type="primary" @click="router.push('/login')">登录</el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -144,7 +144,7 @@ const register = function () {
|
|||||||
return ElMessage.error('请输入短信验证码');
|
return ElMessage.error('请输入短信验证码');
|
||||||
}
|
}
|
||||||
httpPost('/api/user/register', formData.value).then(() => {
|
httpPost('/api/user/register', formData.value).then(() => {
|
||||||
ElMessage.success({"message": "注册成功,即将跳转到登录页...", onClose: () => router.push("login")})
|
ElMessage.success({"message": "注册成功,即将跳转到登录页...", onClose: () => router.push("/login")})
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
ElMessage.error('注册失败,' + e.message)
|
ElMessage.error('注册失败,' + e.message)
|
||||||
})
|
})
|
||||||
|
@ -55,7 +55,7 @@ const username = ref(process.env.VUE_APP_ADMIN_USER);
|
|||||||
const password = ref(process.env.VUE_APP_ADMIN_PASS);
|
const password = ref(process.env.VUE_APP_ADMIN_PASS);
|
||||||
|
|
||||||
checkAdminSession().then(() => {
|
checkAdminSession().then(() => {
|
||||||
router.push("admin")
|
router.push("/admin")
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -76,7 +76,7 @@ const login = function () {
|
|||||||
|
|
||||||
httpPost('/api/admin/login', {username: username.value.trim(), password: password.value.trim()}).then(res => {
|
httpPost('/api/admin/login', {username: username.value.trim(), password: password.value.trim()}).then(res => {
|
||||||
setAdminToken(res.data)
|
setAdminToken(res.data)
|
||||||
router.push("admin")
|
router.push("/admin")
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
ElMessage.error('登录失败,' + e.message)
|
ElMessage.error('登录失败,' + e.message)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user