瀏覽代碼

去掉首页role不是admin的控制

zhangwenjian 5 年之前
父節點
當前提交
67dbb4ce37
共有 5 個文件被更改,包括 16 次插入10 次删除
  1. 3 0
      package.json
  2. 1 1
      src/utils/validate.js
  3. 4 4
      src/views/dashboard/admin/components/PanelGroup.vue
  4. 3 3
      src/views/dashboard/index.vue
  5. 5 2
      vue.config.js

+ 3 - 0
package.json

@@ -57,6 +57,7 @@
     "js-cookie": "2.2.0",
     "jsonlint": "1.6.3",
     "jszip": "3.2.1",
+    "monaco-editor": "^0.20.0",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
@@ -86,6 +87,7 @@
     "babel-core": "7.0.0-bridge.0",
     "babel-eslint": "10.0.1",
     "babel-jest": "23.6.0",
+    "beautifier": "^0.1.7",
     "chalk": "2.4.2",
     "chokidar": "2.1.5",
     "connect": "3.6.6",
@@ -95,6 +97,7 @@
     "husky": "1.3.1",
     "lint-staged": "8.1.5",
     "mockjs": "1.0.1-beta3",
+    "monaco-editor-webpack-plugin": "^1.9.0",
     "node-sass": "^4.13.1",
     "plop": "2.3.0",
     "runjs": "^4.3.2",

+ 1 - 1
src/utils/validate.js

@@ -15,7 +15,7 @@ export function isExternal(path) {
  * @returns {Boolean}
  */
 export function validUsername(str) {
-  const valid_map = ['admin', 'editor', 'zuoxu']
+  const valid_map = ['admin', 'editor']
   return valid_map.indexOf(str.trim()) >= 0
 }
 

+ 4 - 4
src/views/dashboard/admin/components/PanelGroup.vue

@@ -7,7 +7,7 @@
         </div>
         <div class="card-panel-description">
           <div class="card-panel-text">
-            New Visits
+            新用户
           </div>
           <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
         </div>
@@ -20,7 +20,7 @@
         </div>
         <div class="card-panel-description">
           <div class="card-panel-text">
-            Messages
+            消息
           </div>
           <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
         </div>
@@ -33,7 +33,7 @@
         </div>
         <div class="card-panel-description">
           <div class="card-panel-text">
-            Purchases
+            金额
           </div>
           <count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
         </div>
@@ -46,7 +46,7 @@
         </div>
         <div class="card-panel-description">
           <div class="card-panel-text">
-            Shoppings
+            销量
           </div>
           <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
         </div>

+ 3 - 3
src/views/dashboard/index.vue

@@ -23,9 +23,9 @@ export default {
     ])
   },
   created() {
-    if (!this.roles.includes('admin')) {
-      this.currentRole = 'editorDashboard'
-    }
+    // if (!this.roles.includes('admin')) {
+    //   this.currentRole = 'editorDashboard'
+    // }
   }
 }
 </script>

+ 5 - 2
vue.config.js

@@ -15,6 +15,8 @@ const name = defaultSettings.title || 'vue Element Admin' // page title
 // port = 9527 npm run dev OR npm run dev --port = 9527
 const port = process.env.port || process.env.npm_config_port || 9527 // dev port
 
+const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
+
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**
@@ -50,8 +52,9 @@ module.exports = {
     after: require('./mock/mock-server.js')
   },
   configureWebpack: {
-    // provide the app's title in webpack's name field, so that
-    // it can be accessed in index.html to inject the correct title.
+    plugins: [
+      new MonacoWebpackPlugin()
+    ],
     name: name,
     resolve: {
       alias: {