Skip to content

Commit

Permalink
chore: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed Sep 12, 2024
1 parent 1aefe3a commit 011d8a4
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/components/common/Setting/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { UserInfo } from '@/store/modules/user/helper'
import { getCurrentDate } from '@/utils/functions'
import { useBasicLayout } from '@/hooks/useBasicLayout'
import { t } from '@/locales'
import { decode_redeemcard, fetchClearAllChat, fetchUpdateUserChatModel } from '@/api'
import { fetchClearAllChat, fetchUpdateUserChatModel } from '@/api'
const appStore = useAppStore()
const userStore = useUserStore()
Expand Down Expand Up @@ -84,27 +84,6 @@ async function updateUserInfo(options: Partial<UserInfo>) {
await userStore.updateUserInfo(true, options)
ms.success(`更新个人信息 ${t('common.success')}`)
}
// 更新并兑换,这里图页面设计方便暂时先放一起了,下方页面新增了两个输入框
async function redeemandupdateUserInfo(options: { avatar: string; name: string; description: string; useAmount: number; redeemCardNo: string }) {
const { avatar, name, description, useAmount, redeemCardNo } = options
let add_amt = 0
let message = ''
try {
const res = await decode_redeemcard(redeemCardNo)
add_amt = Number(res.data)
message = res.message ?? ''
}
catch (error: any) {
add_amt = 0
message = error.message ?? ''
}
const new_useAmount = useAmount + add_amt
const new_options = { avatar, name, description, useAmount: new_useAmount }
await updateUserInfo(new_options)
userStore.readUserAmt()
ms.success(`兑换码:${message},本次充值${add_amt.toString()}次,总计${new_useAmount.toString()}次`)
}
async function updateUserChatModel(chatModel: string) {
if (!userStore.userInfo.config)
Expand Down

0 comments on commit 011d8a4

Please sign in to comment.