mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-05-10 19:54:25 +08:00
allow user to set default index page
This commit is contained in:
@@ -89,6 +89,7 @@ type BaseConfig struct {
|
|||||||
MjMode string `json:"mj_mode"` // midjourney 默认的API模式,relax, fast, turbo
|
MjMode string `json:"mj_mode"` // midjourney 默认的API模式,relax, fast, turbo
|
||||||
|
|
||||||
IndexNavs []int `json:"index_navs"` // 首页显示的导航菜单
|
IndexNavs []int `json:"index_navs"` // 首页显示的导航菜单
|
||||||
|
IndexPage string `json:"index_page"` // 首页显示的页面
|
||||||
Copyright string `json:"copyright"` // 版权信息
|
Copyright string `json:"copyright"` // 版权信息
|
||||||
ICP string `json:"icp"` // ICP 备案号
|
ICP string `json:"icp"` // ICP 备案号
|
||||||
GaBeian string `json:"ga_beian"` // 公安备案号
|
GaBeian string `json:"ga_beian"` // 公安备案号
|
||||||
|
|||||||
@@ -123,20 +123,25 @@ const md = new MarkdownIt({
|
|||||||
typographer: true,
|
typographer: true,
|
||||||
}).use(emoji)
|
}).use(emoji)
|
||||||
|
|
||||||
onMounted(() => {
|
if (isMobile()) {
|
||||||
if (isMobile()) {
|
|
||||||
router.push('/mobile/index')
|
router.push('/mobile/index')
|
||||||
return
|
}
|
||||||
}
|
|
||||||
getSystemInfo()
|
getSystemInfo()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
title.value = res.data.title
|
const data = res.data
|
||||||
logo.value = res.data.logo
|
title.value = data.title
|
||||||
|
logo.value = data.logo
|
||||||
|
console.log(data)
|
||||||
|
if (data.index_page) {
|
||||||
|
router.push(data.index_page)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
ElMessage.error('获取系统配置失败:' + e.message)
|
ElMessage.error('获取系统配置失败:' + e.message)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
getLicenseInfo()
|
getLicenseInfo()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
license.value = res.data
|
license.value = res.data
|
||||||
|
|||||||
@@ -64,7 +64,53 @@
|
|||||||
placeholder="请选择菜单,多选"
|
placeholder="请选择菜单,多选"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-option v-for="item in menus" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option v-for="item in menus" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<i :class="'iconfont mr-2 ' + item.icon" v-if="item.icon.startsWith('icon')"></i>
|
||||||
|
<el-image
|
||||||
|
:src="item.icon"
|
||||||
|
class="rounded-lg w-10 h-10 mr-2"
|
||||||
|
alt="Geek-AI"
|
||||||
|
v-else
|
||||||
|
/>
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<template #label>
|
||||||
|
<div class="label-title">
|
||||||
|
首页默认页面
|
||||||
|
<span class="text-xs text-gray-500"
|
||||||
|
>(设置后,用户访问首页时会自动跳转到该页面)</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-select
|
||||||
|
v-model="system['index_page']"
|
||||||
|
:filterable="true"
|
||||||
|
placeholder="请选择页面"
|
||||||
|
style="width: 100%"
|
||||||
|
value-key="url"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<i class="iconfont icon-home"></i>
|
||||||
|
</template>
|
||||||
|
<el-option v-for="item in menus" :key="item.id" :label="item.name" :value="item.url">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<i :class="'iconfont mr-2 ' + item.icon" v-if="item.icon.startsWith('icon')"></i>
|
||||||
|
<el-image
|
||||||
|
:src="item.icon"
|
||||||
|
class="rounded-lg w-10 h-10 mr-2"
|
||||||
|
alt="Geek-AI"
|
||||||
|
v-else
|
||||||
|
/>
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
</div>
|
||||||
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user