提交添加战术计算、添加头部设置
This commit is contained in:
@ -217,7 +217,7 @@ import { ipcRenderer, remote } from "electron";
|
||||
import { isvalidUsername } from "@/utils/validate";
|
||||
import { getIP, setIP, setLocal, getLocal } from "../../utils";
|
||||
import { validateURL } from "../../utils/validate";
|
||||
import { checkAuth, service_progress } from "@/api/gisAPI";
|
||||
import { checkAuth, service_progress, getHeaderList, selectHeader } from "@/api/gisAPI";
|
||||
import { login } from "@/api/air.js";
|
||||
import { getGpsList, updateGps } from "../../api/gisAPI";
|
||||
import websocket from "../../utils/websocket";
|
||||
@ -573,6 +573,7 @@ export default {
|
||||
.then(() => {
|
||||
this.$message.success("登录成功");
|
||||
setLocal("username", JSON.stringify(this.loginForm.username));
|
||||
this.getHeader()
|
||||
this.rememberPassword();
|
||||
// 无人机
|
||||
setTimeout(() => {
|
||||
@ -689,6 +690,46 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 获取Header图片
|
||||
getHeader() {
|
||||
try {
|
||||
getHeaderList({
|
||||
page: 1,
|
||||
pageSize: 99999,
|
||||
}).then(res => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
let headerList = res.data.list
|
||||
let flag = false
|
||||
for (let i = 0; i < headerList.length; i++) {
|
||||
if (headerList[i].selected) {
|
||||
flag = true
|
||||
localStorage.setItem("header", JSON.stringify(headerList[i]))
|
||||
this.$sendChanel("header", headerList[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
if(!flag && headerList && headerList.length>0) {
|
||||
localStorage.setItem("header", JSON.stringify(headerList[0]))
|
||||
this.$sendChanel("header")
|
||||
selectHeader({
|
||||
id: headerList[0].id
|
||||
}).then(res => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
else {
|
||||
localStorage.setItem("header", JSON.stringify({}))
|
||||
this.$sendChanel("header")
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
localStorage.setItem("header", JSON.stringify({}))
|
||||
this.$sendChanel("header")
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user