|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="home">
|
|
|
|
|
|
+ <div class="home" v-if="showLogin">
|
|
<div class="home-btn" @click="checkLoginType">
|
|
<div class="home-btn" @click="checkLoginType">
|
|
<span v-if="type === 2">二维码登录</span>
|
|
<span v-if="type === 2">二维码登录</span>
|
|
<span v-else>账号登录</span>
|
|
<span v-else>账号登录</span>
|
|
@@ -114,7 +114,11 @@ export default defineComponent({
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
next((e: any) => {
|
|
next((e: any) => {
|
|
- router.push({ name: "home", query: { mac: e.userInfo.mac } });
|
|
|
|
|
|
+ e.showLogin = true;
|
|
|
|
+ // to.query = { mac: e.userInfo.mac };
|
|
|
|
+ console.log(to);
|
|
|
|
+ // console.log( e.showLogin )
|
|
|
|
+ // router.push({ name: "home", query: { mac: e.userInfo.mac } });
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -128,6 +132,7 @@ export default defineComponent({
|
|
const proxyData = reactive({
|
|
const proxyData = reactive({
|
|
parseImgUrl: parseImgUrl,
|
|
parseImgUrl: parseImgUrl,
|
|
codeValue: `${orgin}/sgipad/home`,
|
|
codeValue: `${orgin}/sgipad/home`,
|
|
|
|
+ showLogin: false,
|
|
size: 134,
|
|
size: 134,
|
|
type: 1, // 1:二维码登录 2:用户密码登录
|
|
type: 1, // 1:二维码登录 2:用户密码登录
|
|
userInfo: userInfo,
|
|
userInfo: userInfo,
|
|
@@ -166,30 +171,41 @@ export default defineComponent({
|
|
let params: any = {
|
|
let params: any = {
|
|
criteria: {
|
|
criteria: {
|
|
macAddress: proxyData.userInfo.mac,
|
|
macAddress: proxyData.userInfo.mac,
|
|
|
|
+ isMajorSpace:1
|
|
},
|
|
},
|
|
orders: [
|
|
orders: [
|
|
{
|
|
{
|
|
column: "createTime",
|
|
column: "createTime",
|
|
|
|
+
|
|
asc: false,
|
|
asc: false,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
page: 1,
|
|
page: 1,
|
|
size: 1,
|
|
size: 1,
|
|
};
|
|
};
|
|
- queryWorkSpace(params).then((res: any) => {
|
|
|
|
- let resData: any = res;
|
|
|
|
- if (resData.result === "success") {
|
|
|
|
- let content: any = resData?.content ?? [];
|
|
|
|
- if (content && content.length) {
|
|
|
|
- let projectId: any = content[0].projectId;
|
|
|
|
- store.commit(UserMutationTypes.SET_PROJECT_ID, projectId);
|
|
|
|
- router.push({
|
|
|
|
- name: "envmonitor",
|
|
|
|
- query: { spaceId: content[0].spaceId },
|
|
|
|
- });
|
|
|
|
|
|
+ queryWorkSpace(params)
|
|
|
|
+ .then((res: any) => {
|
|
|
|
+ let resData: any = res;
|
|
|
|
+ if (resData.result === "success") {
|
|
|
|
+ let content: any = resData?.content ?? [];
|
|
|
|
+ if (content && content.length) {
|
|
|
|
+ proxyData.showLogin = false;
|
|
|
|
+ let projectId: any = content[0].projectId;
|
|
|
|
+ store.commit(UserMutationTypes.SET_PROJECT_ID, projectId);
|
|
|
|
+ router.push({
|
|
|
|
+ name: "envmonitor",
|
|
|
|
+ query: { spaceId: content[0].spaceId },
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ proxyData.showLogin = true;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ proxyData.showLogin = true;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ proxyData.showLogin = true;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 获取mac地址
|
|
* 获取mac地址
|