module-menu-vue 0.0.1 → 0.0.2

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.
Files changed (59) hide show
  1. package/index.js +3 -2
  2. package/package.json +3 -1
  3. package/public/index.html +1 -1
  4. package/src/App.vue +11 -16
  5. package/src/assets/admin_logo.svg +48 -0
  6. package/src/assets/admin_slogo.svg +48 -0
  7. package/src/assets/alert_logo.svg +26 -0
  8. package/src/assets/alert_slogo.svg +26 -0
  9. package/src/assets/childIcon.svg +10 -0
  10. package/src/assets/dataManager_logo.svg +42 -0
  11. package/src/assets/dataanalytic_logo.svg +44 -0
  12. package/src/assets/dataanalytic_slogo.svg +47 -0
  13. package/src/assets/dataasset_logo.svg +52 -0
  14. package/src/assets/dataasset_slogo.svg +52 -0
  15. package/src/assets/datacollection_logo.svg +70 -0
  16. package/src/assets/datacollection_slogo.svg +70 -0
  17. package/src/assets/datadev_logo.svg +26 -0
  18. package/src/assets/datadev_slogo.svg +26 -0
  19. package/src/assets/datalabel_logo.svg +26 -0
  20. package/src/assets/datalabel_slogo.svg +26 -0
  21. package/src/assets/datamanager_slogo.svg +42 -0
  22. package/src/assets/dataservice_logo.svg +209 -0
  23. package/src/assets/dataservice_slogo.svg +209 -0
  24. package/src/assets/datasharing_logo.svg +28 -0
  25. package/src/assets/datasharing_slogo.svg +28 -0
  26. package/src/assets/home.svg +12 -0
  27. package/src/assets/ic_gonggongmokuai_m.svg +5 -0
  28. package/src/assets/ic_shujuhuiju_m.svg +5 -0
  29. package/src/assets/ic_shujukaifa_m.svg +15 -0
  30. package/src/assets/ic_shujukaifang_m.svg +5 -0
  31. package/src/assets/ic_shujuyingyong_m.svg +5 -0
  32. package/src/assets/ic_shujuzhili_m.svg +5 -0
  33. package/src/assets/logout.png +0 -0
  34. package/src/assets/menuIcon.svg +1 -0
  35. package/src/assets/messageCenter.svg +1 -0
  36. package/src/assets/metadata_logo.svg +25 -0
  37. package/src/assets/metadata_slogo.svg +25 -0
  38. package/src/assets/module.svg +12 -0
  39. package/src/assets/operate_logo.svg +63 -0
  40. package/src/assets/operate_slogo.svg +63 -0
  41. package/src/assets/personalCenter.svg +16 -0
  42. package/src/assets/quality_logo.svg +26 -0
  43. package/src/assets/quality_slogo.svg +26 -0
  44. package/src/assets/systemManage.svg +16 -0
  45. package/src/assets/userLogo.svg +1 -0
  46. package/src/assets/wordorder_logo.svg +57 -0
  47. package/src/assets/workorder_slogo.svg +54 -0
  48. package/src/components/Menu/ModuleMenu.vue +189 -0
  49. package/src/components/Menu/constant.js +172 -0
  50. package/src/components/Menu/menu.css +94 -0
  51. package/src/components/User/UserInfo.vue +107 -0
  52. package/src/components/User/constant.js +11 -0
  53. package/src/components/Util/axios.js +128 -0
  54. package/src/components/Util/config.js +10 -0
  55. package/src/components/Util/permessionUtils.js +27 -0
  56. package/src/components/Util/userInfo.js +50 -0
  57. package/src/main.js +3 -2
  58. package/src/components/ModuleMenu.vue +0 -13
  59. package/webpack.config.js +0 -25
@@ -0,0 +1,10 @@
1
+ const address = window.location.hostname
2
+ const port = window.location.port
3
+ const baseCof = process.env.NODE_ENV === 'production' ?{
4
+ baseSever: `https://${address}:${port}`,
5
+ basePath: `/app/cmcc/data`,
6
+ }:{
7
+ baseSever: 'http://localhost:8000',
8
+ basePath: '/cmcc/data',
9
+ };
10
+ export default baseCof;
@@ -0,0 +1,27 @@
1
+ import Axios from './axios.js';
2
+
3
+ const DEFAULT_LOGOUT_URL = '/#/login'
4
+ // 退出登录
5
+ export const logout = () => {
6
+ Axios('delete','/auth/token/logout', '', {} )
7
+ .then(() => {
8
+ localStorage.clear();
9
+ sessionStorage.clear();
10
+ window.location.href = DEFAULT_LOGOUT_URL;
11
+ })
12
+ .catch((error) => {
13
+ console.error('Error while logging out, error:', error);
14
+ this.$message.error('服务器错误,请稍后重试');
15
+ });
16
+ }
17
+ // 校验token是否失效
18
+ export const checkToken = (token) => {
19
+ Axios('get',`/auth/oauth/check_token?token=${token}`, '', {} ).then(
20
+ ).catch(() => {
21
+ this.$message.error({content:'用户凭证已过期,请重新登录', onClose: ()=>{
22
+ localStorage.clear();
23
+ sessionStorage.clear();
24
+ window.location.href = DEFAULT_LOGOUT_URL;
25
+ }});
26
+ })
27
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * 获取认证相关的localStorage/SessionStorage
3
+ */
4
+ function getStore(params) {
5
+ let { name } = params;
6
+ const { debug } = params;
7
+ const keyName = 'bigdata-';
8
+ name = keyName + name;
9
+ let obj = {};
10
+ let content;
11
+ obj = window.sessionStorage.getItem(name);
12
+ if (!obj || Object.keys(obj).length === 0) obj = window.localStorage.getItem(name);
13
+ if (!obj || Object.keys(obj).length === 0) return '';
14
+ try {
15
+ obj = JSON.parse(obj);
16
+ } catch (e) {
17
+ return '';
18
+ }
19
+ if (debug) {
20
+ return '';
21
+ }
22
+ if (obj.dataType === 'string') {
23
+ content = obj.content;
24
+ } else if (obj.dataType === 'number') {
25
+ content = Number(obj.content);
26
+ } else if (obj.dataType === 'boolean') {
27
+ // eslint-disable-next-line no-eval
28
+ content = eval(obj.content);
29
+ } else if (obj.dataType === 'object') {
30
+ content = obj.content;
31
+ }
32
+ return content;
33
+ }
34
+ export default getStore;
35
+
36
+ export const getUserName = () => {
37
+ const userInfo = getStore({ name: 'userInfo' });
38
+ if (userInfo && Object.keys(userInfo).length > 0 && userInfo.username) {
39
+ return userInfo.username;
40
+ }
41
+ return '';
42
+ };
43
+
44
+ export const getUserId = () => {
45
+ const userInfo = getStore({ name: 'userInfo' });
46
+ if (userInfo && Object.keys(userInfo).length > 0 && userInfo.id) {
47
+ return userInfo.id;
48
+ }
49
+ return '';
50
+ };
package/src/main.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import Vue from 'vue'
2
2
  import App from './App.vue'
3
-
3
+ import ElementUI from 'element-ui';
4
+ import 'element-ui/lib/theme-chalk/index.css';
4
5
  Vue.config.productionTip = false
5
-
6
+ Vue.use(ElementUI);
6
7
  new Vue({
7
8
  render: h => h(App),
8
9
  }).$mount('#app')
@@ -1,13 +0,0 @@
1
- <template>
2
- <div class="hello">dasdasd
3
- </div>
4
- </template>
5
-
6
- <script>
7
- export default {
8
- name: 'ModuleMenu',
9
- }
10
- </script>
11
- <!-- Add "scoped" attribute to limit CSS to this component only -->
12
- <style scoped>
13
- </style>
package/webpack.config.js DELETED
@@ -1,25 +0,0 @@
1
- const path = require('path');
2
- module.exports = {
3
- entry: './src/components/YourComponent.vue',
4
- output: {
5
- path: path.resolve(__dirname, 'dist'),
6
- filename: 'YourComponent.js',
7
- libraryTarget: 'umd',
8
- libraryExport: 'default',
9
- umdNamedDefine: true
10
- },
11
- module: {
12
- rules: [
13
- {
14
- test: /\.vue$/,
15
- loader: 'vue-loader'
16
- }
17
- ]
18
- },
19
- resolve: {
20
- extensions: ['.js', '.vue'],
21
- alias: {
22
- vue$: 'vue/dist/vue.esm.js'
23
- }
24
- }
25
- };