Skip to content

Commit 369b98a

Browse files
committed
chore: minor update
1 parent ae22015 commit 369b98a

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LLM Token Solution for Local AI Agents.
44

55
Open-source, local-first, and lightweight.
66

7-
[**Docs**](https://docs.uni-token.app) | [Python SDK](https://docs.uni-token.app/sdk/python.html) | [Node.js SDK](https://docs.uni-token.app/sdk/node.html) | [Go SDK](https://docs.uni-token.app/sdk/go.html) | [Browser SDK](https://docs.uni-token.app/sdk/browser.html) | [Launch App](https://uni-token.ap) | [Development](./CONTRIBUTING.md)
7+
[**Docs**](https://docs.uni-token.app) | [Python SDK](https://docs.uni-token.app/sdk/python.html) | [Node.js SDK](https://docs.uni-token.app/sdk/node.html) | [Go SDK](https://docs.uni-token.app/sdk/go.html) | [Browser SDK](https://docs.uni-token.app/sdk/browser.html) | [Launch App](https://uni-token.app) | [Development](./CONTRIBUTING.md)
88

99
## Why UniToken?
1010

frontend/src/components/Captcha.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { onMounted, onUnmounted, ref, shallowRef } from 'vue'
2+
import { computed, onMounted, onUnmounted, ref, shallowRef } from 'vue'
33
import { useI18n } from 'vue-i18n'
44
55
const props = defineProps<{
@@ -10,7 +10,7 @@ const emits = defineEmits<{
1010
next: [result: any]
1111
}>()
1212
const { t } = useI18n()
13-
const state = ref<'init' | 'pending' | 'success'>('init')
13+
const state = ref<'loading' | 'init' | 'pending' | 'success'>('loading')
1414
1515
declare global {
1616
interface Window {
@@ -35,6 +35,7 @@ onMounted(async () => {
3535
window.initGeetest4(
3636
props.config,
3737
(e: any) => {
38+
state.value = 'init'
3839
captcha.value = e
3940
e.onReady(() => {
4041
setTimeout(() => {
@@ -71,10 +72,17 @@ function onClick() {
7172
state.value = 'pending'
7273
captcha.value.showCaptcha()
7374
}
75+
76+
const statusText = computed(() => ({
77+
loading: t('common.loading'),
78+
init: t('captcha.getCode'),
79+
pending: t('captcha.getCode'),
80+
success: t('captcha.smsSent'),
81+
})[state.value])
7482
</script>
7583

7684
<template>
77-
<button v-if="captcha" @click="onClick">
78-
{{ state !== 'success' ? t('captcha.getCode') : t('captcha.smsSent') }}
85+
<button @click="onClick">
86+
{{ statusText }}
7987
</button>
8088
</template>

frontend/src/components/SiliconFlowConfigDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { useI18n } from 'vue-i18n'
3-
import SiliconFlow from '@/components/SiliconFlowCard.vue'
3+
import SiliconFlowCard from '@/components/SiliconFlowCard.vue'
44
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
55
66
const emit = defineEmits<{
@@ -22,7 +22,7 @@ const open = defineModel<boolean>('open')
2222
</DialogHeader>
2323

2424
<div class="my-2">
25-
<SiliconFlow @configured="(provider) => emit('configured', provider)" />
25+
<SiliconFlowCard @configured="(provider) => emit('configured', provider)" />
2626
</div>
2727
</DialogContent>
2828
</Dialog>

frontend/src/locales/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"common": {
3-
"loading": "正在验证身份...",
3+
"loading": "加载中...",
44
"error": "未知错误",
55
"invalidTime": "无效时间",
66
"confirm": "确认",

service/server/gateway.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,5 @@ func ensureToken(c *gin.Context) string {
195195
c.Abort()
196196
return ""
197197
}
198-
token := strings.TrimPrefix(authHeader, "Bearer ")
199-
claims, err := logic.ValidateJWT(token)
200-
if err != nil {
201-
c.JSON(http.StatusForbidden, gin.H{"error": "Invalid or expired token"})
202-
c.Abort()
203-
return ""
204-
}
205-
return claims.Id
198+
return strings.TrimPrefix(authHeader, "Bearer ")
206199
}

0 commit comments

Comments
 (0)