|
@@ -16,6 +16,9 @@
|
|
import {ref, watch} from "vue";
|
|
import {ref, watch} from "vue";
|
|
import MenuItem from "./MenuItem.vue"
|
|
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 {getTenantDetail} from "~api/other";
|
|
|
|
+import {getObjValue} from "js-fast-way";
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
datas: {
|
|
datas: {
|
|
@@ -52,11 +55,21 @@ watch(() => [
|
|
|
|
|
|
//事件
|
|
//事件
|
|
const emit = defineEmits(['change'])
|
|
const emit = defineEmits(['change'])
|
|
-const MenuClick = (item) => {
|
|
|
|
|
|
+const MenuClick = async (item) => {
|
|
if (item?.code === 'to-archives-url') {
|
|
if (item?.code === 'to-archives-url') {
|
|
- const token = getToken()
|
|
|
|
- //refreshToken, accessToken
|
|
|
|
- window.open(item?.path + '/#/auth?token=' + token, '_blank')
|
|
|
|
|
|
+ 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
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(domain)
|
|
|
|
+ //window.open(domain + '/#/auth?token=' + token, '_blank')
|
|
} else {
|
|
} else {
|
|
curKey.value = item?.code || '';
|
|
curKey.value = item?.code || '';
|
|
emit('change', item)
|
|
emit('change', item)
|