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(
)
onMounted(async () => {
await handleEquityInfoValidate()
emitter?.on('isGetAgentDetail', () => {
;['preamble', 'featuredQuestions']
.filter((property) => {
......@@ -135,21 +137,6 @@ async function handleCreatePersonalAgent() {
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)
if (res.code === 0) {
......@@ -363,7 +350,7 @@ function handleStopGenerate() {
isFullScreenLoading.value = false
}
async function handleGetEquityInfo() {
async function handleEquityInfoValidate() {
if (!userStore.isLogin) {
router.push({
name: 'Login',
......@@ -372,6 +359,17 @@ async function handleGetEquityInfo() {
}
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>
......
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