fix: warn

pull/1/MERGE
xingyuv 2023-03-19 16:19:12 +08:00
parent ae3079b418
commit c9ad9cfc5b
12 changed files with 14 additions and 28 deletions

View File

@ -13,26 +13,18 @@ import { useGo } from '@/hooks/web/usePage'
import { useMenuSetting } from '@/hooks/setting/useMenuSetting'
import { useDesign } from '@/hooks/web/useDesign'
import { PageEnum } from '@/enums/pageEnum'
import { useUserStore } from '@/store/modules/user'
const props = defineProps({
/**
* The theme of the current parent component
*/
//
theme: { type: String, validator: (v: string) => ['light', 'dark'].includes(v) },
/**
* Whether to show title
*/
//
showTitle: { type: Boolean, default: true },
/**
* The title is also displayed when the menu is collapsed
*/
//
alwaysShowTitle: { type: Boolean }
})
const { prefixCls } = useDesign('app-logo')
const { getCollapsedShowTitle } = useMenuSetting()
const userStore = useUserStore()
const { title } = useGlobSetting()
const go = useGo()
@ -46,7 +38,7 @@ const getTitleClass = computed(() => [
])
function goHome() {
go(userStore.getUserInfo.homePath || PageEnum.BASE_HOME)
go(PageEnum.BASE_HOME)
}
</script>
<style lang="less" scoped>

View File

@ -54,7 +54,6 @@ const getOptions = computed((): OptionsItem[] => {
function handleClick(args) {
emitData.value = args
console.info(emitData.value)
emits('change', emitData.value)
}
</script>

View File

@ -4,11 +4,9 @@
</MenuItem>
</template>
<script lang="ts" setup name="BasicMenuItem">
import { Menu } from 'ant-design-vue'
import { MenuItem } from 'ant-design-vue'
import { itemProps } from '../props'
import MenuItemContent from './MenuItemContent.vue'
const MenuItem = Menu.Item
defineProps(itemProps)
</script>

View File

@ -12,6 +12,7 @@ import { useMenuSetting } from '@/hooks/setting/useMenuSetting'
export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' | 'default' = 'default') {
const { getDarkMode: getSysDarkMode } = useRootSetting()
const { getCollapsed } = useMenuSetting()
const getDarkMode = computed(() => {

View File

@ -21,7 +21,7 @@ export function useLockPage() {
function resetCalcLockTimeout(): void {
// not login
if (!userStore.getToken) {
if (!userStore.getAccessToken) {
clear()
return
}
@ -45,7 +45,7 @@ export function useLockPage() {
}
watchEffect((onClean) => {
if (userStore.getToken) {
if (userStore.getAccessToken) {
resetCalcLockTimeout()
} else {
clear()

View File

@ -91,7 +91,7 @@ function createSuccessModal(options: ModalOptionsPartial) {
}
function createErrorModal(options: ModalOptionsPartial) {
return Modal.error(createModalOptions(options, 'error'))
return Modal.error(createModalOptions(options, 'close'))
}
function createInfoModal(options: ModalOptionsPartial) {

View File

@ -29,8 +29,7 @@ export function usePermission() {
*/
async function togglePermissionMode() {
appStore.setProjectConfig({
permissionMode:
appStore.projectConfig?.permissionMode === PermissionModeEnum.BACK ? PermissionModeEnum.ROUTE_MAPPING : PermissionModeEnum.BACK
permissionMode: projectSetting.permissionMode === PermissionModeEnum.BACK ? PermissionModeEnum.ROUTE_MAPPING : PermissionModeEnum.BACK
})
location.reload()
}

View File

@ -24,16 +24,16 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useDesign } from '@/hooks/web/useDesign'
import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, useForm } from '@/components/Form'
import { useUserStore } from '@/store/modules/user'
import { useLockStore } from '@/store/modules/lock'
import headerImg from '@/assets/images/header.jpg'
const { t } = useI18n()
const { prefixCls } = useDesign('header-lock-modal')
const userStore = useUserStore()
const lockStore = useLockStore()
const getRealName = computed(() => userStore.getUserInfo?.realName)
const getRealName = computed(() => userStore.getUserInfo?.user.nickname)
const [register, { closeModal }] = useModalInner()
const [registerForm, { validateFields, resetFields }] = useForm({
@ -64,7 +64,7 @@ async function handleLock() {
}
const avatar = computed(() => {
const { avatar } = userStore.getUserInfo
const { avatar } = userStore.getUserInfo.user
return avatar || headerImg
})
</script>

View File

@ -130,7 +130,6 @@ export default defineComponent({
function renderMenu() {
const { menus, ...menuProps } = unref(getCommonProps)
// console.log(menus);
if (!menus || !menus.length) return null
return !props.isHorizontal ? (
<SimpleMenu {...menuProps} isSplitMenu={unref(getSplit)} items={menus} />

View File

@ -226,7 +226,6 @@ export const usePermissionStore = defineStore('app-permission', {
// Background routing to menu structure
// 后台路由到菜单结构
const backMenuList = transformRouteToMenu([dashboard, ...routeList])
console.info(backMenuList)
this.setBackMenuList(backMenuList)
// remove meta.ignoreRoute item

View File

@ -128,7 +128,6 @@ export const useUserStore = defineStore('app-user', {
router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw)
permissionStore.setDynamicAddedRoute(true)
}
console.info(router.replace(PageEnum.BASE_HOME))
goHome && (await router.replace(PageEnum.BASE_HOME))
}
return userInfo

View File

@ -70,7 +70,7 @@ const transform: AxiosTransform = {
successMsg = t('sys.api.operationSuccess')
}
if (isNull(successMsg) || isUnDef(successMsg) || isEmpty(successMsg)) {
successMsg = t(`sys.api.operationSuccess`)
successMsg = t('sys.api.operationSuccess')
}
if (options.successMessageMode === 'modal') {
createSuccessModal({ title: t('sys.api.successTip'), content: successMsg })