|
@@ -30,7 +30,7 @@ import MenuItem from './MenuItem.vue'
|
|
import { getToken } from '~src/api/util/auth'
|
|
import { getToken } from '~src/api/util/auth'
|
|
import { getStoreValue } from '~uti/storage'
|
|
import { getStoreValue } from '~uti/storage'
|
|
import { getTenantDetail } from '~api/other'
|
|
import { getTenantDetail } from '~api/other'
|
|
-import { getObjValue } from 'js-fast-way'
|
|
|
|
|
|
+import { getObjValue, isUrl } from 'js-fast-way'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
datas: {
|
|
datas: {
|
|
@@ -71,16 +71,18 @@ watch(() => [
|
|
|
|
|
|
|
|
|
|
const MenuClick = async (item) => {
|
|
const MenuClick = async (item) => {
|
|
- if (item?.code === 'to-archives-url') {
|
|
|
|
|
|
+ if (isUrl(item?.path)) {
|
|
let token = getToken(), domain = item?.path
|
|
let token = getToken(), domain = item?.path
|
|
- const tenantId = getStoreValue('tenantId')
|
|
|
|
- if (tenantId === '000000' || !tenantId) {
|
|
|
|
- domain = item?.path
|
|
|
|
- } else {
|
|
|
|
- const { error, code, data } = await getTenantDetail(tenantId)
|
|
|
|
- if (!error && code === 200) {
|
|
|
|
- const url = getObjValue(data).domainUrl
|
|
|
|
- domain = url ? url : item?.path
|
|
|
|
|
|
+ if (item?.code === 'to-archives-url') {
|
|
|
|
+ const tenantId = getStoreValue('tenantId')
|
|
|
|
+ if (tenantId === '000000' || !tenantId) {
|
|
|
|
+ domain = item?.path
|
|
|
|
+ } else {
|
|
|
|
+ const { error, code, data } = await getTenantDetail(tenantId)
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ const url = getObjValue(data).domainUrl
|
|
|
|
+ domain = url ? url : item?.path
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
window.open(domain + '/#/auth?token=' + token, '_blank')
|
|
window.open(domain + '/#/auth?token=' + token, '_blank')
|