chore: set app list page as the index page

This commit is contained in:
RockYang 2023-10-16 14:20:44 +08:00
parent 61488e840d
commit 99ede83bdc
2 changed files with 10 additions and 5 deletions

View File

@ -4,7 +4,7 @@ const routes = [
{
name: 'home',
path: '/',
redirect: '/chat',
redirect: '/apps',
meta: {title: '首页'},
component: () => import('@/views/Home.vue'),
children: [

View File

@ -35,7 +35,7 @@
</ItemList>
</div>
<login-dialog :show="showLoginDialog" @hide="showLoginDialog = false"/>
<login-dialog :show="showLoginDialog" @hide="getRoles"/>
</div>
</template>
@ -48,6 +48,7 @@ import {Delete, Plus} from "@element-plus/icons-vue";
import LoginDialog from "@/components/LoginDialog.vue";
import {checkSession} from "@/action/session";
import {arrayContains, removeArrayItem, substr} from "@/utils/libs";
import router from "@/router";
const listBoxHeight = window.innerHeight - 97
const list = ref([])
@ -66,12 +67,16 @@ onMounted(() => {
ElMessage.error("获取应用失败:" + e.message)
})
getRoles()
})
const getRoles = () => {
checkSession().then(user => {
showLoginDialog.value = false
roles.value = user.chat_roles
}).catch(() => {
})
})
}
const updateRole = (row, opt) => {
checkSession().then(() => {
@ -92,7 +97,7 @@ const updateRole = (row, opt) => {
roles.value = removeArrayItem(roles.value, row.key)
}
httpPost("/api/role/update", {keys: roles.value}).then(() => {
ElMessage.success(title.value + "成功!")
ElMessage.success({message: title.value + "成功!", duration: 1000})
}).catch(e => {
ElMessage.error(title.value + "失败:" + e.message)
})