Commit 3c5613b7 authored by xinzhedeai's avatar xinzhedeai

overview

parent fea26476
......@@ -58,7 +58,7 @@ export const constantRouterMap = [
//component: Layout,
component: HomeLayout,
redirect: "noredirect",
hidden:true,
hidden:false,
children: [
{
path: "enterprise",
......@@ -71,6 +71,12 @@ export const constantRouterMap = [
component: resolve => require(["@/views/system/home/tech"], resolve),
name: "首页-科技局",
meta: { title: "首页", affix:true , icon: "index"}
},
{
path: "数据概览",
component: resolve => require(["@/views/system/home/overview"], resolve),
name: "首页-概览",
meta: { title: "概览", affix:true , icon: "index"}
}
]
},
......
......@@ -149,148 +149,28 @@ export default {
this.zfqyndsjsfbhqs();
}, 900);
// 登录权限获取
(t.getInfo = function () {
var url = t.LOCAL_API + "/auth/info";
return reqApi.common.requst
.call(that.$route, "get", url)
.then((res) => {
if (!res.error && res.user) {
// 设置全局登录用户类别标记
localStorage.setItem(
"groupIdByloginType",
res.user.jobs.length && res.user.jobs[0]["id"]
);
m.init();
} else {
m.loginView = qf.UI.popWindow({
cover: true,
coverFull: true,
className: "login-ctn",
//container:b0_e, // id || Element对象
//backgroundColor:'rgba(0,0,0,.4);backdrop-filter:blur(15px);',
closeEvent: true,
html: '<div class="liner"></div>',
onload: function (v) {
m.loginView = v;
var el = v.el;
v.setStyle(v.Wrap, {
height: "5.04rem",
width: "9.12rem",
zIndex: 10,
borderRadius: ".06rem",
overflow: "hidden",
});
el.innerHTML = `<div class="l-left"><h3>Welcome!</h3><h4>高区应急综合管理平台</h4></div><div class="pop-login" ><div class="inbox-range"><div class="ctn-fix"><form class="el-form login-form el-form--label-left"><h3 class="title">登录</h3><div class="el-form-item is-required el-form-item--small"><div class="el-form-item__content" style=""><div class="el-input el-input--small el-input--prefix"><input type="text" autocomplete="off" placeholder="账号" class="el-input__inner"><span class="el-input__prefix el-icon-s-custom"></span></div></div><div class="el-form-item__error">用户名不能为空</div></div>
<div class="el-form-item is-required el-form-item--small"><div class="el-form-item__content" style=""><div class="el-input el-input--small el-input--prefix"><input type="password" autocomplete="off" placeholder="密码" class="el-input__inner"><span class="el-input__prefix el-icon-key"></span></div></div><div class="el-form-item__error">密码不能为空</div></div>
<div class="el-form-item is-required el-form-item--small">
<div class="el-form-item__content" style="display:flex;justify-content:space-between;">
<div class="el-input el-input--small el-input--prefix" style="width:50%;">
<input type="text" autocomplete="off" placeholder="验证码" class="el-input__inner">
<span class="el-input__prefix el-icon-circle-check"></span></div>
<div class="login-code"><img src=""></div>
</div><div class="el-form-item__error">验证码不能为空</div></div>
<div class="el-form-item el-form-item--small" style="width: 100%;"><div class="el-form-item__content" style="margin-left: 0px;"><button type="button" class="el-button el-button--primary el-button--medium" style="width: 100%;">登 录</button></div></div></form></div></div></div>`;
// 校验
m.loginView.check = function (el) {
var itemContent = el.parentNode.parentNode;
if (qf.trim(el.value)) {
return (
itemContent.nextElementSibling.classList.remove("open"),
1
);
} else {
itemContent.nextElementSibling.classList.add("open");
el.focus();
}
};
m.loginView.inputs = el.querySelectorAll("input");
for (var input of m.loginView.inputs) {
input.onblur = function (e) {
var tag = e.target || e.srcElement;
m.loginView.check(tag);
};
}
// 验证码
(m.loginView.refreshCodeImg = function () {
m.getCodeImg().then((res) => {
var img = el.querySelector(".login-code>img");
img.src = res.img;
m.loginView.uuid = res.uuid;
});
})();
m.loginView.loginCheck = function () {
var inputs = m.loginView.inputs;
var username = inputs[0],
password = inputs[1],
captcha = inputs[2];
if (
m.loginView.check(username) &&
m.loginView.check(password) &&
m.loginView.check(captcha)
) {
var param = {
username: username.value,
password: encrypt(password.value),
code: captcha.value,
uuid: m.loginView.uuid,
};
var l1 = qf.UI.loading({ zIndex: 2051, timer: 10000 });
m.login(param)
.then((res) => {
l1.close();
if (res.token && res.user) {
m.init();
m.setToken(res.token);
m.loginView.remove();
} else {
new qf.UI.Notify({
zIndex: 2050,
type: "warning",
duration: 3000,
autoOpen: true,
message: res.message || res.msg || "",
});
m.loginView.refreshCodeImg();
}
})
.catch(function (e) {
console.log("catch ________________ ", e);
});
}
};
// 回车事件
m.loginView.keyup = function (e) {
if (e.keyCode === 13) {
m.loginView.loginCheck();
}
};
window.addEventListener("keyup", m.loginView.keyup);
},
click: function (tag) {
if (tag.nodeName === "BUTTON") {
m.loginView.loginCheck();
} else if (tag.nodeName === "IMG") {
m.loginView.refreshCodeImg();
}
},
close: function (e) {
window.removeEventListener("keyup", m.loginView.keyup);
delete m.loginView;
},
});
}
});
})();
this.getRoleInfo()
});
},
methods: {
getRoleInfo(){
// 数据总览
request({
url: "auth/info",
method: "get",
}).then((res) => {
if (!res.error && res.user) {
// 设置全局登录用户类别标记
localStorage.setItem(
"groupIdByloginType",
res.user.jobs.length && res.user.jobs[0]["id"]
);
}else{
location = '/login'
}
});
},
goBackendHome() {
if (localStorage.getItem("groupIdByloginType") * 1 == 1) {
// 孵化器用户
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment