From 572788c12ceaea944083cf65c591e43affe79dbf Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Thu, 2 Sep 2021 18:43:32 +0800 Subject: [PATCH] init --- public/index.html | 31 ++--- src/api/admin/menu.js | 20 +--- src/page/check/chose.vue | 54 ++++----- src/page/check/index.vue | 43 ++++--- src/page/index/top/index.vue | 209 ++++++++++++++++++--------------- src/router/axios.js | 14 ++- src/store/modules/user.js | 2 +- src/views/Statistics/index.vue | 16 +++ 8 files changed, 211 insertions(+), 178 deletions(-) create mode 100644 src/views/Statistics/index.vue diff --git a/public/index.html b/public/index.html index e46981d..69d3db3 100644 --- a/public/index.html +++ b/public/index.html @@ -29,6 +29,9 @@ .el-message .el-icon-info { font-size: 18px; } + .el-tabs__nav { + font-size: 14px !important; + } @@ -64,20 +67,20 @@ var s = document.getElementsByTagName('script')[0] s.parentNode.insertBefore(hm, s) })() - fnResize(); - window.onresize = function () { - fnResize(); - } - function fnResize() { - var deviceWidth = document.documentElement.clientWidth || window.innerWidth; - if (deviceWidth >= 1920) { - deviceWidth = 1920; - } - if (deviceWidth <= 1200) { - deviceWidth = 1200; - } - document.documentElement.style.fontSize = (deviceWidth / 19.2) + 'px'; - } + // fnResize(); + // window.onresize = function () { + // fnResize(); + // } + // function fnResize() { + // var deviceWidth = document.documentElement.clientWidth || window.innerWidth; + // if (deviceWidth >= 1920) { + // deviceWidth = 1920; + // } + // if (deviceWidth <= 1200) { + // deviceWidth = 1200; + // } + // document.documentElement.style.fontSize = (deviceWidth / 19.2) + 'px'; + // } diff --git a/src/api/admin/menu.js b/src/api/admin/menu.js index 9e18fa7..5ab5193 100644 --- a/src/api/admin/menu.js +++ b/src/api/admin/menu.js @@ -1,26 +1,10 @@ -/* - * Copyright (c) 2018-2025, lengleng All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the pig4cloud.com developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: lengleng (wangiegie@gmail.com) - */ import request from '@/router/axios' export function getMenu(id) { return request({ url: '/admin/menu', - params: {parentId: id}, + params: {parentId: id,orgType:localStorage.getItem('orgType')}, method: 'get' }) } @@ -28,7 +12,7 @@ export function getMenu(id) { export function getTopMenu() { return request({ url: '/admin/menu', - params: {type: 'top'}, + params: {type: 'top',orgType:localStorage.getItem('orgType')}, method: 'get' }) } diff --git a/src/page/check/chose.vue b/src/page/check/chose.vue index b7a5e2a..54dd7e8 100644 --- a/src/page/check/chose.vue +++ b/src/page/check/chose.vue @@ -153,34 +153,34 @@ export default { diff --git a/src/router/axios.js b/src/router/axios.js index 9880524..a5beb98 100644 --- a/src/router/axios.js +++ b/src/router/axios.js @@ -32,19 +32,27 @@ axios.interceptors.request.use(config => { if (TENANT_ID) { config.headers['TENANT-ID'] = TENANT_ID // 租户ID } - + // 白单验证 + // let arr=['/auth/oauth/token','/auth/token/logout','/code/check','/admin/tenant/list','/code','/admin/menu'] + // if(arr.indexOf(config.url)==-1){ + // Object.assign(config.params,{orgType:localStorage.getItem('orgType')||''}) + // } + // console.log(config.params,'data') // headers中配置serialize为true开启序列化 if (config.method === 'post' && config.headers.serialize) { + // console.log(config.data,'data') config.data = serialize(config.data) delete config.data.serialize } if (config.method === 'get') { config.paramsSerializer = function (params) { + // console.log(params,'get') + // console.log(Object.assign(params,{orgType:localStorage.getItem('orgType')})) return qs.stringify(params, { arrayFormat: 'repeat' }) } } - + // console.log(config,'config') return config }, error => { return Promise.reject(error) @@ -73,7 +81,7 @@ axios.interceptors.response.use(res => { }) return Promise.reject(new Error(message)) } - + return res.data }, error => { NProgress.done() diff --git a/src/store/modules/user.js b/src/store/modules/user.js index ee21c05..a7815d6 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -128,7 +128,7 @@ const user = { // 查询用户信息 GetUserInfo({commit}) { return new Promise((resolve, reject) => { - getUserInfo({orgType:0}).then((res) => { + getUserInfo({orgType:localStorage.getItem('orgType')}).then((res) => { const data = res.data || {} commit('SET_USER_INFO', data.sysUser) commit('SET_ROLES', data.roles || []) diff --git a/src/views/Statistics/index.vue b/src/views/Statistics/index.vue new file mode 100644 index 0000000..2e5ecf8 --- /dev/null +++ b/src/views/Statistics/index.vue @@ -0,0 +1,16 @@ + + + + +