| | |
| | | import * as AppApi from '@/api/system/app' |
| | | import {Apps} from "@/views/Home/types"; |
| | | import {CACHE_KEY, useCache} from "@/hooks/web/useCache"; |
| | | import * as authUtil from "@/utils/auth"; |
| | | |
| | | |
| | | defineOptions({ name: 'Home' }) |
| | |
| | | appList = Object.assign(appList, data) |
| | | } |
| | | |
| | | const getAppMenuList = async (id) => { |
| | | const getAppMenuList = async (id, appCode) => { |
| | | const data = await AppApi.getAppMenuList(id) |
| | | let userInfo = wsCache.get(CACHE_KEY.USER) |
| | | userInfo.menus = data |
| | |
| | | |
| | | // 进入应用 |
| | | const gotoApp = async (item) => { |
| | | let path = window.location.pathname |
| | | let appName = path.split("/")[0] |
| | | console.log(appName) |
| | | let id = item.id |
| | | let type = item.type |
| | | let appCode = item.appCode |
| | | if(type === 0) { |
| | | getAppMenuList(id) |
| | | await getAppMenuList(id, appCode) |
| | | } else { |
| | | const data = await AppApi.getAppMenuList(id) |
| | | let userInfo = wsCache.get(CACHE_KEY.USER) |
| | | userInfo.menus = data |
| | | wsCache.set(CACHE_KEY.USER, userInfo) |
| | | wsCache.set(CACHE_KEY.ROLE_ROUTERS, data) |
| | | // await OAuth2Login(formData.value) |
| | | // window.open(item.appDomain + '/login?appid=' + item.id + "&username=" + authUtil.getLoginForm().username, '_blank') |
| | | window.open(item.appDomain + '/index', '_blank') |
| | | // window.open('/plat/shasteel', '_blank') |
| | | // window.location.href = '/plat/shasteel' |
| | | // window.location.href = `/plat/shasteel?key=energy&url=http://localhost:9000&energy=/energy/demo` |
| | | } |
| | | } |
| | | |
| | |
| | | display: inline-block; |
| | | background: transparent; |
| | | } |
| | | |
| | | .card{ |
| | | border: thin dashed gainsboro; |
| | | width: 150px; |