Browse Source

调整 background 路由

reghao 3 tháng trước cách đây
mục cha
commit
6b0d03978f

+ 1 - 1
src/router/background_account.js

@@ -10,7 +10,7 @@ const MyOAuth = () => import('views/my/MyOAuth')
 
 
 export default {
 export default {
   path: '/bg/account',
   path: '/bg/account',
-  redirect: '/bg/account/profile',
+  redirect: '/bg',
   name: 'Account',
   name: 'Account',
   title: '我的帐号',
   title: '我的帐号',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_admin.js

@@ -10,7 +10,7 @@ const AdminAvatarList = () => import('views/admin/AdminAvatarList')
 
 
 export default {
 export default {
   path: '/bg/admin',
   path: '/bg/admin',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'Admin',
   name: 'Admin',
   title: '后台管理',
   title: '后台管理',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_backend.js

@@ -12,7 +12,7 @@ const AdminRuntimeLog = () => import('views/admin/backend/AdminRuntimeLog')
 
 
 export default {
 export default {
   path: '/bg/backend',
   path: '/bg/backend',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'Backend',
   name: 'Backend',
   title: '后端系统',
   title: '后端系统',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_blog.js

@@ -5,7 +5,7 @@ const BlogQuestion = () => import('views/blog/BlogQuestion')
 
 
 export default {
 export default {
   path: '/bg/blog',
   path: '/bg/blog',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'Blog',
   name: 'Blog',
   title: '我的博客',
   title: '我的博客',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_file.js

@@ -4,7 +4,7 @@ const AdminUserNode = () => import('views/admin/oss/AdminUserNode')
 
 
 export default {
 export default {
   path: '/bg/file',
   path: '/bg/file',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'File',
   name: 'File',
   title: '我的文件',
   title: '我的文件',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_my.js

@@ -18,7 +18,7 @@ const AlbumPost = () => import('views/post/AlbumPost')
 
 
 export default {
 export default {
   path: '/bg/my',
   path: '/bg/my',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'My',
   name: 'My',
   title: '我的数据',
   title: '我的数据',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_oss.js

@@ -6,7 +6,7 @@ const AdminStoreObject = () => import('views/admin/oss/AdminStoreObject')
 
 
 export default {
 export default {
   path: '/bg/oss',
   path: '/bg/oss',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'OSS',
   name: 'OSS',
   title: '存储系统',
   title: '存储系统',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_post.js

@@ -10,7 +10,7 @@ const ArticlePostEdit = () => import('views/post/ArticlePostEdit')
 
 
 export default {
 export default {
   path: '/bg/post',
   path: '/bg/post',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'Post',
   name: 'Post',
   title: '我的稿件',
   title: '我的稿件',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 1 - 1
src/router/background_site.js

@@ -7,7 +7,7 @@ const AdminRegistry = () => import('views/admin/site/AdminRegistry')
 
 
 export default {
 export default {
   path: '/bg/site',
   path: '/bg/site',
-  redirect: '/bg/account',
+  redirect: '/bg',
   name: 'Site',
   name: 'Site',
   title: '站点配置',
   title: '站点配置',
   icon: 'el-icon-user',
   icon: 'el-icon-user',

+ 2 - 2
src/router/index.js

@@ -19,12 +19,12 @@ import BackgroundFileRouter from './background_file'
 
 
 // 懒加载引入页面组件,es6语法
 // 懒加载引入页面组件,es6语法
 // ********************************************************************************************************************
 // ********************************************************************************************************************
-const Login = () => import('views/Login1')
+const Login = () => import('views/Login')
 const Register = () => import('views/Register')
 const Register = () => import('views/Register')
 const Forgot = () => import('views/Forgot')
 const Forgot = () => import('views/Forgot')
 const Index = () => import('views/Index')
 const Index = () => import('views/Index')
 const Background = () => import('views/admin/Background')
 const Background = () => import('views/admin/Background')
-const Dashboard = () => import('views/devops/Dashboard')
+const Dashboard = () => import('views/admin/Dashboard')
 
 
 // ********************************************************************************************************************
 // ********************************************************************************************************************
 // 使用安装路由插件
 // 使用安装路由插件

+ 7 - 2
src/views/devops/Dashboard.vue → src/views/admin/Dashboard.vue

@@ -104,13 +104,15 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import store from '@/store'
 import { getDashboard } from '@/api/devops'
 import { getDashboard } from '@/api/devops'
 
 
 export default {
 export default {
   name: 'Dashboard',
   name: 'Dashboard',
   data() {
   data() {
     return {
     return {
-      devops: true,
+      devops: false,
+      rolePrefix: 'devops_',
       machineStatList: [],
       machineStatList: [],
       sysInfo: null
       sysInfo: null
     }
     }
@@ -121,7 +123,10 @@ export default {
   },
   },
   methods: {
   methods: {
     getData() {
     getData() {
-      if (this.devops) {
+      const role = store.getters.roles[0]
+      console.log(role)
+      if (role.startsWith(this.rolePrefix)) {
+        this.this.devops = true
         this.getDevopsDashboard()
         this.getDevopsDashboard()
       }
       }
     },
     },