module-menu-vue 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu-vue",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "城市大数据平台菜单--Vue版",
5
5
  "main": "/index.js",
6
6
  "scripts": {
@@ -4,7 +4,7 @@
4
4
  <div class='menuIcon' @click="showMenuList = !showMenuList">
5
5
  <img class="menuIcon_img" :src="menuIconSrc" />
6
6
  </div>
7
- <div class="menu_title_content" v-show="showCollapse">
7
+ <div class="menu_title_content" v-show="showCollapse" @click="toHref()">
8
8
  <img class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" />
9
9
  <span class="menu_title">{{getLogoAndTitle().title}}</span>
10
10
  </div>
@@ -79,6 +79,11 @@ export default {
79
79
  this.getNewMenuList();
80
80
  },
81
81
  methods: {
82
+ toHref () {
83
+ if (this.sysName === 'admin') {
84
+ this.$router.push({path: '/admin/user/index'})
85
+ }
86
+ },
82
87
  getSessionMenu () {
83
88
  const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
84
89
  if (menuObj) {
@@ -69,22 +69,24 @@ export default {
69
69
  const config = {
70
70
  headers: {}
71
71
  }
72
- const TENANT_ID = getStore({ name: "tenantId" }) || '1';
72
+ // const TENANT_ID = getStore({ name: "tenantId" }) || '1';
73
73
  const isToken = (config.headers || {}).isToken === false;
74
74
  const token = getStore({ name: 'access_token' });
75
75
  if (token && !isToken) {
76
76
  config.headers["Authorization"] = `Bearer ${token}`; // token
77
77
  }
78
- if (TENANT_ID) {
79
- config.headers["TENANT-ID"] = TENANT_ID; // 租户ID
80
- }
78
+ // if (TENANT_ID) {
79
+ // config.headers["TENANT-ID"] = TENANT_ID; // 租户ID
80
+ // }
81
+ sessionStorage.clear();
82
+ localStorage.clear();
81
83
  axios({
82
84
  method: 'delete',
83
85
  url: '/auth/token/logout',
84
86
  ...config
85
87
  }).then(res => {
86
88
  console.log('res', res)
87
- location.href = '/#/login'
89
+ this.$router.push({ path: "/login" });
88
90
  }).catch((err) => {
89
91
  console.error(err)
90
92
  })
@@ -1,23 +1,7 @@
1
1
  import request from 'axios'
2
- import { Message } from 'element-ui';
3
- const DEFAULT_LOGOUT_URL = '/#/login'
4
2
  export const logout = () => {
5
3
  return request({
6
4
  url: '/auth/token/logout',
7
5
  method: 'delete'
8
6
  })
9
- }
10
-
11
- // 校验token是否失效
12
- export const checkToken = (token) => {
13
- return request({
14
- url: `/auth/oauth/check_token?token=${token}`,
15
- method: 'get'
16
- }).then().catch(() => {
17
- Message.error({content:'用户凭证已过期,请重新登录', onClose: ()=>{
18
- localStorage.clear();
19
- sessionStorage.clear();
20
- window.location.href = DEFAULT_LOGOUT_URL;
21
- }});
22
- })
23
7
  }