添加通过参数自动登录和隐藏设备列表接口

This commit is contained in:
fangxiang 2022-09-08 15:59:35 +08:00
parent 83c60a2c61
commit 16ba73cd49
2 changed files with 20 additions and 2 deletions

View File

@ -271,9 +271,19 @@ export default defineComponent({
});
onMounted(() => {
console.log((<any>window).user_search);
if ((<any>window).user_search?.user && (<any>window).user_search?.pwd) {
if ((<any>window).user_search?.host) {
data.ip_address = (<any>window).user_search?.host;
}
data.user_name = (<any>window).user_search?.user;
data.password = (<any>window).user_search?.pwd;
login_form.value.submit();
} else {
if (auto_login.value) {
login_form.value.submit();
}
}
});
try {

View File

@ -29,6 +29,7 @@
</q-btn-dropdown>
<q-btn-dropdown
v-if="show_device_list"
stretch
no-caps
flat
@ -429,7 +430,7 @@
</style>
<script lang="ts">
import { defineComponent, ref, Ref, computed, watch } from "vue";
import { defineComponent, ref, Ref, computed, watch, onMounted } from "vue";
import { useStore } from "src/store";
import GridSettingDialog from "src/components/GridSettingDialog.vue";
@ -573,6 +574,12 @@ export default defineComponent({
}
);
const show_device_list = ref(true);
onMounted(() => {
show_device_list.value =
typeof (<any>window).user_search?.hide_device_list == "undefined";
});
return {
show_advanced_menu,
plan_running,
@ -581,6 +588,7 @@ export default defineComponent({
function_center_control,
is_custon_isv,
window_rect_edit_dialog,
show_device_list,
async backupDB() {
let client = GlobalData.getInstance().getCurrentClient();