deploy: auto commit repo-root changes 2026-07-05 12:33:57

This commit is contained in:
hajimi
2026-07-05 12:33:57 +08:00
parent 1954948445
commit f641276b9d
123 changed files with 1182 additions and 572 deletions
+22 -11
View File
@@ -1,31 +1,41 @@
import request from '@/utils/request'
import { AI_REQUEST_CONFIG, withAiRequestTimeout } from './aiRequest'
export type AiAnalysisType =
| 'match'
| 'match_full'
| 'article'
| 'post'
| 'lottery'
| 'lottery_module'
| 'credibility'
export function requestAiAnalysis(data: Record<string, any> & { type: AiAnalysisType }) {
return request.get(
withAiRequestTimeout({ url: '/ai/analyze', data }),
{ ...AI_REQUEST_CONFIG, isAuth: true }
)
}
/**
* @description 赛事AI预测(完整)
*/
export function getMatchPredict(data: { match_id: number }) {
return request.get(
withAiRequestTimeout({ url: '/ai/matchPredict', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'match_full', ...data })
}
/**
* @description 赛事AI预测 - 分段请求
*/
export function getMatchPredictSection(data: { match_id: number; section: string }) {
return request.get(withAiRequestTimeout({ url: '/ai/matchPredictSection', data }), AI_REQUEST_CONFIG)
return requestAiAnalysis({ type: 'match', ...data })
}
/**
* @description 资讯AI分析
*/
export function getArticleAnalysis(data: { article_id: number }) {
return request.get(
withAiRequestTimeout({ url: '/ai/articleAnalysis', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'article', ...data })
}
/**
@@ -39,12 +49,13 @@ export function checkAiUnlock(data: { match_id: number }) {
* @description 用户可信度分析
*/
export function getUserCredibility(data: { user_id: number }) {
return request.get(withAiRequestTimeout({ url: '/ai/userCredibility', data }), AI_REQUEST_CONFIG)
return requestAiAnalysis({ type: 'credibility', ...data })
}
/**
* @description 彩票概率分析
*/
export function getLotteryAnalysis(data: { type: string }) {
return request.get(withAiRequestTimeout({ url: '/ai/lotteryAnalysis', data }), AI_REQUEST_CONFIG)
const { type, ...rest } = data
return requestAiAnalysis({ type: 'lottery', code: type, ...rest })
}
+2 -1
View File
@@ -1,5 +1,6 @@
import request from '@/utils/request'
import { AI_REQUEST_CONFIG, withAiRequestTimeout } from './aiRequest'
import { requestAiAnalysis } from './ai'
// 帖子列表
export function getCommunityPosts(data?: Record<string, any>) {
@@ -68,7 +69,7 @@ export function translatePost(data: { post_id: number; confirm?: number }) {
// 帖子AI分析
export function getCommunityPostAiAnalysis(data: { post_id: number; force?: number }) {
return request.get(withAiRequestTimeout({ url: '/community/aiAnalysis', data }), AI_REQUEST_CONFIG)
return requestAiAnalysis({ type: 'post', ...data })
}
// 帖子AI分析结果轮询,只查缓存,不触发新的模型分析
+17 -20
View File
@@ -1,5 +1,13 @@
import request from '@/utils/request'
import { AI_REQUEST_CONFIG, withAiRequestTimeout } from './aiRequest'
import { requestAiAnalysis } from './ai'
const normalizeLotteryModuleResult = (res: any) => ({
...(res?.data || {}),
remain_count: res?.remain_count,
unlocked: res?.unlocked,
charged: res?.charged
})
/**
* @description 开奖列表
@@ -51,10 +59,7 @@ export function getDrawResultList(data: { code: string; page_no?: number; page_s
* @description AI预测分析
*/
export function getLotteryAiPredict(data: { category_id?: number; code?: string }) {
return request.get(
withAiRequestTimeout({ url: '/lottery/aiPredict', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'lottery', ...data })
}
/**
@@ -68,40 +73,32 @@ export function getLotteryAiHistory(data: { code: string }) {
* @description AI分析 - 热冷号
*/
export function getLotteryAiHotCold(data: { code: string }) {
return request.get(
withAiRequestTimeout({ url: '/lottery/aiHotCold', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'lottery_module', module: 'hot_cold', ...data })
.then(normalizeLotteryModuleResult)
}
/**
* @description AI分析 - 趋势+推荐组合
*/
export function getLotteryAiTrend(data: { code: string }) {
return request.get(
withAiRequestTimeout({ url: '/lottery/aiTrend', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'lottery_module', module: 'trend', ...data })
.then(normalizeLotteryModuleResult)
}
/**
* @description AI分析 - 统计数据
*/
export function getLotteryAiStats(data: { code: string }) {
return request.get(
withAiRequestTimeout({ url: '/lottery/aiStats', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'lottery_module', module: 'stats', ...data })
.then(normalizeLotteryModuleResult)
}
/**
* @description AI分析 - 波色+生肖(六合彩专属)
*/
export function getLotteryAiColorZodiac(data: { code: string }) {
return request.get(
withAiRequestTimeout({ url: '/lottery/aiColorZodiac', data }),
{ ...AI_REQUEST_CONFIG, withToken: false }
)
return requestAiAnalysis({ type: 'lottery_module', module: 'color_zodiac', ...data })
.then(normalizeLotteryModuleResult)
}
/**
+1 -1
View File
@@ -174,7 +174,7 @@
<script lang="ts" setup>
import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getLotteryDrawDetail, getLotteryAiPredict } from '@/api/lottery'
import { getLotteryDrawDetail } from '@/api/lottery'
const statusBarHeight = ref(0)
const loading = ref(true)
@@ -204,7 +204,13 @@ const vipInfo = computed(() => userStore.userInfo?.vip_info || {})
const isVipUser = computed(() => !!vipInfo.value.is_vip)
const vipLevelName = computed(() => vipInfo.value.vip_level_name || '会员')
const vipExpireDate = computed(() => vipInfo.value.vip_expire_time || '')
const freeRemain = computed(() => getAiFreeRemain(vipInfo.value))
const aiRemainOverride = ref<number | null>(null)
const freeRemain = computed(() => aiRemainOverride.value ?? getAiFreeRemain(vipInfo.value))
const syncAiRemain = (res: any) => {
if (res?.remain_count !== undefined) {
aiRemainOverride.value = Number(res.remain_count)
}
}
const showAiPopup = ref(false)
const aiLoading = ref(false)
@@ -227,6 +233,7 @@ const fetchAiPredict = async () => {
aiError.value = ''
try {
const data = await getLotteryAiPredict({ code: gameCode.value })
syncAiRemain(data)
aiData.value = data
} catch (e: any) {
aiError.value = e?.msg || 'AI分析失败,请稍后重试'
+8 -1
View File
@@ -435,7 +435,13 @@ const vipInfo = computed(() => userStore.userInfo?.vip_info || {})
const isVipUser = computed(() => !!vipInfo.value.is_vip)
const vipLevelName = computed(() => vipInfo.value.vip_level_name || '会员')
const vipExpireDate = computed(() => vipInfo.value.vip_expire_time || '')
const freeRemain = computed(() => getAiFreeRemain(vipInfo.value))
const aiRemainOverride = ref<number | null>(null)
const freeRemain = computed(() => aiRemainOverride.value ?? getAiFreeRemain(vipInfo.value))
const syncAiRemain = (res: any) => {
if (res?.remain_count !== undefined) {
aiRemainOverride.value = Number(res.remain_count)
}
}
const showAiPopup = ref(false)
const aiLoading = ref(false)
@@ -471,6 +477,7 @@ const fetchAiPredict = async () => {
if (aiGameCode.value) params.code = aiGameCode.value
if (aiCategoryId.value) params.category_id = aiCategoryId.value
const data = await getLotteryAiPredict(params)
syncAiRemain(data)
aiData.value = data
} catch (e: any) {
aiError.value = e?.msg || 'AI分析失败,请稍后重试'
+14 -2
View File
@@ -558,6 +558,11 @@ const isVipUser = computed(() => !!vipInfo.value.is_vip)
const vipLevelName = computed(() => vipInfo.value.vip_level_name || '会员')
const vipExpireDate = computed(() => vipInfo.value.vip_expire_time || '')
const freeRemain = ref(getAiFreeRemain(vipInfo.value))
const syncAiRemain = (res: any) => {
if (res?.remain_count !== undefined) {
freeRemain.value = Number(res.remain_count)
}
}
const predictionData = ref<any>(null)
const factorsData = ref<any>(null)
@@ -761,10 +766,13 @@ const waitForPostAnalysisResult = async (postId: number) => {
currentLoadingText.value = '正在重新查询分析结果...'
try {
const fallbackRes = await getCommunityPostAiAnalysis({ post_id: postId })
syncAiRemain(fallbackRes)
let packet = extractPostAnalysisPacket(fallbackRes)
if (shouldRefreshPostAnalysisCache(packet)) {
currentLoadingText.value = '正在刷新图片分析结果...'
packet = extractPostAnalysisPacket(await getCommunityPostAiAnalysis({ post_id: postId, force: 1 }))
const forceRes = await getCommunityPostAiAnalysis({ post_id: postId, force: 1 })
syncAiRemain(forceRes)
packet = extractPostAnalysisPacket(forceRes)
}
if (packet.analysis) {
analysisData.value = packet.analysis
@@ -861,6 +869,7 @@ const fetchArticleAnalysis = async (articleId: number) => {
startAnalysisTimer()
try {
const res = await getArticleAnalysis({ article_id: articleId })
syncAiRemain(res)
analysisData.value = res.analysis
} catch (e: any) {
errorMsg.value = getAnalysisErrorMessage(e)
@@ -895,10 +904,13 @@ const fetchPostAnalysis = async (postId: number) => {
startAnalysisTimer()
try {
const res = await getCommunityPostAiAnalysis({ post_id: postId })
syncAiRemain(res)
let packet = extractPostAnalysisPacket(res)
if (shouldRefreshPostAnalysisCache(packet)) {
currentLoadingText.value = '正在刷新图片分析结果...'
packet = extractPostAnalysisPacket(await getCommunityPostAiAnalysis({ post_id: postId, force: 1 }))
const forceRes = await getCommunityPostAiAnalysis({ post_id: postId, force: 1 })
syncAiRemain(forceRes)
packet = extractPostAnalysisPacket(forceRes)
}
if (!packet.analysis) {
throw { message: 'AI分析结果为空,请稍后重试', statusCode: 502 }
@@ -437,7 +437,13 @@ const vipInfo = computed(() => userStore.userInfo?.vip_info || {})
const isVipUser = computed(() => !!vipInfo.value.is_vip)
const vipLevelName = computed(() => vipInfo.value.vip_level_name || '会员')
const vipExpireDate = computed(() => vipInfo.value.vip_expire_time || '')
const freeRemain = computed(() => getAiFreeRemain(vipInfo.value))
const aiRemainOverride = ref<number | null>(null)
const freeRemain = computed(() => aiRemainOverride.value ?? getAiFreeRemain(vipInfo.value))
const syncAiRemain = (res: any) => {
if (res?.remain_count !== undefined) {
aiRemainOverride.value = Number(res.remain_count)
}
}
const showAiPopup = ref(false)
const aiLoading = ref(false)
@@ -473,6 +479,7 @@ const fetchAiPredict = async () => {
if (aiGameCode.value) params.code = aiGameCode.value
if (aiCategoryId.value) params.category_id = aiCategoryId.value
const data = await getLotteryAiPredict(params)
syncAiRemain(data)
aiData.value = data
} catch (e: any) {
aiError.value = e?.msg || 'AI分析失败,请稍后重试'
@@ -1000,6 +1000,9 @@ const loadInlineAi = async (matchId: number) => {
try {
const res = await getMatchPredictSection({ match_id: matchId, section: s })
aiInline.value[s] = res.data || {}
if (res.remain_count !== undefined) {
freeRemain.value = Number(res.remain_count)
}
} catch (e) {
// section
}