mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
chore: set app list page as the index page
This commit is contained in:
parent
61488e840d
commit
99ede83bdc
@ -4,7 +4,7 @@ const routes = [
|
||||
{
|
||||
name: 'home',
|
||||
path: '/',
|
||||
redirect: '/chat',
|
||||
redirect: '/apps',
|
||||
meta: {title: '首页'},
|
||||
component: () => import('@/views/Home.vue'),
|
||||
children: [
|
||||
|
@ -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)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user