Commit 68478fe2 authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

fix: 创建应用达到上限时进入页面直接提示用户

See merge request !117
parents 3ea0123f 94ed1b55
...@@ -95,6 +95,8 @@ watch( ...@@ -95,6 +95,8 @@ watch(
) )
onMounted(async () => { onMounted(async () => {
await handleEquityInfoValidate()
emitter?.on('isGetAgentDetail', () => { emitter?.on('isGetAgentDetail', () => {
;['preamble', 'featuredQuestions'] ;['preamble', 'featuredQuestions']
.filter((property) => { .filter((property) => {
...@@ -135,21 +137,6 @@ async function handleCreatePersonalAgent() { ...@@ -135,21 +137,6 @@ async function handleCreatePersonalAgent() {
return return
} }
await handleGetEquityInfo()
if (userStore.equityInfo.usedAgentCount >= userStore.equityInfo.maxAgentCount) {
window.$message
.ctWarning(t('equity_module.agents_created_exceeds_tip'), '', t('common_module.back'))
.then(() => {
router.replace({ name: 'Equity' })
})
.catch(() => {
router.back()
})
handleStopGenerate()
return
}
const res = await fetchSaveAgentApplication<PersonalAppConfigState>(personalAppConfigStore.$state) const res = await fetchSaveAgentApplication<PersonalAppConfigState>(personalAppConfigStore.$state)
if (res.code === 0) { if (res.code === 0) {
...@@ -363,7 +350,7 @@ function handleStopGenerate() { ...@@ -363,7 +350,7 @@ function handleStopGenerate() {
isFullScreenLoading.value = false isFullScreenLoading.value = false
} }
async function handleGetEquityInfo() { async function handleEquityInfoValidate() {
if (!userStore.isLogin) { if (!userStore.isLogin) {
router.push({ router.push({
name: 'Login', name: 'Login',
...@@ -372,6 +359,17 @@ async function handleGetEquityInfo() { ...@@ -372,6 +359,17 @@ async function handleGetEquityInfo() {
} }
await userStore.fetchUpdateEquityInfo() await userStore.fetchUpdateEquityInfo()
if (userStore.equityInfo.usedAgentCount >= userStore.equityInfo.maxAgentCount) {
window.$message
.ctWarning(t('equity_module.agents_created_exceeds_tip'), '', t('common_module.back'))
.then(() => {
router.replace({ name: 'Equity' })
})
.catch(() => {
router.back()
})
}
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment