Browse Source

Merge pull request #29 from musnow/master

添加 eslint 规则
Anan Yang 6 years ago
parent
commit
6e3c12a734
93 changed files with 745 additions and 715 deletions
  1. 1 1
      README.md
  2. 23 1
      package.json
  3. 1 1
      src/App.vue
  4. 1 1
      src/components/AvatarList/Item.vue
  5. 1 1
      src/components/AvatarList/List.vue
  6. 1 1
      src/components/AvatarList/index.js
  7. 1 1
      src/components/ChartCard.vue
  8. 11 11
      src/components/CountDown/CountDown.vue
  9. 2 2
      src/components/Ellipsis/Ellipsis.vue
  10. 1 1
      src/components/Trend/Trend.vue
  11. 1 1
      src/components/chart/Bar.vue
  12. 1 1
      src/components/chart/Liquid.vue
  13. 1 1
      src/components/chart/MiniArea.vue
  14. 1 1
      src/components/chart/MiniBar.vue
  15. 1 1
      src/components/chart/MiniProgress.vue
  16. 1 1
      src/components/chart/RankList.vue
  17. 1 1
      src/components/chart/TransferBar.vue
  18. 3 3
      src/components/chart/Trend.vue
  19. 1 1
      src/components/layouts/BasicLayout.vue
  20. 1 1
      src/components/layouts/BlankLayout.vue
  21. 1 1
      src/components/layouts/PageView.vue
  22. 1 1
      src/components/layouts/RouteView.vue
  23. 2 2
      src/components/layouts/UserLayout.vue
  24. 2 2
      src/components/menu/SideMenu.vue
  25. 45 59
      src/components/menu/index.js
  26. 1 1
      src/components/page/GlobalFooter.vue
  27. 2 2
      src/components/page/GlobalHeader.vue
  28. 1 1
      src/components/page/GlobalLayout.vue
  29. 2 2
      src/components/page/PageHeader.vue
  30. 1 1
      src/components/page/PageLayout.vue
  31. 1 1
      src/components/page/SHeaderNotice.vue
  32. 2 2
      src/components/setting/SettingDrawer.vue
  33. 1 1
      src/components/setting/SettingItem.vue
  34. 12 12
      src/components/table/StandardTable.vue
  35. 33 33
      src/components/table/index.js
  36. 1 1
      src/components/tools/DetailList.vue
  37. 1 1
      src/components/tools/FooterToolBar.vue
  38. 1 1
      src/components/tools/HeadInfo.vue
  39. 1 1
      src/components/tools/HeaderNotice.vue
  40. 1 1
      src/components/tools/Logo.vue
  41. 3 3
      src/components/tools/TwoStepCaptcha.vue
  42. 4 4
      src/components/tools/UserMenu.vue
  43. 29 29
      src/components/tools/setting.js
  44. 3 3
      src/main.js
  45. 2 2
      src/permission.js
  46. 1 1
      src/store/modules/app.js
  47. 7 8
      src/store/modules/permission.js
  48. 5 5
      src/store/modules/user.js
  49. 1 1
      src/utils/auth.js
  50. 9 9
      src/utils/axios.js
  51. 3 3
      src/utils/filter.js
  52. 1 1
      src/utils/mixin.js
  53. 3 3
      src/utils/request.js
  54. 13 13
      src/utils/storage.js
  55. 2 2
      src/utils/util.js
  56. 1 1
      src/views/404.vue
  57. 1 1
      src/views/Home.vue
  58. 180 176
      src/views/account/center/Index.vue
  59. 1 1
      src/views/account/center/page/App.vue
  60. 1 1
      src/views/account/center/page/Article.vue
  61. 1 1
      src/views/account/center/page/Project.vue
  62. 8 8
      src/views/account/settings/AvatarModal.vue
  63. 2 2
      src/views/account/settings/Custom.vue
  64. 2 2
      src/views/account/settings/Index.vue
  65. 5 5
      src/views/account/settings/Security.vue
  66. 3 3
      src/views/dashboard/Analysis.vue
  67. 1 1
      src/views/dashboard/Monitor.vue
  68. 5 5
      src/views/dashboard/Workplace.vue
  69. 1 1
      src/views/exception/ExceptionPage.vue
  70. 4 4
      src/views/form/advancedForm/AdvancedForm.vue
  71. 1 1
      src/views/form/advancedForm/RepositoryForm.vue
  72. 1 1
      src/views/form/advancedForm/TaskForm.vue
  73. 1 1
      src/views/form/stepForm/Step1.vue
  74. 2 2
      src/views/form/stepForm/Step2.vue
  75. 1 1
      src/views/form/stepForm/Step3.vue
  76. 1 1
      src/views/form/stepForm/StepForm.vue
  77. 1 1
      src/views/list/CardList.vue
  78. 2 2
      src/views/list/PermissionList.vue
  79. 1 1
      src/views/list/RoleList.vue
  80. 1 1
      src/views/list/StandardList.vue
  81. 6 6
      src/views/list/TableInnerEditList.vue
  82. 4 4
      src/views/list/TableList.vue
  83. 1 1
      src/views/list/UserList.vue
  84. 2 2
      src/views/list/modules/RoleModal.vue
  85. 1 1
      src/views/list/search/SearchLayout.vue
  86. 1 1
      src/views/profile/advanced/Advanced.vue
  87. 1 1
      src/views/profile/basic/Index.vue
  88. 2 2
      src/views/result/Error.vue
  89. 1 1
      src/views/result/Result.vue
  90. 1 1
      src/views/result/Success.vue
  91. 219 200
      src/views/user/Login.vue
  92. 22 22
      src/views/user/Register.vue
  93. 3 3
      src/views/user/RegisterResult.vue

+ 1 - 1
README.md

@@ -114,7 +114,7 @@ yarn run lint
 
 - [Table 重封装组件](https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/table/README.md)
 
-- [ANTD 默认配置项](https://github.com/sendya/ant-design-pro-vue/blob/master/src/defaultConfig.js)
+- [ANTD 默认配置项](https://github.com/sendya/ant-design-pro-vue/blob/master/src/defaultSettings.js)
 
 - 其他待补充...
 

+ 23 - 1
package.json

@@ -74,7 +74,29 @@
       "vue/no-use-v-if-with-v-for": 0,
       "vue/html-closing-bracket-newline": 0,
       "vue/no-parsing-error": 0,
-      "no-console": 0
+      "no-console": 0,
+      "quotes": [
+        2,
+        "single",
+        {
+          "avoidEscape": true,
+          "allowTemplateLiterals": true
+        }
+      ],
+      "semi": [
+        2,
+        "never",
+        {
+          "beforeStatementContinuationChars": "never"
+        }
+      ],
+      "no-delete-var": 2,
+      "prefer-const": [
+        2,
+        {
+          "ignoreReadBeforeAssign": false
+        }
+      ]
     }
   },
   "postcss": {

+ 1 - 1
src/App.vue

@@ -16,7 +16,7 @@
       }
     },
     created () {
-      let that = this
+      const that = this
       enquireScreen(deviceType => {
         // tablet
         if (deviceType === 0) {

+ 1 - 1
src/components/AvatarList/Item.vue

@@ -11,7 +11,7 @@
   import Tooltip from 'ant-design-vue/es/tooltip'
 
   export default {
-    name: "AvatarItem",
+    name: 'AvatarItem',
     components: {
       Avatar,
       Tooltip

+ 1 - 1
src/components/AvatarList/List.vue

@@ -23,7 +23,7 @@
 
   export default {
     AvatarItem,
-    name: "AvatarList",
+    name: 'AvatarList',
     components: {
       Avatar,
       AvatarItem

+ 1 - 1
src/components/AvatarList/index.js

@@ -1,4 +1,4 @@
 import AvatarList from './List'
-import "./index.less"
+import './index.less'
 
 export default AvatarList

+ 1 - 1
src/components/ChartCard.vue

@@ -24,7 +24,7 @@
 
 <script>
   export default {
-    name: "ChartCard",
+    name: 'ChartCard',
     props: {
       title: {
         type: String,

+ 11 - 11
src/components/CountDown/CountDown.vue

@@ -7,11 +7,11 @@
 <script>
 
   function fixedZero(val) {
-    return val * 1 < 10 ? `0${val}` : val;
+    return val * 1 < 10 ? `0${val}` : val
   }
 
   export default {
-    name: "CountDown",
+    name: 'CountDown',
     props: {
       format: {
         type: Function,
@@ -38,12 +38,12 @@
     },
     filters: {
       format(time) {
-        const hours = 60 * 60 * 1000;
-        const minutes = 60 * 1000;
+        const hours = 60 * 60 * 1000
+        const minutes = 60 * 1000
 
-        const h = Math.floor(time / hours);
-        const m = Math.floor((time - h * hours) / minutes);
-        const s = Math.floor((time - h * hours - m * minutes) / 1000);
+        const h = Math.floor(time / hours)
+        const m = Math.floor((time - h * hours) / minutes)
+        const s = Math.floor((time - h * hours - m * minutes) / 1000)
         return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
       }
     },
@@ -53,8 +53,8 @@
     },
     methods: {
       initTime() {
-        let lastTime = 0;
-        let targetTime = 0;
+        let lastTime = 0
+        let targetTime = 0
         this.originTargetTime = this.target
         try {
           if (Object.prototype.toString.call(this.target) === '[object Date]') {
@@ -66,7 +66,7 @@
           throw new Error('invalid target prop')
         }
 
-        lastTime = targetTime - new Date().getTime();
+        lastTime = targetTime - new Date().getTime()
 
         this.lastTime = lastTime < 0 ? 0 : lastTime
       },
@@ -78,7 +78,7 @@
             clearTimeout(this.timer)
             this.lastTime = 0
             if (typeof onEnd === 'function') {
-              onEnd();
+              onEnd()
             }
           } else {
             this.lastTime -= this.interval

+ 2 - 2
src/components/Ellipsis/Ellipsis.vue

@@ -53,8 +53,8 @@
     },
     render () {
       const { tooltip, length } = this.$props
-      let str = this.$slots.default.map(vNode => vNode.text).join("")
-      const strDom = tooltip && getStrFullLength(str) > length ? this.getTooltip(str) : this.getStrDom(str);
+      const str = this.$slots.default.map(vNode => vNode.text).join('')
+      const strDom = tooltip && getStrFullLength(str) > length ? this.getTooltip(str) : this.getStrDom(str)
       return (
         strDom
       )

+ 1 - 1
src/components/Trend/Trend.vue

@@ -12,7 +12,7 @@
 
 <script>
   export default {
-    name: "Trend",
+    name: 'Trend',
     props: {
       prefixCls: {
         type: String,

+ 1 - 1
src/components/chart/Bar.vue

@@ -39,7 +39,7 @@
   }]
 
   export default {
-    name: "Bar",
+    name: 'Bar',
     props: {
       title: {
         type: String,

+ 1 - 1
src/components/chart/Liquid.vue

@@ -48,7 +48,7 @@
 
 <script>
   export default {
-    name: "Liquid",
+    name: 'Liquid',
     props: {
       height: {
         type: Number,

+ 1 - 1
src/components/chart/MiniArea.vue

@@ -39,7 +39,7 @@
   }]
 
   export default {
-    name: "MiniArea",
+    name: 'MiniArea',
     data () {
       return {
         data,

+ 1 - 1
src/components/chart/MiniBar.vue

@@ -40,7 +40,7 @@
   }]
 
   export default {
-    name: "MiniBar",
+    name: 'MiniBar',
     data () {
       return {
         data,

+ 1 - 1
src/components/chart/MiniProgress.vue

@@ -12,7 +12,7 @@
 
 <script>
   export default {
-    name: "MiniProgress",
+    name: 'MiniProgress',
     props: {
       target: {
         type: Number,

+ 1 - 1
src/components/chart/RankList.vue

@@ -13,7 +13,7 @@
 
 <script>
   export default {
-    name: "RankList",
+    name: 'RankList',
     // ['title', 'list']
     props: {
       title: {

+ 1 - 1
src/components/chart/TransferBar.vue

@@ -35,7 +35,7 @@
   }]
 
   export default {
-    name: "Bar",
+    name: 'Bar',
     props: {
       title: {
         type: String,

+ 3 - 3
src/components/chart/Trend.vue

@@ -8,7 +8,7 @@
 
 <script>
   export default {
-    name: "Trend",
+    name: 'Trend',
     props: {
       term: {
         type: String,
@@ -43,8 +43,8 @@
       }
     },
     created () {
-      let type = this.type === null ? this.value >= this.target : this.type
-      this.trend = type ? 'up' : 'down';
+      const type = this.type === null ? this.value >= this.target : this.type
+      this.trend = type ? 'up' : 'down'
       this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed)
     }
   }

+ 1 - 1
src/components/layouts/BasicLayout.vue

@@ -13,7 +13,7 @@
   import GlobalLayout from '@/components/page/GlobalLayout'
 
   export default {
-    name: "BasicLayout",
+    name: 'BasicLayout',
     components: {
       GlobalLayout
     },

+ 1 - 1
src/components/layouts/BlankLayout.vue

@@ -7,7 +7,7 @@
 <script>
 
   export default {
-    name: "BlankLayout",
+    name: 'BlankLayout',
   }
 </script>
 

+ 1 - 1
src/components/layouts/PageView.vue

@@ -13,7 +13,7 @@
   import RouteView from './RouteView'
 
   export default {
-    name: "PageContent",
+    name: 'PageContent',
     components: {
       RouteView,
       PageLayout

+ 1 - 1
src/components/layouts/RouteView.vue

@@ -7,7 +7,7 @@
 
 <script>
   export default {
-    name: "RouteView",
+    name: 'RouteView',
     computed: {
       keepAlive () {
         return this.$route.meta.keepAlive

+ 2 - 2
src/components/layouts/UserLayout.vue

@@ -30,11 +30,11 @@
 </template>
 
 <script>
-  import RouteView from "@/components/layouts/RouteView"
+  import RouteView from '@/components/layouts/RouteView'
   import { mixinDevice } from '@/utils/mixin.js'
 
   export default {
-    name: "UserLayout",
+    name: 'UserLayout',
     components: { RouteView },
     mixins: [mixinDevice],
     data () {

+ 2 - 2
src/components/menu/SideMenu.vue

@@ -18,13 +18,13 @@
 </template>
 
 <script>
-  import ALayoutSider from "ant-design-vue/es/layout/Sider"
+  import ALayoutSider from 'ant-design-vue/es/layout/Sider'
   import Logo from '../tools/Logo'
   import SMenu from './index'
   import { mixin, mixinDevice } from '@/utils/mixin.js'
 
   export default {
-    name: "SideMenu",
+    name: 'SideMenu',
     components: { ALayoutSider, Logo, SMenu },
     mixins: [mixin, mixinDevice],
     props: {

+ 45 - 59
src/components/menu/index.js

@@ -26,7 +26,7 @@ export default {
       default: false
     }
   },
-  data () {
+  data() {
     return {
       openKeys: [],
       selectedKeys: [],
@@ -34,17 +34,17 @@ export default {
     }
   },
   computed: {
-    rootSubmenuKeys: (vm) => {
-      let keys = []
+    rootSubmenuKeys: vm => {
+      const keys = []
       vm.menu.forEach(item => keys.push(item.path))
       return keys
     }
   },
-  created () {
+  created() {
     this.updateMenu()
   },
   watch: {
-    collapsed (val) {
+    collapsed(val) {
       if (val) {
         this.cachedOpenKeys = this.openKeys
         this.openKeys = []
@@ -52,94 +52,79 @@ export default {
         this.openKeys = this.cachedOpenKeys
       }
     },
-    '$route': function () {
+    $route: function() {
       this.updateMenu()
     }
   },
   methods: {
-    renderIcon: function (h, icon) {
-      return icon === 'none' || icon === undefined ? null
-        : h(Icon, { props: { type: icon !== undefined ? icon : '' } })
+    renderIcon: function(h, icon) {
+      return icon === 'none' || icon === undefined ? null : h(Icon, { props: { type: icon !== undefined ? icon : '' } })
     },
-    renderMenuItem: function (h, menu, pIndex, index) {
-      return h(Item, { key: menu.path ? menu.path : 'item_' + pIndex + '_' + index },
-        [
-          h(
-            'router-link',
-            { attrs: { to: { name: menu.name } } },
-            [
-              this.renderIcon(h, menu.meta.icon),
-              h('span', [ menu.meta.title ])
-            ]
-          )
-        ]
-      )
-    },
-    renderSubMenu: function (h, menu, pIndex, index) {
-      const this2_ = this;
-      let subItem = [ h('span',
-        { slot: 'title' },
-        [
+    renderMenuItem: function(h, menu, pIndex, index) {
+      return h(Item, { key: menu.path ? menu.path : 'item_' + pIndex + '_' + index }, [
+        h('router-link', { attrs: { to: { name: menu.name } } }, [
           this.renderIcon(h, menu.meta.icon),
-          h('span', [ menu.meta.title ])
-        ]
-      ) ]
-      let itemArr = []
-      let pIndex_ = pIndex + '_' + index
+          h('span', [menu.meta.title])
+        ])
+      ])
+    },
+    renderSubMenu: function(h, menu, pIndex, index) {
+      const this2_ = this
+      const subItem = [h('span', { slot: 'title' }, [this.renderIcon(h, menu.meta.icon), h('span', [menu.meta.title])])]
+      const itemArr = []
+      const pIndex_ = pIndex + '_' + index
       if (!menu.alwaysShow) {
-        menu.children.forEach(function (item, i) {
+        menu.children.forEach(function(item, i) {
           itemArr.push(this2_.renderItem(h, item, pIndex_, i))
         })
       }
-      return h(
-        SubMenu,
-        { key: menu.path ? menu.path : 'submenu_' + pIndex + '_' + index },
-        subItem.concat(itemArr)
-      )
+      return h(SubMenu, { key: menu.path ? menu.path : 'submenu_' + pIndex + '_' + index }, subItem.concat(itemArr))
     },
-    renderItem: function (h, menu, pIndex, index) {
+    renderItem: function(h, menu, pIndex, index) {
       if (!menu.hidden) {
-        return menu.children && !menu.alwaysShow ? this.renderSubMenu(h, menu, pIndex, index) : this.renderMenuItem(h, menu, pIndex, index)
+        return menu.children && !menu.alwaysShow
+          ? this.renderSubMenu(h, menu, pIndex, index)
+          : this.renderMenuItem(h, menu, pIndex, index)
       }
     },
-    renderMenu: function (h, menuTree) {
+    renderMenu: function(h, menuTree) {
       const this2_ = this
-      let menuArr = []
-      menuTree.forEach(function (menu, i) {
+      const menuArr = []
+      menuTree.forEach(function(menu, i) {
         if (!menu.hidden) {
           menuArr.push(this2_.renderItem(h, menu, '0', i))
         }
       })
       return menuArr
     },
-    onOpenChange (openKeys) {
-      const latestOpenKey = openKeys.find(key => this.openKeys.indexOf(key) === -1)
-      if (this.rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
+    onOpenChange(openKeys) {
+      const latestOpenKey = openKeys.find(key => !this.openKeys.includes(key))
+      if (!this.rootSubmenuKeys.includes(latestOpenKey)) {
         this.openKeys = openKeys
       } else {
-        this.openKeys = latestOpenKey ? [ latestOpenKey ] : []
+        this.openKeys = latestOpenKey ? [latestOpenKey] : []
       }
     },
-    updateMenu () {
-      let routes = this.$route.matched.concat()
+    updateMenu() {
+      const routes = this.$route.matched.concat()
       if (routes.length >= 4 && this.$route.meta.hidden) {
         routes.pop()
-        this.selectedKeys = [ routes[2].path ]
+        this.selectedKeys = [routes[2].path]
       } else {
-        this.selectedKeys = [ routes.pop().path ]
+        this.selectedKeys = [routes.pop().path]
       }
 
-      let openKeys = []
+      const openKeys = []
       if (this.mode === 'inline') {
-        routes.forEach((item) => {
+        routes.forEach(item => {
           openKeys.push(item.path)
         })
       }
 
-      this.collapsed ? this.cachedOpenKeys = openKeys : this.openKeys = openKeys
+      this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.openKeys = openKeys)
     }
   },
-  render (h) {
+  render(h) {
     return h(
       Menu,
       {
@@ -151,12 +136,13 @@ export default {
         },
         on: {
           openChange: this.onOpenChange,
-          select: (obj) => {
+          select: obj => {
             this.selectedKeys = obj.selectedKeys
             this.$emit('select', obj)
           }
         }
-      }, this.renderMenu(h, this.menu)
+      },
+      this.renderMenu(h, this.menu)
     )
   }
-}
+}

+ 1 - 1
src/components/page/GlobalFooter.vue

@@ -18,7 +18,7 @@
 
 <script>
   export default {
-    name: "LayoutFooter"
+    name: 'LayoutFooter'
   }
 </script>
 

+ 2 - 2
src/components/page/GlobalHeader.vue

@@ -46,7 +46,7 @@
   import { mixin } from '@/utils/mixin.js'
 
   export default {
-    name: "GlobalHeader",
+    name: 'GlobalHeader',
     components: {
       UserMenu,
       SMenu,
@@ -90,7 +90,7 @@
     methods: {
       handleScroll () {
         if (this.autoHideHeader) {
-          let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
+          const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
           if (scrollTop > 100) {
             this.headerBarFixed = true
           } else {

+ 1 - 1
src/components/page/GlobalLayout.vue

@@ -83,7 +83,7 @@
   import { mixin, mixinDevice } from '@/utils/mixin.js'
 
   export default {
-    name: "GlobalLayout",
+    name: 'GlobalLayout',
     components: {
       SideMenu,
       GlobalHeader,

+ 2 - 2
src/components/page/PageHeader.vue

@@ -44,9 +44,9 @@
   import Breadcrumb from '@/components/tools/Breadcrumb'
 
   export default {
-    name: "PageHeader",
+    name: 'PageHeader',
     components: {
-      "s-breadcrumb": Breadcrumb
+      's-breadcrumb': Breadcrumb
     },
     props: {
       title: {

+ 1 - 1
src/components/page/PageLayout.vue

@@ -40,7 +40,7 @@
   import PageHeader from './PageHeader'
 
   export default {
-    name: "LayoutContent",
+    name: 'LayoutContent',
     components: {
       PageHeader
     },

+ 1 - 1
src/components/page/SHeaderNotice.vue

@@ -19,7 +19,7 @@
 
 <script>
   export default {
-    name: "HeaderNotice",
+    name: 'HeaderNotice',
     props: {
       tabs: {
         type: Array,

+ 2 - 2
src/components/setting/SettingDrawer.vue

@@ -211,7 +211,7 @@
         this.$store.dispatch('ToggleLayoutMode', mode)
         // 因为顶部菜单不能固定左侧菜单栏,所以强制关闭
         //
-        this.handleFixSiderbar(false);
+        this.handleFixSiderbar(false)
       },
       handleContentWidthChange (type) {
         this.$store.dispatch('ToggleContentWidth', type)
@@ -231,7 +231,7 @@
       handleFixSiderbar (fixed) {
         if (this.layoutMode === 'topmenu') {
           this.$store.dispatch('ToggleFixSiderbar', false)
-          return;
+          return
         }
         this.$store.dispatch('ToggleFixSiderbar', fixed)
       }

+ 1 - 1
src/components/setting/SettingItem.vue

@@ -8,7 +8,7 @@
 
 <script>
   export default {
-    name: "SettingItem",
+    name: 'SettingItem',
     props: {
       title: {
         type: String,

+ 12 - 12
src/components/table/StandardTable.vue

@@ -30,7 +30,7 @@
 
 <script>
   export default {
-    name: "StandardTable",
+    name: 'StandardTable',
     // props: ['bordered', 'loading', 'columns', 'data', 'rowKey', 'pagination', 'selectedRows'],
     props: {
 
@@ -125,14 +125,14 @@
       this.paramsName = Object.assign(
         {},
         {
-          pageNumber: "pageNo",
-          pageSize: "pageSize",
-          total: "totalCount",
-          results: "data",
-          sortColumns: "sortColumns"
+          pageNumber: 'pageNo',
+          pageSize: 'pageSize',
+          total: 'totalCount',
+          results: 'data',
+          sortColumns: 'sortColumns'
         },
         this.responseParamsName
-      );
+      )
 
       this.needTotalList = this.initTotalList(this.columns)
 
@@ -142,7 +142,7 @@
     methods: {
       updateSelect (selectedRowKeys, selectedRows) {
         this.selectedRowKeys = selectedRowKeys
-        let list = this.needTotalList
+        const list = this.needTotalList
         this.needTotalList = list.map(item => {
           return {
             ...item,
@@ -164,7 +164,7 @@
       },
 
       loadData (params) {
-        let that = this
+        const that = this
         that.loading = true
         params = Object.assign({}, params)
         const remoteParams = Object.assign({}, that.sortParams)
@@ -178,7 +178,7 @@
           that.currentPageSize = params.pageSize
         }
 
-        let dataPromise = that.data(remoteParams)
+        const dataPromise = that.data(remoteParams)
 
         dataPromise.then( response => {
           if (!response) {
@@ -190,8 +190,8 @@
 
           that.current = results
 
-          that.$emit("update:currentData", that.current.slice())
-          that.$emit("dataloaded", that.current.slice())
+          that.$emit('update:currentData', that.current.slice())
+          that.$emit('dataloaded', that.current.slice())
 
           that.total = response[that.paramsName.total] * 1
           that.pagination = that.pager()

+ 33 - 33
src/components/table/index.js

@@ -1,5 +1,5 @@
-import T from "ant-design-vue/es/table/Table";
-import get from "lodash.get"
+import T from 'ant-design-vue/es/table/Table'
+import get from 'lodash.get'
 export default {
   data() {
     return {
@@ -11,7 +11,7 @@ export default {
       localLoading: false,
       localDataSource: [],
       localPagination: Object.assign({}, T.props.pagination)
-    };
+    }
   },
   props: Object.assign({}, T.props, {
     rowKey: {
@@ -49,24 +49,24 @@ export default {
         params: Object.assign({}, this.$route.params, {
           pageNo: val
         }),
-      });
+      })
     },
     pageNum(val) {
       Object.assign(this.localPagination, {
         current: val
-      });
+      })
     },
     pageSize(val) {
       console.log('pageSize:', val)
       Object.assign(this.localPagination, {
         pageSize: val
-      });
+      })
     },
     showSizeChanger(val) {
       console.log('showSizeChanger', val)
       Object.assign(this.localPagination, {
         showSizeChanger: val
-      });
+      })
     }
   },
   created() {
@@ -74,13 +74,13 @@ export default {
       current: this.pageNum,
       pageSize: this.pageSize,
       showSizeChanger: this.showSizeChanger
-    });
+    })
     this.needTotalList = this.initTotalList(this.columns)
-    this.loadData();
+    this.loadData()
   },
   methods: {
     refresh() {
-      this.loadData();
+      this.loadData()
     },
     loadData(pagination, filters, sorter) {
 
@@ -101,7 +101,7 @@ export default {
             ...filters
           }
         )
-      );
+      )
 
       if (result instanceof Promise) {
         result.then(r => {
@@ -111,12 +111,12 @@ export default {
             showSizeChanger: this.showSizeChanger,
             pageSize: (pagination && pagination.pageSize) ||
               this.localPagination.pageSize
-          });
+          })
 
           !r.totalCount && ['auto', false].includes(this.showPagination) && (this.localPagination = false)
-          this.localDataSource = r.data; // 返回结果中的数组数据
+          this.localDataSource = r.data // 返回结果中的数组数据
           this.localLoading = false
-        });
+        })
       }
     },
     initTotalList(columns) {
@@ -133,12 +133,12 @@ export default {
     updateSelect(selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
-      let list = this.needTotalList
+      const list = this.needTotalList
       this.needTotalList = list.map(item => {
         return {
           ...item,
           total: selectedRows.reduce((sum, val) => {
-            let total = sum + get(val, item.dataIndex)
+            const total = sum + get(val, item.dataIndex)
             return isNaN(total) ? 0 : total
           }, 0)
         }
@@ -154,7 +154,7 @@ export default {
     },
     renderMsg(h) {
       const _vm = this
-      let d = []
+      const d = []
       // 构建 已选择
       d.push(
         h('span', {
@@ -166,7 +166,7 @@ export default {
             fontWeight: 600
           }
         }, this.selectedRows.length)])
-      );
+      )
 
       // 构建 列统计
       this.needTotalList.map(item => {
@@ -183,7 +183,7 @@ export default {
               }
             }, `${ !item.customRender ? item.total : item.customRender(item.total) }`)
           ]))
-      });
+      })
 
       // 构建 清空选择
       d.push(h('a', {
@@ -207,15 +207,15 @@ export default {
   render(h) {
     const _vm = this
 
-    let props = {},
-      localKeys = Object.keys(this.$data);
+    const props = {},
+      localKeys = Object.keys(this.$data)
 
     Object.keys(T.props).forEach(k => {
-      let localKey = `local${k.substring(0,1).toUpperCase()}${k.substring(1)}`;
+      const localKey = `local${k.substring(0,1).toUpperCase()}${k.substring(1)}`
       if (localKeys.includes(localKey)) {
-        return props[k] = _vm[localKey];
+        return props[k] = _vm[localKey]
       }
-      return props[k] = _vm[k];
+      return props[k] = _vm[k]
     })
 
 
@@ -228,10 +228,10 @@ export default {
           _vm.updateSelect(selectedRowKeys, selectedRows)
           _vm.$emit('onSelect', { selectedRowKeys: selectedRowKeys, selectedRows: selectedRows })
         }
-      };
+      }
 
       return h('div', {}, [
-        h("a-alert", {
+        h('a-alert', {
           style: {
             marginBottom: '16px'
           },
@@ -240,26 +240,26 @@ export default {
             showIcon: true
           }
         }, [_vm.renderAlert(h)]),
-        h("a-table", {
-          tag: "component",
+        h('a-table', {
+          tag: 'component',
           attrs: props,
           on: {
             change: _vm.loadData
           },
           scopedSlots: this.$scopedSlots
         }, this.$slots.default)
-      ]);
+      ])
 
     }
 
-    return h("a-table", {
-      tag: "component",
+    return h('a-table', {
+      tag: 'component',
       attrs: props,
       on: {
         change: _vm.loadData
       },
       scopedSlots: this.$scopedSlots
-    }, this.$slots.default);
+    }, this.$slots.default)
 
   }
-};
+}

+ 1 - 1
src/components/tools/DetailList.vue

@@ -42,7 +42,7 @@
   }
 
   export default {
-    name: "DetailList",
+    name: 'DetailList',
     Item: Item,
     components: {
       Col

+ 1 - 1
src/components/tools/FooterToolBar.vue

@@ -11,7 +11,7 @@
 
 <script>
   export default {
-    name: "FooterToolBar"
+    name: 'FooterToolBar'
   }
 </script>
 

+ 1 - 1
src/components/tools/HeadInfo.vue

@@ -8,7 +8,7 @@
 
 <script>
   export default {
-    name: "HeadInfo",
+    name: 'HeadInfo',
     props: {
       title: {
         type: String,

+ 1 - 1
src/components/tools/HeaderNotice.vue

@@ -47,7 +47,7 @@
 
 <script>
   export default {
-    name: "HeaderNotice",
+    name: 'HeaderNotice',
     data () {
       return {
         loadding: false

+ 1 - 1
src/components/tools/Logo.vue

@@ -9,7 +9,7 @@
 
 <script>
   export default {
-    name: "Logo",
+    name: 'Logo',
     props: {
       title: {
         type: String,

+ 3 - 3
src/components/tools/TwoStepCaptcha.vue

@@ -51,7 +51,7 @@ export default {
       stepLoading: false,
 
       form: null
-    };
+    }
   },
   methods: {
     handleStepOk() {
@@ -64,7 +64,7 @@ export default {
             vm.stepLoading = false
             vm.$emit('success', { values })
           }, 2000)
-          return;
+          return
         }
         this.stepLoading = false
         this.$emit('error', { err })
@@ -78,7 +78,7 @@ export default {
       
     }
   }
-};
+}
 </script>
 <style lang="scss" scoped>
   .step-form-wrapper {

+ 4 - 4
src/components/tools/UserMenu.vue

@@ -43,13 +43,13 @@
   import { mapActions, mapGetters } from 'vuex'
 
   export default {
-    name: "UserMenu",
+    name: 'UserMenu',
     components: {
       HeaderNotice
     },
     methods: {
-      ...mapActions(["Logout"]),
-      ...mapGetters(["nickname", "avatar"]),
+      ...mapActions(['Logout']),
+      ...mapGetters(['nickname', 'avatar']),
       handleLogout() {
         const that = this
 
@@ -68,7 +68,7 @@
           },
           onCancel() {
           },
-        });
+        })
       },
     }
   }

+ 29 - 29
src/components/tools/setting.js

@@ -1,7 +1,7 @@
-import { message } from 'ant-design-vue/es';
+import { message } from 'ant-design-vue/es'
 // import defaultSettings from '../defaultSettings';
 
-let lessNodesAppended;
+let lessNodesAppended
 
 const colorList = [
   {
@@ -28,7 +28,7 @@ const colorList = [
   {
     key: '酱紫', color: '#722ED1',
   },
-];
+]
 
 const updateTheme = primaryColor => {
   // Don't compile less in production!
@@ -37,12 +37,12 @@ const updateTheme = primaryColor => {
   } */
   // Determine if the component is remounted
   if (!primaryColor) {
-    return;
+    return
   }
-  const hideMessage = message.loading('正在编译主题!', 0);
+  const hideMessage = message.loading('正在编译主题!', 0)
   function buildIt() {
     if (!window.less) {
-      return;
+      return
     }
     setTimeout(() => {
       window.less
@@ -50,46 +50,46 @@ const updateTheme = primaryColor => {
           '@primary-color': primaryColor,
         })
         .then(() => {
-          hideMessage();
+          hideMessage()
         })
         .catch(() => {
-          message.error('Failed to update theme');
-          hideMessage();
-        });
-    }, 200);
+          message.error('Failed to update theme')
+          hideMessage()
+        })
+    }, 200)
   }
   if (!lessNodesAppended) {
     // insert less.js and color.less
-    const lessStyleNode = document.createElement('link');
-    const lessConfigNode = document.createElement('script');
-    const lessScriptNode = document.createElement('script');
-    lessStyleNode.setAttribute('rel', 'stylesheet/less');
-    lessStyleNode.setAttribute('href', '/color.less');
+    const lessStyleNode = document.createElement('link')
+    const lessConfigNode = document.createElement('script')
+    const lessScriptNode = document.createElement('script')
+    lessStyleNode.setAttribute('rel', 'stylesheet/less')
+    lessStyleNode.setAttribute('href', '/color.less')
     lessConfigNode.innerHTML = `
       window.less = {
         async: true,
         env: 'production',
         javascriptEnabled: true
       };
-    `;
-    lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js';
-    lessScriptNode.async = true;
+    `
+    lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js'
+    lessScriptNode.async = true
     lessScriptNode.onload = () => {
-      buildIt();
-      lessScriptNode.onload = null;
-    };
-    document.body.appendChild(lessStyleNode);
-    document.body.appendChild(lessConfigNode);
-    document.body.appendChild(lessScriptNode);
-    lessNodesAppended = true;
+      buildIt()
+      lessScriptNode.onload = null
+    }
+    document.body.appendChild(lessStyleNode)
+    document.body.appendChild(lessConfigNode)
+    document.body.appendChild(lessScriptNode)
+    lessNodesAppended = true
   } else {
-    buildIt();
+    buildIt()
   }
-};
+}
 
 const updateColorWeak = colorWeak => {
   // document.body.className = colorWeak ? 'colorWeak' : '';
   colorWeak ? document.body.classList.add('colorWeak') : document.body.classList.remove('colorWeak')
-};
+}
 
 export { updateTheme, colorList, updateColorWeak }

+ 3 - 3
src/main.js

@@ -4,11 +4,11 @@ import Storage from 'vue-ls'
 import router from './router'
 import store from './store/'
 
-import { VueAxios } from "@/utils/request"
+import { VueAxios } from '@/utils/request'
 
 import Antd from 'ant-design-vue'
 import Viser from 'viser-vue'
-import 'ant-design-vue/dist/antd.less';  // or 'ant-design-vue/dist/antd.less'
+import 'ant-design-vue/dist/antd.less'  // or 'ant-design-vue/dist/antd.less'
 
 import '@/permission' // permission control
 import '@/utils/filter' // base filter
@@ -25,7 +25,7 @@ import {
   DEFAULT_FIXED_HEADER_HIDDEN,
   DEFAULT_FIXED_SIDEMENU,
   DEFAULT_CONTENT_WIDTH_TYPE
-} from "@/store/mutation-types"
+} from '@/store/mutation-types'
 import config from '@/defaultSettings'
 
 Vue.config.productionTip = false

+ 2 - 2
src/permission.js

@@ -9,7 +9,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/user/login', '/user/register', '/user/register-result'] // no redirect whitelist
+const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
 
 router.beforeEach((to, from, next) => {
   NProgress.start() // start progress bar
@@ -53,7 +53,7 @@ router.beforeEach((to, from, next) => {
       }
     }
   } else {
-    if (whiteList.indexOf(to.path) !== -1) {
+    if (whiteList.includes(to.name)) {
       // 在免登录白名单,直接进入
       next()
     } else {

+ 1 - 1
src/store/modules/app.js

@@ -9,7 +9,7 @@ import {
   DEFAULT_FIXED_SIDEMENU,
   DEFAULT_FIXED_HEADER_HIDDEN,
   DEFAULT_CONTENT_WIDTH_TYPE
-} from "@/store/mutation-types"
+} from '@/store/mutation-types'
 
 const app = {
   state: {

+ 7 - 8
src/store/modules/permission.js

@@ -1,4 +1,4 @@
-import { asyncRouterMap, constantRouterMap } from "@/config/router.config"
+import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
 
 /**
  * 过滤账户是否拥有某一个权限,并将菜单从加载列表移除
@@ -9,10 +9,10 @@ import { asyncRouterMap, constantRouterMap } from "@/config/router.config"
  */
 function hasPermission(permission, route) {
   if (route.meta && route.meta.permission) {
-    let flag = -1
+    let flag = false
     for (let i = 0, len = permission.length; i < len; i++) {
-      flag = route.meta.permission.indexOf(permission[i])
-      if (flag >= 0) {
+      flag = route.meta.permission.includes(permission[i])
+      if (flag) {
         return true
       }
     }
@@ -31,7 +31,7 @@ function hasPermission(permission, route) {
 // eslint-disable-next-line
 function hasRole(roles, route) {
   if (route.meta && route.meta.roles) {
-    return route.meta.roles.indexOf(roles.id)
+    return route.meta.roles.includes(roles.id)
   } else {
     return true
   }
@@ -65,8 +65,7 @@ const permission = {
     GenerateRoutes({ commit }, data) {
       return new Promise(resolve => {
         const { roles } = data
-        let accessedRouters
-        accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
+        const accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
         commit('SET_ROUTERS', accessedRouters)
         resolve()
       })
@@ -74,4 +73,4 @@ const permission = {
   }
 }
 
-export default permission
+export default permission

+ 5 - 5
src/store/modules/user.js

@@ -1,7 +1,7 @@
 import Vue from 'vue'
-import { login, getInfo, logout } from "@/api/login"
-import { ACCESS_TOKEN } from "@/store/mutation-types"
-import { welcome } from "@/utils/util"
+import { login, getInfo, logout } from '@/api/login'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { welcome } from '@/utils/util'
 
 const user = {
   state: {
@@ -58,11 +58,11 @@ const user = {
             role.permissions = result.role.permissions
             role.permissions.map(per => {
               if (per.actionEntitySet != null && per.actionEntitySet.length > 0) {
-                let action = per.actionEntitySet.map(action => { return action.action })
+                const action = per.actionEntitySet.map(action => { return action.action })
                 per.actionList = action
               }
             })
-            role.permissionList = role.permissions.map(permission => { return permission.permissionId });
+            role.permissionList = role.permissions.map(permission => { return permission.permissionId })
             commit('SET_ROLES', result.role)
             commit('SET_INFO', result)
           } else {

+ 1 - 1
src/utils/auth.js

@@ -1,7 +1,7 @@
 /**
  * 弃用
  */
-import { setStore, getStore, clearStore } from "@/utils/storage"
+import { setStore, getStore, clearStore } from '@/utils/storage'
 
 export const TokenKey = 'Access-Token'
 

+ 9 - 9
src/utils/axios.js

@@ -3,32 +3,32 @@ const VueAxios = {
     // eslint-disable-next-line no-unused-vars
     install(Vue, router = {}, instance) {
         if (this.installed) {
-            return;
+            return
         }
-        this.installed = true;
+        this.installed = true
 
         if (!instance) {
             // eslint-disable-next-line no-console
-            console.error('You have to install axios');
-            return;
+            console.error('You have to install axios')
+            return
         }
 
-        Vue.axios = instance;
+        Vue.axios = instance
 
         Object.defineProperties(Vue.prototype, {
             axios: {
                 get: function get() {
-                    return instance;
+                    return instance
                 }
             },
             $http: {
                 get: function get() {
-                    return instance;
+                    return instance
                 }
             }
-        });
+        })
     }
-};
+}
 
 export {
     VueAxios,

+ 3 - 3
src/utils/filter.js

@@ -1,11 +1,11 @@
-import Vue from "vue";
-import * as dayjs from "dayjs";
+import Vue from 'vue'
+import * as dayjs from 'dayjs'
 
 Vue.filter('NumberFormat', function (value) {
   if (!value) {
     return '0'
   }
-  let intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
+  const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
   return intPartFormat
 })
 

+ 1 - 1
src/utils/mixin.js

@@ -1,5 +1,5 @@
 // import Vue from 'vue'
-import { mapState } from "vuex";
+import { mapState } from 'vuex'
 
 // const mixinsComputed = Vue.config.optionMergeStrategies.computed
 // const mixinsMethods = Vue.config.optionMergeStrategies.methods

+ 3 - 3
src/utils/request.js

@@ -3,7 +3,7 @@ import axios from 'axios'
 import store from '@/store'
 import { VueAxios } from './axios'
 import notification from 'ant-design-vue/es/notification'
-import { ACCESS_TOKEN } from "@/store/mutation-types"
+import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 // 创建 axios 实例
 const service = axios.create({
@@ -13,7 +13,7 @@ const service = axios.create({
 
 const err = (error) => {
   if (error.response) {
-    let data = error.response.data
+    const data = error.response.data
     const token = Vue.ls.get(ACCESS_TOKEN)
     if (error.response.status === 403) {
       notification.error({ message: 'Forbidden', description: data.message})
@@ -30,7 +30,7 @@ const err = (error) => {
     }
   }
   return Promise.reject(error)
-};
+}
 
 // request interceptor
 service.interceptors.request.use(config => {

+ 13 - 13
src/utils/storage.js

@@ -7,21 +7,21 @@
  */
 export const setStore = (name, content, maxAge = null) => {
   if (!global.window || !name) {
-    return;
+    return
   }
 
   if (typeof content !== 'string') {
     content = JSON.stringify(content)
   }
 
-  let storage = global.window.localStorage
+  const storage = global.window.localStorage
 
   storage.setItem(name, content)
   if (maxAge && !isNaN(parseInt(maxAge))) {
-    let timeout = parseInt(new Date().getTime() / 1000)
+    const timeout = parseInt(new Date().getTime() / 1000)
     storage.setItem(`${name}_expire`, timeout + maxAge)
   }
-};
+}
 
 /**
  * Get storage
@@ -31,16 +31,16 @@ export const setStore = (name, content, maxAge = null) => {
  */
 export const getStore = name => {
   if (!global.window || !name) {
-    return;
+    return
   }
 
-  let content = window.localStorage.getItem(name)
-  let _expire = window.localStorage.getItem(`${name}_expire`)
+  const content = window.localStorage.getItem(name)
+  const _expire = window.localStorage.getItem(`${name}_expire`)
 
   if (_expire) {
-    let now = parseInt(new Date().getTime() / 1000)
+    const now = parseInt(new Date().getTime() / 1000)
     if (now > _expire) {
-      return;
+      return
     }
   }
 
@@ -49,7 +49,7 @@ export const getStore = name => {
   } catch (e) {
     return content
   }
-};
+}
 
 /**
  * Clear storage
@@ -58,19 +58,19 @@ export const getStore = name => {
  */
 export const clearStore = name => {
   if (!global.window || !name) {
-    return;
+    return
   }
 
   window.localStorage.removeItem(name)
   window.localStorage.removeItem(`${name}_expire`)
-};
+}
 
 /**
  * Clear all storage
  */
 export const clearAll = () => {
   if (!global.window || !name) {
-    return;
+    return
   }
 
   window.localStorage.clear()

+ 2 - 2
src/utils/util.js

@@ -6,7 +6,7 @@ export function timeFix() {
 
 export function welcome() {
   const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
-  let index = Math.floor((Math.random()*arr.length))
+  const index = Math.floor((Math.random()*arr.length))
   return arr[index]
 }
 
@@ -14,7 +14,7 @@ export function welcome() {
  * 触发 window.resize
  */
 export function triggerWindowResizeEvent() {
-  let event = document.createEvent('HTMLEvents')
+  const event = document.createEvent('HTMLEvents')
   event.initEvent('resize', true, true)
   event.eventType = 'message'
   window.dispatchEvent(event)

+ 1 - 1
src/views/404.vue

@@ -6,7 +6,7 @@
 
 <script>
   export default {
-    name: "404"
+    name: '404'
   }
 </script>
 

+ 1 - 1
src/views/Home.vue

@@ -143,7 +143,7 @@
         this.$notification.open({
           message: 'Notification Title',
           description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
-        });
+        })
       }
     }
   }

+ 180 - 176
src/views/account/center/Index.vue

@@ -1,12 +1,11 @@
 <template>
   <div class="page-header-index-wide page-header-wrapper-grid-content-main">
-
     <a-row :gutter="24">
       <a-col :md="24" :lg="7">
         <a-card :bordered="false">
           <div class="account-center-avatarHolder">
             <div class="avatar">
-              <img :src="avatar()"/>
+              <img :src="avatar()">
             </div>
             <div class="username">{{ nickname() }}</div>
             <div class="bio">海纳百川,有容乃大</div>
@@ -19,21 +18,30 @@
               <i class="group"></i>蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED
             </p>
             <p>
-              <i class="address"></i><span>浙江省</span><span>杭州市</span>
+              <i class="address"></i>
+              <span>浙江省</span>
+              <span>杭州市</span>
             </p>
           </div>
-          <a-divider />
+          <a-divider/>
 
           <div class="account-center-tags">
             <div class="tagsTitle">标签</div>
             <div>
               <template v-for="(tag, index) in tags">
                 <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
-                  <a-tag :key="tag" :closable="index !== 0" :afterClose="() => handleTagClose(tag)">
-                    {{ `${tag.slice(0, 20)}...` }}
-                  </a-tag>
+                  <a-tag
+                    :key="tag"
+                    :closable="index !== 0"
+                    :afterClose="() => handleTagClose(tag)"
+                  >{{ `${tag.slice(0, 20)}...` }}</a-tag>
                 </a-tooltip>
-                <a-tag v-else :key="tag" :closable="index !== 0" :afterClose="() => handleTagClose(tag)">{{ tag }}</a-tag>
+                <a-tag
+                  v-else
+                  :key="tag"
+                  :closable="index !== 0"
+                  :afterClose="() => handleTagClose(tag)"
+                >{{ tag }}</a-tag>
               </template>
               <a-input
                 v-if="tagInputVisible"
@@ -47,11 +55,11 @@
                 @keyup.enter="handleTagInputConfirm"
               />
               <a-tag v-else @click="showTagInput" style="background: #fff; borderStyle: dashed;">
-                <a-icon type="plus" /> New Tag
+                <a-icon type="plus"/>New Tag
               </a-tag>
             </div>
           </div>
-          <a-divider :dashed="true" />
+          <a-divider :dashed="true"/>
 
           <div class="account-center-team">
             <div class="teamTitle">团队</div>
@@ -60,7 +68,7 @@
                 <a-row>
                   <a-col :span="12" v-for="(item, index) in teams" :key="index">
                     <a>
-                      <a-avatar size="small" :src="item.avatar" />
+                      <a-avatar size="small" :src="item.avatar"/>
                       <span class="member">{{ item.name }}</span>
                     </a>
                   </a-col>
@@ -84,202 +92,198 @@
         </a-card>
       </a-col>
     </a-row>
-
-
   </div>
 </template>
 
 <script>
-  import PageLayout from '@/components/page/PageLayout'
-  import RouteView from "@/components/layouts/RouteView"
-  import { AppPage, ArticlePage, ProjectPage } from './page'
-
-
-  import { mapGetters } from 'vuex'
-
-  export default {
-    components: {
-      RouteView,
-      PageLayout,
-      AppPage,
-      ArticlePage,
-      ProjectPage
+import PageLayout from '@/components/page/PageLayout'
+import RouteView from '@/components/layouts/RouteView'
+import { AppPage, ArticlePage, ProjectPage } from './page'
+
+import { mapGetters } from 'vuex'
+
+export default {
+  components: {
+    RouteView,
+    PageLayout,
+    AppPage,
+    ArticlePage,
+    ProjectPage
+  },
+  data() {
+    return {
+      tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
+
+      tagInputVisible: false,
+      tagInputValue: '',
+
+      teams: [],
+      teamSpinning: true,
+
+      tabListNoTitle: [
+        {
+          key: 'article',
+          tab: '文章(8)'
+        },
+        {
+          key: 'app',
+          tab: '应用(8)'
+        },
+        {
+          key: 'project',
+          tab: '项目(8)'
+        }
+      ],
+      noTitleKey: 'app'
+    }
+  },
+  mounted() {
+    this.getTeams()
+  },
+  methods: {
+    ...mapGetters(['nickname', 'avatar']),
+
+    getTeams() {
+      this.$http.get('/workplace/teams').then(res => {
+        this.teams = res.result
+        this.teamSpinning = false
+      })
     },
-    data() {
-      return {
-        tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
-
-        tagInputVisible: false,
-        tagInputValue: '',
-
-        teams: [],
-        teamSpinning: true,
 
-        tabListNoTitle: [{
-            key: 'article',
-            tab: '文章(8)',
-          }, {
-            key: 'app',
-            tab: '应用(8)',
-          }, {
-            key: 'project',
-            tab: '项目(8)',
-          }
-        ],
-        noTitleKey: 'app',
-      }
-    },
-    mounted () {
-      this.getTeams()
+    handleTabChange(key, type) {
+      this[type] = key
     },
-    methods: {
-      ...mapGetters(["nickname", "avatar"]),
 
-      getTeams() {
-        this.$http.get('/workplace/teams')
-          .then(res => {
-            this.teams = res.result
-            this.teamSpinning = false
-          })
-      },
-
-      handleTabChange (key, type) {
-        this[type] = key
-      },
-
-      handleTagClose (removeTag) {
-        const tags = this.tags.filter(tag => tag != removeTag)
-        this.tags = tags
-      },
-
-      showTagInput () {
-        this.tagInputVisible = true
-        this.$nextTick(() => {
-          this.$refs.tagInput.focus()
-        })
-      },
+    handleTagClose(removeTag) {
+      const tags = this.tags.filter(tag => tag != removeTag)
+      this.tags = tags
+    },
 
-      handleInputChange (e) {
-        this.tagInputValue = e.target.value
-      },
+    showTagInput() {
+      this.tagInputVisible = true
+      this.$nextTick(() => {
+        this.$refs.tagInput.focus()
+      })
+    },
 
-      handleTagInputConfirm () {
-        const inputValue = this.tagInputValue
-        let tags = this.tags
-        if (inputValue && tags.indexOf(inputValue) === -1) {
-          tags = [...tags, inputValue]
-        }
+    handleInputChange(e) {
+      this.tagInputValue = e.target.value
+    },
 
-        Object.assign(this, {
-          tags,
-          tagInputVisible: false,
-          tagInputValue: ''
-        })
+    handleTagInputConfirm() {
+      const inputValue = this.tagInputValue
+      let tags = this.tags
+      if (inputValue && !tags.includes(inputValue)) {
+        tags = [...tags, inputValue]
       }
-    },
+
+      Object.assign(this, {
+        tags,
+        tagInputVisible: false,
+        tagInputValue: ''
+      })
+    }
   }
+}
 </script>
 
 <style lang="scss" scoped>
-  .page-header-wrapper-grid-content-main {
-    width: 100%;
-    height: 100%;
-    min-height: 100%;
-    transition: .3s;
-
-    .account-center-avatarHolder {
-      text-align: center;
-      margin-bottom: 24px;
-
-      & > .avatar {
-        margin: 0 auto;
-        width: 104px;
-        height: 104px;
-        margin-bottom: 20px;
-        border-radius: 50%;
-        overflow: hidden;
-        img {
-          height: 100%;
-          width: 100%;
-        }
-      }
-
-      .username {
-        color: rgba(0, 0, 0, 0.85);
-        font-size: 20px;
-        line-height: 28px;
-        font-weight: 500;
-        margin-bottom: 4px;
+.page-header-wrapper-grid-content-main {
+  width: 100%;
+  height: 100%;
+  min-height: 100%;
+  transition: 0.3s;
+
+  .account-center-avatarHolder {
+    text-align: center;
+    margin-bottom: 24px;
+
+    & > .avatar {
+      margin: 0 auto;
+      width: 104px;
+      height: 104px;
+      margin-bottom: 20px;
+      border-radius: 50%;
+      overflow: hidden;
+      img {
+        height: 100%;
+        width: 100%;
       }
     }
 
-    .account-center-detail {
-
-      p {
-        margin-bottom: 8px;
-        padding-left: 26px;
-        position: relative;
-      }
+    .username {
+      color: rgba(0, 0, 0, 0.85);
+      font-size: 20px;
+      line-height: 28px;
+      font-weight: 500;
+      margin-bottom: 4px;
+    }
+  }
 
-      i {
-        position: absolute;
-        height: 14px;
-        width: 14px;
-        left: 0;
-        top: 4px;
-        background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg)
-      }
+  .account-center-detail {
+    p {
+      margin-bottom: 8px;
+      padding-left: 26px;
+      position: relative;
+    }
 
-      .title {
-        background-position: 0 0;
-      }
-      .group {
-        background-position: 0 -22px;
-      }
-      .address {
-        background-position: 0 -44px;
-      }
+    i {
+      position: absolute;
+      height: 14px;
+      width: 14px;
+      left: 0;
+      top: 4px;
+      background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg);
     }
 
-    .account-center-tags {
-      .ant-tag {
-        margin-bottom: 8px;
-      }
+    .title {
+      background-position: 0 0;
+    }
+    .group {
+      background-position: 0 -22px;
     }
+    .address {
+      background-position: 0 -44px;
+    }
+  }
 
-    .account-center-team {
+  .account-center-tags {
+    .ant-tag {
+      margin-bottom: 8px;
+    }
+  }
 
-      .members {
-        a {
-          display: block;
-          margin: 12px 0;
+  .account-center-team {
+    .members {
+      a {
+        display: block;
+        margin: 12px 0;
+        line-height: 24px;
+        height: 24px;
+        .member {
+          font-size: 14px;
+          color: rgba(0, 0, 0, 0.65);
           line-height: 24px;
-          height: 24px;
-          .member {
-            font-size: 14px;
-            color: rgba(0, 0, 0, .65);
-            line-height: 24px;
-            max-width: 100px;
-            vertical-align: top;
-            margin-left: 12px;
-            transition: all 0.3s;
-            display: inline-block;
-          }
-          &:hover {
-            span {
-              color: #1890ff;
-            }
+          max-width: 100px;
+          vertical-align: top;
+          margin-left: 12px;
+          transition: all 0.3s;
+          display: inline-block;
+        }
+        &:hover {
+          span {
+            color: #1890ff;
           }
         }
       }
     }
-
-    .tagsTitle, .teamTitle {
-      font-weight: 500;
-      color: rgba(0,0,0,.85);
-      margin-bottom: 12px;
-    }
-
   }
 
+  .tagsTitle,
+  .teamTitle {
+    font-weight: 500;
+    color: rgba(0, 0, 0, 0.85);
+    margin-bottom: 12px;
+  }
+}
 </style>

+ 1 - 1
src/views/account/center/page/App.vue

@@ -69,7 +69,7 @@
   }
 
   export default {
-    name: "Article",
+    name: 'Article',
     components: {},
     data() {
       return {

+ 1 - 1
src/views/account/center/page/Article.vue

@@ -11,7 +11,7 @@
   import AListItem from 'ant-design-vue/es/list/Item'
 
   export default {
-    name: "Article",
+    name: 'Article',
     components: {
       AList,
       AListItem

+ 1 - 1
src/views/account/center/page/Project.vue

@@ -8,7 +8,7 @@
 
 <script>
   export default {
-    name: "Project"
+    name: 'Project'
   }
 </script>
 

+ 8 - 8
src/views/account/settings/AvatarModal.vue

@@ -48,21 +48,21 @@
           fixedBox: true
         },
         previews: {},
-      };
+      }
     },
     methods: {
       edit(id) {
-        this.visible = true;
-        this.id = id;
+        this.visible = true
+        this.id = id
         /* 获取原始头像 */
 
       },
       close() {
-        this.id = null;
-        this.visible = false;
+        this.id = null
+        this.visible = false
       },
       cancelHandel() {
-        this.close();
+        this.close()
       },
       okHandel() {
         const vm = this
@@ -71,7 +71,7 @@
         setTimeout(() => {
           vm.confirmLoading = false
           vm.close()
-          vm.$message.success('上传头像成功');
+          vm.$message.success('上传头像成功')
         }, 2000)
 
       },
@@ -80,7 +80,7 @@
         this.previews = data
       }
     }
-  };
+  }
 </script>
 
 <style lang="scss" scoped>

+ 2 - 2
src/views/account/settings/Custom.vue

@@ -1,8 +1,8 @@
 <script>
   import { colorList } from '@/components/tools/setting'
   import ASwitch from 'ant-design-vue/es/switch'
-  import AList from "ant-design-vue/es/list"
-  import AListItem from "ant-design-vue/es/list/Item"
+  import AList from 'ant-design-vue/es/list'
+  import AListItem from 'ant-design-vue/es/list/Item'
   import { mixin } from '@/utils/mixin.js'
 
   const Meta = AListItem.Meta

+ 2 - 2
src/views/account/settings/Index.vue

@@ -50,7 +50,7 @@
 
 <script>
   import PageLayout from '@/components/page/PageLayout'
-  import RouteView from "@/components/layouts/RouteView"
+  import RouteView from '@/components/layouts/RouteView'
   import { mixinDevice } from '@/utils/mixin.js'
 
   export default {
@@ -96,7 +96,7 @@
         this.openKeys = openKeys
       },
       updateMenu () {
-        let routes = this.$route.matched.concat()
+        const routes = this.$route.matched.concat()
         this.defaultSelectedKeys = [ routes.pop().path ]
       }
     },

+ 5 - 5
src/views/account/settings/Security.vue

@@ -25,11 +25,11 @@
     data () {
       return {
         data: [
-          { title: '账户密码' , description: '当前密码强度', value: '强', actions: { title: '修改', callback: () => { this.$message.info('This is a normal message'); } } },
-          { title: '密保手机' , description: '已绑定手机', value: '138****8293', actions: { title: '修改', callback: () => { this.$message.success('This is a message of success'); } }  },
-          { title: '密保问题' , description: '未设置密保问题,密保问题可有效保护账户安全', value: '', actions: { title: '设置', callback: () => { this.$message.error('This is a message of error'); } }  },
-          { title: '备用邮箱' , description: '已绑定邮箱', value: 'ant***sign.com', actions: { title: '修改', callback: () => { this.$message.warning('This is message of warning'); } }  },
-          { title: 'MFA 设备' , description: '未绑定 MFA 设备,绑定后,可以进行二次确认', value: '', actions: { title: '绑定', callback: () => { this.$message.info('This is a normal message'); } }  },
+          { title: '账户密码' , description: '当前密码强度', value: '强', actions: { title: '修改', callback: () => { this.$message.info('This is a normal message') } } },
+          { title: '密保手机' , description: '已绑定手机', value: '138****8293', actions: { title: '修改', callback: () => { this.$message.success('This is a message of success') } }  },
+          { title: '密保问题' , description: '未设置密保问题,密保问题可有效保护账户安全', value: '', actions: { title: '设置', callback: () => { this.$message.error('This is a message of error') } }  },
+          { title: '备用邮箱' , description: '已绑定邮箱', value: 'ant***sign.com', actions: { title: '修改', callback: () => { this.$message.warning('This is message of warning') } }  },
+          { title: 'MFA 设备' , description: '未绑定 MFA 设备,绑定后,可以进行二次确认', value: '', actions: { title: '绑定', callback: () => { this.$message.info('This is a normal message') } }  },
         ]
       }
     }

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

@@ -146,8 +146,8 @@
 
 <script>
   import ChartCard from '@/components/ChartCard'
-  import ACol from "ant-design-vue/es/grid/Col"
-  import ATooltip from "ant-design-vue/es/tooltip/Tooltip"
+  import ACol from 'ant-design-vue/es/grid/Col'
+  import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
   import MiniArea from '@/components/chart/MiniArea'
   import MiniBar from '@/components/chart/MiniBar'
   import MiniProgress from '@/components/chart/MiniProgress'
@@ -164,7 +164,7 @@
   }
 
   export default {
-    name: "Analysis",
+    name: 'Analysis',
     components: {
       ATooltip,
       ACol,

+ 1 - 1
src/views/dashboard/Monitor.vue

@@ -6,7 +6,7 @@
 
 <script>
   export default {
-    name: "Monitor"
+    name: 'Monitor'
   }
 </script>
 

+ 5 - 5
src/views/dashboard/Workplace.vue

@@ -110,19 +110,19 @@
 </template>
 
 <script>
-  import { timeFix } from "@/utils/util"
-  import {mapGetters} from "vuex"
+  import { timeFix } from '@/utils/util'
+  import {mapGetters} from 'vuex'
 
   import PageLayout from '@/components/page/PageLayout'
   import HeadInfo from '@/components/tools/HeadInfo'
   import Radar from '@/components/chart/Radar'
 
-  import { getRoleList, getServiceList } from "@/api/manage"
+  import { getRoleList, getServiceList } from '@/api/manage'
 
   const DataSet = require('@antv/data-set')
 
   export default {
-    name: "Workplace",
+    name: 'Workplace',
     components: {
       PageLayout,
       HeadInfo,
@@ -203,7 +203,7 @@
       this.initRadar()
     },
     methods: {
-      ...mapGetters(["nickname", "welcome"]),
+      ...mapGetters(['nickname', 'welcome']),
       getProjects() {
         this.$http.get('/list/search/projects')
           .then(res => {

+ 1 - 1
src/views/exception/ExceptionPage.vue

@@ -17,7 +17,7 @@
   import types from './type'
 
   export default {
-    name: "Exception",
+    name: 'Exception',
     props: {
       type: {
         type: String,

+ 4 - 4
src/views/form/advancedForm/AdvancedForm.vue

@@ -67,7 +67,7 @@
   import FooterToolBar from '@/components/tools/FooterToolBar'
 
   export default {
-    name: "AdvancedForm",
+    name: 'AdvancedForm',
     components: {
       FooterToolBar,
       RepositoryForm,
@@ -151,12 +151,12 @@
         this.data = newData
       },
       saveRow (key) {
-        let target = this.data.filter(item => item.key === key)[0]
+        const target = this.data.filter(item => item.key === key)[0]
         target.editable = false
         target.isNew = false
       },
       toggle (key) {
-        let target = this.data.filter(item => item.key === key)[0]
+        const target = this.data.filter(item => item.key === key)[0]
         target.editable = !target.editable
       },
       getRowByKey (key, newData) {
@@ -164,7 +164,7 @@
         return (newData || data).filter(item => item.key === key)[0]
       },
       cancel (key) {
-        let target = this.data.filter(item => item.key === key)[0]
+        const target = this.data.filter(item => item.key === key)[0]
         target.editable = false
       },
       handleChange (value, key, column) {

+ 1 - 1
src/views/form/advancedForm/RepositoryForm.vue

@@ -79,7 +79,7 @@
 
 <script>
   export default {
-    name: "RepositoryForm",
+    name: 'RepositoryForm',
     props: {
       showSubmit: {
         type: Boolean,

+ 1 - 1
src/views/form/advancedForm/TaskForm.vue

@@ -74,7 +74,7 @@
 
 <script>
   export default {
-    name: "TaskForm",
+    name: 'TaskForm',
     props: {
       showSubmit: {
         type: Boolean,

+ 1 - 1
src/views/form/stepForm/Step1.vue

@@ -46,7 +46,7 @@
 
 <script>
   export default {
-    name: "Step1",
+    name: 'Step1',
     methods: {
       nextStep () {
         this.$emit('nextStep')

+ 2 - 2
src/views/form/stepForm/Step2.vue

@@ -48,7 +48,7 @@
 
 <script>
   export default {
-    name: "Step2",
+    name: 'Step2',
     data () {
       return {
         loading: false
@@ -56,7 +56,7 @@
     },
     methods: {
       nextStep () {
-        let that = this
+        const that = this
         that.loading = true
         setTimeout(function () {
           that.$emit('nextStep')

+ 1 - 1
src/views/form/stepForm/Step3.vue

@@ -33,7 +33,7 @@
   import Result from '../../result/Result'
 
   export default {
-    name: "Step3",
+    name: 'Step3',
     components: {
       Result
     },

+ 1 - 1
src/views/form/stepForm/StepForm.vue

@@ -19,7 +19,7 @@
   import Step3 from './Step3'
 
   export default {
-    name: "StepForm",
+    name: 'StepForm',
     components: {
       Step1,
       Step2,

+ 1 - 1
src/views/list/CardList.vue

@@ -43,7 +43,7 @@
 
 
   export default {
-    name: "CardList",
+    name: 'CardList',
     data () {
       return {
         description: '段落示意:蚂蚁金服务设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态, 提供跨越设计与开发的体验解决方案。',

+ 2 - 2
src/views/list/PermissionList.vue

@@ -137,7 +137,7 @@
   import STable from '@/components/table/'
 
   export default {
-    name: "TableList",
+    name: 'TableList',
     components: {
       STable
     },
@@ -195,7 +195,7 @@
           return this.$http.get('/permission', {
             params: Object.assign(parameter, this.queryParam)
           }).then(res => {
-            let result = res.result
+            const result = res.result
             result.data.map(permission => {
                 permission.actionList = JSON.parse(permission.actionData)
                 return permission

+ 1 - 1
src/views/list/RoleList.vue

@@ -83,7 +83,7 @@
   import RoleModal from './modules/RoleModal'
 
   export default {
-    name: "TableList",
+    name: 'TableList',
     components: {
       STable,
       RoleModal

+ 1 - 1
src/views/list/StandardList.vue

@@ -127,7 +127,7 @@
   })
 
   export default {
-    name: "StandardList",
+    name: 'StandardList',
     components: {
       HeadInfo
     },

+ 6 - 6
src/views/list/TableInnerEditList.vue

@@ -119,7 +119,7 @@
   import STable from '@/components/table/'
 
   export default {
-    name: "TableList",
+    name: 'TableList',
     components: {
       STable
     },
@@ -203,16 +203,16 @@
           okType: 'danger',
           cancelText: '取消',
           onOk() {
-            console.log('OK');
+            console.log('OK')
             // 在这里调用删除接口
             return new Promise((resolve, reject) => {
-              setTimeout(Math.random() > 0.5 ? resolve : reject, 1000);
-            }).catch(() => console.log('Oops errors!'));
+              setTimeout(Math.random() > 0.5 ? resolve : reject, 1000)
+            }).catch(() => console.log('Oops errors!'))
           },
           onCancel() {
-            console.log('Cancel');
+            console.log('Cancel')
           },
-        });
+        })
       },
       save (row) {
         delete row.editable

+ 4 - 4
src/views/list/TableList.vue

@@ -182,14 +182,14 @@
 
 <script>
   import STable from '@/components/table/'
-  import ATextarea from "ant-design-vue/es/input/TextArea"
-  import AInput from "ant-design-vue/es/input/Input"
-  import moment from "moment"
+  import ATextarea from 'ant-design-vue/es/input/TextArea'
+  import AInput from 'ant-design-vue/es/input/Input'
+  import moment from 'moment'
 
   import { getRoleList, getServiceList } from '@/api/manage'
 
   export default {
-    name: "TableList",
+    name: 'TableList',
     components: {
       AInput,
       ATextarea,

+ 1 - 1
src/views/list/UserList.vue

@@ -153,7 +153,7 @@
   import { getRoleList, getServiceList } from '@/api/manage'
 
   export default {
-    name: "TableList",
+    name: 'TableList',
     components: {
       STable
     },

+ 2 - 2
src/views/list/modules/RoleModal.vue

@@ -83,7 +83,7 @@
   import pick from 'lodash.pick'
 
   export default {
-    name: "RoleModal",
+    name: 'RoleModal',
     data () {
       return {
         labelCol: {
@@ -177,7 +177,7 @@
       },
       loadPermissions () {
         getPermissions().then(res => {
-          let result = res.result
+          const result = res.result
           this.permissions = result.map(permission => {
             const options = actionToObject(permission.actionData)
             permission.checkedAll = false

+ 1 - 1
src/views/list/search/SearchLayout.vue

@@ -6,7 +6,7 @@
 
 <script>
   export default {
-    name: "SearchLayout",
+    name: 'SearchLayout',
     data () {
       return {
         tabs: {

+ 1 - 1
src/views/profile/advanced/Advanced.vue

@@ -140,7 +140,7 @@
   const DetailListItem = DetailList.Item
 
   export default {
-    name: "Advanced",
+    name: 'Advanced',
     components: {
       PageLayout,
       DetailList,

+ 1 - 1
src/views/profile/basic/Index.vue

@@ -46,7 +46,7 @@
   import PageLayout from '@/components/page/PageLayout'
   import STable from '@/components/table/'
   import DetailList from '@/components/tools/DetailList'
-  import ABadge from "ant-design-vue/es/badge/Badge"
+  import ABadge from 'ant-design-vue/es/badge/Badge'
   const DetailListItem = DetailList.Item
 
   export default {

+ 2 - 2
src/views/result/Error.vue

@@ -1,6 +1,6 @@
 <template>
   <a-card :bordered="false">
-    <result style="margin-bottom: 16px; margin-top: 48px" :is-success="false" :title="title" :description="description">
+    <result :is-success="false" :title="title" :description="description">
       <template slot="action">
         <a-button type="primary" >返回修改</a-button>
       </template>
@@ -27,7 +27,7 @@
   import Result from './Result'
 
   export default {
-    name: "Error",
+    name: 'Error',
     components: {
       Result
     },

+ 1 - 1
src/views/result/Result.vue

@@ -16,7 +16,7 @@
 
 <script>
   export default {
-    name: "Result",
+    name: 'Result',
     // 'isSuccess', 'title', 'description'
     props: {
       isSuccess: {

+ 1 - 1
src/views/result/Success.vue

@@ -69,7 +69,7 @@
   }
 
   export default {
-    name: "Success",
+    name: 'Success',
     components: {
       Result
     },

+ 219 - 200
src/views/user/Login.vue

@@ -1,35 +1,42 @@
 <template>
   <div class="main">
-    <a-form class="user-layout-login" ref="formLogin" :autoFormCreate="(form)=>{this.form = form}" id="formLogin">
+    <a-form
+      class="user-layout-login"
+      ref="formLogin"
+      :autoFormCreate="(form)=>{this.form = form}"
+      id="formLogin"
+    >
       <a-tabs
         :activeKey="customActiveKey"
         :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
-        @change="handleTabClick">
+        @change="handleTabClick"
+      >
         <a-tab-pane key="tab1" tab="账号密码登陆">
-
           <a-form-item
             fieldDecoratorId="username"
             :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入帐户名或邮箱地址' }, { validator: this.handleUsernameOrEmail }], validateTrigger: 'change'}"
           >
             <a-input size="large" type="text" placeholder="帐户名或邮箱地址 / admin">
-              <a-icon slot="prefix" type='user' :style="{ color: 'rgba(0,0,0,.25)' }"/>
+              <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
             </a-input>
           </a-form-item>
 
           <a-form-item
             fieldDecoratorId="password"
-            :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur'}">
+            :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur'}"
+          >
             <a-input size="large" type="password" autocomplete="false" placeholder="密码 / admin">
-              <a-icon slot="prefix" type='lock' :style="{ color: 'rgba(0,0,0,.25)' }"/>
+              <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
             </a-input>
           </a-form-item>
         </a-tab-pane>
         <a-tab-pane key="tab2" tab="手机号登陆">
           <a-form-item
             fieldDecoratorId="mobile"
-            :fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: '请输入正确的手机号' }], validateTrigger: 'change'}">
+            :fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: '请输入正确的手机号' }], validateTrigger: 'change'}"
+          >
             <a-input size="large" type="text" placeholder="手机号">
-              <a-icon slot="prefix" type='mobile' :style="{ color: 'rgba(0,0,0,.25)' }"/>
+              <a-icon slot="prefix" type="mobile" :style="{ color: 'rgba(0,0,0,.25)' }"/>
             </a-input>
           </a-form-item>
 
@@ -37,9 +44,10 @@
             <a-col class="gutter-row" :span="16">
               <a-form-item
                 fieldDecoratorId="captcha"
-                :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}">
+                :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}"
+              >
                 <a-input size="large" type="text" placeholder="验证码">
-                  <a-icon slot="prefix" type='mail' :style="{ color: 'rgba(0,0,0,.25)' }"/>
+                  <a-icon slot="prefix" type="mail" :style="{ color: 'rgba(0,0,0,.25)' }"/>
                 </a-input>
               </a-form-item>
             </a-col>
@@ -49,7 +57,8 @@
                 tabindex="-1"
                 :disabled="state.smsSendBtn"
                 @click.stop.prevent="getCaptcha"
-                v-text="!state.smsSendBtn && '获取验证码' || (state.time+' s')"></a-button>
+                v-text="!state.smsSendBtn && '获取验证码' || (state.time+' s')"
+              ></a-button>
             </a-col>
           </a-row>
         </a-tab-pane>
@@ -57,9 +66,11 @@
 
       <a-form-item>
         <a-checkbox v-model="formLogin.rememberMe">自动登陆</a-checkbox>
-        <router-link :to="{ name: 'recover', params: { user: 'aaa'} }" class="forge-password" style="float: right;">
-          忘记密码
-        </router-link>
+        <router-link
+          :to="{ name: 'recover', params: { user: 'aaa'} }"
+          class="forge-password"
+          style="float: right;"
+        >忘记密码</router-link>
       </a-form-item>
 
       <a-form-item style="margin-top:24px">
@@ -70,18 +81,22 @@
           class="login-button"
           :loading="loginBtn"
           @click.stop.prevent="handleSubmit"
-          :disabled="loginBtn">确定
-        </a-button>
+          :disabled="loginBtn"
+        >确定</a-button>
       </a-form-item>
 
       <div class="user-login-other">
         <span>其他登陆方式</span>
-        <a><a-icon class="item-icon" type="alipay-circle"></a-icon></a>
-        <a><a-icon class="item-icon" type="taobao-circle"></a-icon></a>
-        <a><a-icon class="item-icon" type="weibo-circle"></a-icon></a>
-        <router-link class="register" :to="{ name: 'register' }">
-          注册账户
-        </router-link>
+        <a>
+          <a-icon class="item-icon" type="alipay-circle"></a-icon>
+        </a>
+        <a>
+          <a-icon class="item-icon" type="taobao-circle"></a-icon>
+        </a>
+        <a>
+          <a-icon class="item-icon" type="weibo-circle"></a-icon>
+        </a>
+        <router-link class="register" :to="{ name: 'register' }">注册账户</router-link>
       </div>
     </a-form>
 
@@ -89,221 +104,225 @@
       v-if="requiredTwoStepCaptcha"
       :visible="stepCaptchaVisible"
       @success="stepCaptchaSuccess"
-      @cancel="stepCaptchaCancel"></two-step-captcha>
+      @cancel="stepCaptchaCancel"
+    ></two-step-captcha>
   </div>
 </template>
 
 <script>
-  import md5 from "md5"
-  import api from '@/api'
-  import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
-  import { mapActions } from "vuex"
-  import { timeFix } from "@/utils/util"
+import md5 from 'md5'
+import api from '@/api'
+import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
+import { mapActions } from 'vuex'
+import { timeFix } from '@/utils/util'
 
-  export default {
-    components: {
-      TwoStepCaptcha
-    },
-    data () {
-      return {
-        customActiveKey: "tab1",
-        loginBtn: false,
-        // login type: 0 email, 1 username, 2 telephone
-        loginType: 0,
-        requiredTwoStepCaptcha: false,
-        stepCaptchaVisible: false,
-        form: null,
-        state: {
-          time: 60,
-          smsSendBtn: false,
-        },
-        formLogin: {
-          username: "",
-          password: "",
-          captcha: "",
-          mobile: "",
-          rememberMe: true
-        },
+export default {
+  components: {
+    TwoStepCaptcha
+  },
+  data() {
+    return {
+      customActiveKey: 'tab1',
+      loginBtn: false,
+      // login type: 0 email, 1 username, 2 telephone
+      loginType: 0,
+      requiredTwoStepCaptcha: false,
+      stepCaptchaVisible: false,
+      form: null,
+      state: {
+        time: 60,
+        smsSendBtn: false
+      },
+      formLogin: {
+        username: '',
+        password: '',
+        captcha: '',
+        mobile: '',
+        rememberMe: true
+      }
+    }
+  },
+  created() {
+    this.$http
+      .get('/auth/2step-code')
+      .then(res => {
+        this.requiredTwoStepCaptcha = res.result.stepCode
+      })
+      .catch(err => {
+        console.log('2step-code:', err)
+      })
+    // this.requiredTwoStepCaptcha = true
+  },
+  methods: {
+    ...mapActions(['Login', 'Logout']),
+    // handler
+    handleUsernameOrEmail(rule, value, callback) {
+      const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
+      if (regex.test(value)) {
+        this.loginType = 0
+      } else {
+        this.loginType = 1
       }
+      callback()
     },
-    created () {
-      this.$http.get('/auth/2step-code')
-        .then(res => {
-          this.requiredTwoStepCaptcha = res.result.stepCode
-        }).catch(err => {
-          console.log('2step-code:', err)
-        })
-     // this.requiredTwoStepCaptcha = true
-      
+    handleTabClick(key) {
+      this.customActiveKey = key
+      // this.form.resetFields()
     },
-    methods: {
-      ...mapActions([ "Login", "Logout" ]),
-      // handler
-      handleUsernameOrEmail (rule, value, callback) {
-        const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
-        if (regex.test(value)) {
-          this.loginType = 0
-        } else {
-          this.loginType = 1
-        }
-        callback()
-      },
-      handleTabClick (key) {
-        this.customActiveKey = key
-        // this.form.resetFields()
-      },
-      handleSubmit () {
-        let that = this
-        let flag = false
+    handleSubmit() {
+      const that = this
+      let flag = false
 
-        let loginParams = {
-          remember_me: that.formLogin.rememberMe
-        };
+      let loginParams = {
+        remember_me: that.formLogin.rememberMe
+      }
 
-        // 使用账户密码登陆
-        if (that.customActiveKey === 'tab1') {
-          that.form.validateFields([ 'username', 'password' ], { force: true }, (err, values) => {
-            if (!err) {
-              flag = true
-              loginParams[!that.loginType ? 'email' : 'username'] = values.username
-              loginParams.password = md5(values.password)
-            }
-          })
+      // 使用账户密码登陆
+      if (that.customActiveKey === 'tab1') {
+        that.form.validateFields(['username', 'password'], { force: true }, (err, values) => {
+          if (!err) {
+            flag = true
+            loginParams[!that.loginType ? 'email' : 'username'] = values.username
+            loginParams.password = md5(values.password)
+          }
+        })
         // 使用手机号登陆
-        } else {
-          that.form.validateFields([ 'mobile', 'captcha' ], { force: true }, (err, values) => {
-            if (!err) {
-              flag = true
-              loginParams = Object.assign(loginParams, values)
-            }
-          })
-        }
+      } else {
+        that.form.validateFields(['mobile', 'captcha'], { force: true }, (err, values) => {
+          if (!err) {
+            flag = true
+            loginParams = Object.assign(loginParams, values)
+          }
+        })
+      }
 
-        if (!flag) return
+      if (!flag) return
 
-        that.loginBtn = true
+      that.loginBtn = true
 
-        that.Login(loginParams).then(() => {
+      that
+        .Login(loginParams)
+        .then(() => {
           if (that.requiredTwoStepCaptcha) {
             that.stepCaptchaVisible = true
           } else {
             that.loginSuccess()
           }
-        }).catch((err) => {
-          that.requestFailed(err);
         })
+        .catch(err => {
+          that.requestFailed(err)
+        })
+    },
+    getCaptcha(e) {
+      e.preventDefault()
+      const that = this
 
-      },
-      getCaptcha (e) {
-        e.preventDefault()
-        let that = this
-
-        this.form.validateFields([ 'mobile' ], { force: true },
-          (err) => {
-            if (!err) {
-              this.state.smsSendBtn = true;
-
-              let interval = window.setInterval(() => {
-                if (that.state.time-- <= 0) {
-                  that.state.time = 60;
-                  that.state.smsSendBtn = false;
-                  window.clearInterval(interval);
-                }
-              }, 1000);
+      this.form.validateFields(['mobile'], { force: true }, err => {
+        if (!err) {
+          this.state.smsSendBtn = true
 
-              const hide = this.$message.loading('验证码发送中..', 0);
-              this.$http.post(api.SendSms, { mobile: that.formLogin.mobile })
-                .then(res => {
-                  setTimeout(hide, 2500);
-                  this.$notification[ 'success' ]({
-                    message: '提示',
-                    description: '验证码获取成功,您的验证码为:' + res.result.captcha,
-                    duration: 8
-                  })
-                })
-                .catch(err => {
-                  setTimeout(hide, 1);
-                  clearInterval(interval);
-                  that.state.time = 60;
-                  that.state.smsSendBtn = false;
-                  this.requestFailed(err);
-                });
+          const interval = window.setInterval(() => {
+            if (that.state.time-- <= 0) {
+              that.state.time = 60
+              that.state.smsSendBtn = false
+              window.clearInterval(interval)
             }
-          }
-        );
-      },
-      stepCaptchaSuccess () {
-        this.loginSuccess()
-      },
-      stepCaptchaCancel () {
-        this.Logout().then(() => {
-          this.loginBtn = false
-          this.stepCaptchaVisible = false
-        })
-      },
-      loginSuccess () {
+          }, 1000)
+
+          const hide = this.$message.loading('验证码发送中..', 0)
+          this.$http
+            .post(api.SendSms, { mobile: that.formLogin.mobile })
+            .then(res => {
+              setTimeout(hide, 2500)
+              this.$notification['success']({
+                message: '提示',
+                description: '验证码获取成功,您的验证码为:' + res.result.captcha,
+                duration: 8
+              })
+            })
+            .catch(err => {
+              setTimeout(hide, 1)
+              clearInterval(interval)
+              that.state.time = 60
+              that.state.smsSendBtn = false
+              this.requestFailed(err)
+            })
+        }
+      })
+    },
+    stepCaptchaSuccess() {
+      this.loginSuccess()
+    },
+    stepCaptchaCancel() {
+      this.Logout().then(() => {
         this.loginBtn = false
-        this.$router.push({ name: "dashboard" })
-        this.$message.success(timeFix() + ',欢迎回来', 3)
-      },
-      requestFailed (err) {
-        this.$notification[ 'error' ]({
-          message: '错误',
-          description: ((err.response || {}).data || {}).message || "请求出现错误,请稍后再试",
-          duration: 4,
-        });
-        this.loginBtn = false;
-      },
+        this.stepCaptchaVisible = false
+      })
+    },
+    loginSuccess() {
+      this.loginBtn = false
+      this.$router.push({ name: 'dashboard' })
+      this.$notification.success({
+        message: '欢迎',
+        description: `${timeFix()},欢迎回来`
+      })
+    },
+    requestFailed(err) {
+      this.$notification['error']({
+        message: '错误',
+        description: ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试',
+        duration: 4
+      })
+      this.loginBtn = false
     }
   }
+}
 </script>
 
 <style lang="scss" scoped>
+.user-layout-login {
+  label {
+    font-size: 14px;
+  }
 
-  .user-layout-login {
-    label {
-      font-size: 14px;
-    }
-
-    .getCaptcha {
-      display: block;
-      width: 100%;
-      height: 40px;
-    }
+  .getCaptcha {
+    display: block;
+    width: 100%;
+    height: 40px;
+  }
 
-    .forge-password {
-      font-size: 14px;
-    }
+  .forge-password {
+    font-size: 14px;
+  }
 
-    button.login-button {
-      padding: 0 15px;
-      font-size: 16px;
-      height: 40px;
-      width: 100%;
-    }
+  button.login-button {
+    padding: 0 15px;
+    font-size: 16px;
+    height: 40px;
+    width: 100%;
+  }
 
-    .user-login-other {
-      text-align: left;
-      margin-top: 24px;
-      line-height: 22px;
+  .user-login-other {
+    text-align: left;
+    margin-top: 24px;
+    line-height: 22px;
 
-      .item-icon {
-        font-size: 24px;
-        color: rgba(0,0,0,.2);
-        margin-left: 16px;
-        vertical-align: middle;
-        cursor: pointer;
-        transition: color .3s;
+    .item-icon {
+      font-size: 24px;
+      color: rgba(0, 0, 0, 0.2);
+      margin-left: 16px;
+      vertical-align: middle;
+      cursor: pointer;
+      transition: color 0.3s;
 
-        &:hover {
-          color: #1890ff;
-        }
+      &:hover {
+        color: #1890ff;
       }
+    }
 
-      .register {
-        float: right;
-      }
+    .register {
+      float: right;
     }
   }
-
+}
 </style>

+ 22 - 22
src/views/user/Register.vue

@@ -111,7 +111,7 @@
     3: '#52c41a',
   }
   export default {
-    name: "Register",
+    name: 'Register',
     components: {
     },
     mixins: [mixinDevice],
@@ -175,7 +175,7 @@
       },
 
       handlePasswordCheck (rule, value, callback) {
-        let password = this.form.getFieldValue('password')
+        const password = this.form.getFieldValue('password')
         console.log('value', value)
         if (value === undefined) {
           callback(new Error('请输入密码'))
@@ -197,7 +197,7 @@
       handlePasswordInputClick () {
         if (!this.isMobile()) {
           this.state.passwordLevelChecked = true
-          return;
+          return
         }
         this.state.passwordLevelChecked = false
       },
@@ -212,48 +212,48 @@
 
       getCaptcha(e) {
         e.preventDefault()
-        let that = this
+        const that = this
 
         this.form.validateFields(['mobile'], {force: true},
           (err, values) => {
             if (!err) {
-              this.state.smsSendBtn = true;
+              this.state.smsSendBtn = true
 
-              let interval = window.setInterval(() => {
+              const interval = window.setInterval(() => {
                 if (that.state.time-- <= 0) {
-                  that.state.time = 60;
-                  that.state.smsSendBtn = false;
-                  window.clearInterval(interval);
+                  that.state.time = 60
+                  that.state.smsSendBtn = false
+                  window.clearInterval(interval)
                 }
-              }, 1000);
+              }, 1000)
 
-              const hide = this.$message.loading('验证码发送中..', 0);
+              const hide = this.$message.loading('验证码发送中..', 0)
 
               getSmsCaptcha({mobile: values.mobile}).then(res => {
-                setTimeout(hide, 2500);
+                setTimeout(hide, 2500)
                 this.$notification['success']({
                   message: '提示',
                   description: '验证码获取成功,您的验证码为:' + res.result.captcha,
                   duration: 8
                 })
               }).catch(err => {
-                setTimeout(hide, 1);
-                clearInterval(interval);
-                that.state.time = 60;
-                that.state.smsSendBtn = false;
-                this.requestFailed(err);
-              });
+                setTimeout(hide, 1)
+                clearInterval(interval)
+                that.state.time = 60
+                that.state.smsSendBtn = false
+                this.requestFailed(err)
+              })
             }
           }
-        );
+        )
       },
       requestFailed(err) {
         this.$notification['error']({
           message: '错误',
-          description: ((err.response || {}).data || {}).message || "请求出现错误,请稍后再试",
+          description: ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试',
           duration: 4,
-        });
-        this.registerBtn = false;
+        })
+        this.registerBtn = false
       },
     },
     watch: {

+ 3 - 3
src/views/user/RegisterResult.vue

@@ -17,7 +17,7 @@
   import Result from '@/views/result/Result'
 
   export default {
-    name: "RegisterResult",
+    name: 'RegisterResult',
     components: {
       Result
     },
@@ -29,8 +29,8 @@
     },
     computed: {
       email () {
-        let v = this.form && this.form.email || 'xxx'
-        let title = `你的账户:${v} 注册成功`
+        const v = this.form && this.form.email || 'xxx'
+        const title = `你的账户:${v} 注册成功`
         return title
       }
     },