|
|
|
@ -7,6 +7,7 @@ import {
|
|
|
|
fetchModelList,
|
|
|
|
fetchModelList,
|
|
|
|
fetchModelProviders,
|
|
|
|
fetchModelProviders,
|
|
|
|
fetchSupportRetrievalMethods,
|
|
|
|
fetchSupportRetrievalMethods,
|
|
|
|
|
|
|
|
operationUtm,
|
|
|
|
} from '@/service/common'
|
|
|
|
} from '@/service/common'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
ModelFeatureEnum,
|
|
|
|
ModelFeatureEnum,
|
|
|
|
@ -97,6 +98,23 @@ export const ProviderContextProvider = ({
|
|
|
|
const [isFetchedPlan, setIsFetchedPlan] = useState(false)
|
|
|
|
const [isFetchedPlan, setIsFetchedPlan] = useState(false)
|
|
|
|
const [enableBilling, setEnableBilling] = useState(true)
|
|
|
|
const [enableBilling, setEnableBilling] = useState(true)
|
|
|
|
const [enableReplaceWebAppLogo, setEnableReplaceWebAppLogo] = useState(false)
|
|
|
|
const [enableReplaceWebAppLogo, setEnableReplaceWebAppLogo] = useState(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOperateUtm = () => {
|
|
|
|
|
|
|
|
let utm
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
utm = JSON.parse(localStorage?.getItem('utm') || '{}')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (e) {
|
|
|
|
|
|
|
|
utm = {
|
|
|
|
|
|
|
|
utm_source: '',
|
|
|
|
|
|
|
|
utm_medium: '',
|
|
|
|
|
|
|
|
utm_campaign: '',
|
|
|
|
|
|
|
|
utm_content: '',
|
|
|
|
|
|
|
|
utm_term: '',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
operationUtm({ url: '/operation/utm', body: utm })
|
|
|
|
|
|
|
|
}
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
(async () => {
|
|
|
|
(async () => {
|
|
|
|
const data = await fetchCurrentPlanInfo()
|
|
|
|
const data = await fetchCurrentPlanInfo()
|
|
|
|
@ -105,13 +123,7 @@ export const ProviderContextProvider = ({
|
|
|
|
setEnableReplaceWebAppLogo(data.can_replace_logo)
|
|
|
|
setEnableReplaceWebAppLogo(data.can_replace_logo)
|
|
|
|
if (enabled) {
|
|
|
|
if (enabled) {
|
|
|
|
setPlan(parseCurrentPlan(data))
|
|
|
|
setPlan(parseCurrentPlan(data))
|
|
|
|
// setPlan(parseCurrentPlan({
|
|
|
|
handleOperateUtm()
|
|
|
|
// ...data,
|
|
|
|
|
|
|
|
// annotation_quota_limit: {
|
|
|
|
|
|
|
|
// ...data.annotation_quota_limit,
|
|
|
|
|
|
|
|
// limit: 10,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// }))
|
|
|
|
|
|
|
|
setIsFetchedPlan(true)
|
|
|
|
setIsFetchedPlan(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})()
|
|
|
|
})()
|
|
|
|
|