Browse Source

移除无用的console

chengyang
luyan 6 months ago
parent
commit
1839031fd3
  1. 34
      src/router/index.js
  2. 1
      src/views/modules/home/index.vue
  3. 14904
      yarn-error.log
  4. 14744
      yarn.lock

34
src/router/index.js

@ -206,28 +206,21 @@ function cookApiDataItem(item) {
function n2one(v) { function n2one(v) {
let ret = []; let ret = [];
for (let i = 0; i < v.length; i++) { for (let i = 0; i < v.length; i++) {
// console.log("xxxxx", v[i]);
ret.push(v[i]); ret.push(v[i]);
if (Array.isArray(v[i].children) && v[i].children.length > 0) { if (Array.isArray(v[i].children) && v[i].children.length > 0) {
ret.push(...n2one(v[i].children)); ret.push(...n2one(v[i].children));
} }
} }
// console.log("aaaa", ret);
return ret; return ret;
} }
let allChildrenUrl = n2one(item.children) let allChildrenUrl = n2one(item.children)
.filter((i) => i.url != "" && i.showFlag == 1) .filter((i) => i.url != "" && i.showFlag == 1)
.map((i) => i.url); .map((i) => i.url);
// console.log("))))))))))))", allChildrenUrl);
if (item.children.length > 0) { if (item.children.length > 0) {
if (item.url == "" || !allChildrenUrl.find((i) => i.url == item.url)) { if (item.url == "" || !allChildrenUrl.find((i) => i.url == item.url)) {
item.url = allChildrenUrl[0]; item.url = allChildrenUrl[0];
} }
} }
// item.children.forEach((item) => {
// item.color = "#f00";
// return item;
// });
return item; return item;
} }
// 把按钮都化为页面内部的权限 // 把按钮都化为页面内部的权限
@ -991,25 +984,21 @@ router.beforeEach((to, from, next) => {
if (toUrl && toUrl.indexOf("ticket=") != -1) { if (toUrl && toUrl.indexOf("ticket=") != -1) {
// 此处请求后端,获取一个ticket票据 // 此处请求后端,获取一个ticket票据
http.get("/auth/sso/getTicket") http.get("/auth/sso/getTicket")
.then(({data: res}) => { .then(({ data: res }) => {
let ticket = res.data let ticket = res.data
window.open(toUrl + ticket) window.open(toUrl + ticket)
}) })
return null; return null;
} }
const match = location.href.match(/[?&]ticket=([^&#]+)/); const match = location.href.match(/[?&]ticket=([^&#]+)/);
localStorage.setItem('ticket',match[1]) if (match && to.name == 'login') {
if (match && to.name =='login') {
http.get(`/auth/xiaZhuangLogin/dealUserInfo?ticket=${match[1]}`) http.get(`/auth/xiaZhuangLogin/dealUserInfo?ticket=${match[1]}`)
.then(({data: res}) => { .then(({ data: res }) => {
localStorage.setItem('token',res.data.token) localStorage.setItem('token', res.data.token)
next({ next({
name:'home' name: 'home'
}) })
}) })
} else {
console.log("未找到 ticket 参数");
} }
if (to.name === "caiji") { if (to.name === "caiji") {
@ -1035,13 +1024,10 @@ router.beforeEach((to, from, next) => {
return next(); return next();
} }
const customerId = localStorage.getItem("customerId"); const customerId = localStorage.getItem("customerId");
console.log("customerId:", customerId);
http http
.get("gov/access/menu/navDigitalCommunityNew?tableName=data_menu") .get("gov/access/menu/navDigitalCommunityNew?tableName=data_menu")
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code == 10005 || res.code == 10006 || res.code == 10007) { if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录
console.log("登录失效");
message({ message({
message: res.msg || "未知错误", message: res.msg || "未知错误",
type: "error", type: "error",
@ -1060,7 +1046,6 @@ router.beforeEach((to, from, next) => {
}); });
}) })
.catch((err) => { .catch((err) => {
console.log(err);
next({ next({
name: "login", name: "login",
query: { redirect: to.fullPath } query: { redirect: to.fullPath }
@ -1069,19 +1054,13 @@ router.beforeEach((to, from, next) => {
http http
.get("gov/access/menu/navDigitalCommunityNew") .get("gov/access/menu/navDigitalCommunityNew")
.then(({ data: res }) => { .then(({ data: res }) => {
console.log(res);
if (res.code == 10005 || res.code == 10006 || res.code == 10007) { if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录
console.log("登录失效");
message({ message({
message: res.msg || "未知错误", message: res.msg || "未知错误",
type: "error", type: "error",
duration: 2 * 1000, duration: 2 * 1000,
}); });
return next({ name: "login" });
console.log(to,from,'=============sss');
return next({name: "login"});
} }
window.SITE_CONFIG["menuList"] = res.data window.SITE_CONFIG["menuList"] = res.data
.map((item) => cookApiDataItem3(item)) .map((item) => cookApiDataItem3(item))
@ -1095,7 +1074,6 @@ router.beforeEach((to, from, next) => {
}); });
}) })
.catch((err) => { .catch((err) => {
console.log(err);
next({ next({
name: "login", name: "login",
query: { redirect: to.fullPath } query: { redirect: to.fullPath }

1
src/views/modules/home/index.vue

@ -1113,7 +1113,6 @@ this.getStatistics()
} }
}); });
console.log("请求成功:", data);
}); });
}, },
async getResidentClassWarnAnalyzed() { async getResidentClassWarnAnalyzed() {

14904
yarn-error.log

File diff suppressed because it is too large

14744
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save