xieren преди 6 години
родител
ревизия
199464842c
променени са 22 файла, в които са добавени 999 реда и са изтрити 147 реда
  1. 20 2
      .eslintrc.js
  2. 170 60
      package-lock.json
  3. 6 0
      package.json
  4. 18 14
      public/index.html
  5. 341 0
      public/normalize.css
  6. 40 14
      src/App.vue
  7. 9 0
      src/common/api.js
  8. 16 0
      src/common/c.js
  9. 14 0
      src/common/config.js
  10. 120 0
      src/common/net.js
  11. 75 0
      src/common/utils.js
  12. 17 0
      src/components/Awards.vue
  13. 0 57
      src/components/HelloWorld.vue
  14. 17 0
      src/components/Matches.vue
  15. 17 0
      src/components/News.vue
  16. 17 0
      src/components/Ranks.vue
  17. 2 0
      src/main.js
  18. 39 0
      src/router.js
  19. 19 0
      src/views/Home.vue
  20. 19 0
      src/views/Index.vue
  21. 19 0
      src/views/My.vue
  22. 4 0
      vue.config.js

+ 20 - 2
.eslintrc.js

@@ -8,8 +8,26 @@ module.exports = {
     '@vue/standard'
   ],
   rules: {
-    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
-    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
+    'no-console': 'off',
+    'no-debugger': 'off',
+    'vue/attribute-hyphenation': [
+      'error',
+      'always'
+    ],
+    'vue/html-end-tags': 'error',
+    'vue/html-indent': [
+      'error',
+      4
+    ],
+    'vue/html-self-closing': 'error',
+    'vue/require-default-prop': 'error',
+    'vue/require-prop-types': 'error',
+    'vue/attributes-order': 'error',
+    'vue/html-quotes': [
+      'error',
+      'double'
+    ],
+    'vue/order-in-components': 'error'
   },
   parserOptions: {
     parser: 'babel-eslint'

+ 170 - 60
package-lock.json

@@ -946,6 +946,107 @@
         "eslint": "^4.19.1",
         "eslint-loader": "^2.0.0",
         "eslint-plugin-vue": "^4.5.0"
+      },
+      "dependencies": {
+        "ajv-keywords": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
+          "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
+          "dev": true
+        },
+        "cross-spawn": {
+          "version": "5.1.0",
+          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
+          "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+          "dev": true,
+          "requires": {
+            "lru-cache": "^4.0.1",
+            "shebang-command": "^1.2.0",
+            "which": "^1.2.9"
+          }
+        },
+        "eslint": {
+          "version": "4.19.1",
+          "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
+          "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==",
+          "dev": true,
+          "requires": {
+            "ajv": "^5.3.0",
+            "babel-code-frame": "^6.22.0",
+            "chalk": "^2.1.0",
+            "concat-stream": "^1.6.0",
+            "cross-spawn": "^5.1.0",
+            "debug": "^3.1.0",
+            "doctrine": "^2.1.0",
+            "eslint-scope": "^3.7.1",
+            "eslint-visitor-keys": "^1.0.0",
+            "espree": "^3.5.4",
+            "esquery": "^1.0.0",
+            "esutils": "^2.0.2",
+            "file-entry-cache": "^2.0.0",
+            "functional-red-black-tree": "^1.0.1",
+            "glob": "^7.1.2",
+            "globals": "^11.0.1",
+            "ignore": "^3.3.3",
+            "imurmurhash": "^0.1.4",
+            "inquirer": "^3.0.6",
+            "is-resolvable": "^1.0.0",
+            "js-yaml": "^3.9.1",
+            "json-stable-stringify-without-jsonify": "^1.0.1",
+            "levn": "^0.3.0",
+            "lodash": "^4.17.4",
+            "minimatch": "^3.0.2",
+            "mkdirp": "^0.5.1",
+            "natural-compare": "^1.4.0",
+            "optionator": "^0.8.2",
+            "path-is-inside": "^1.0.2",
+            "pluralize": "^7.0.0",
+            "progress": "^2.0.0",
+            "regexpp": "^1.0.1",
+            "require-uncached": "^1.0.3",
+            "semver": "^5.3.0",
+            "strip-ansi": "^4.0.0",
+            "strip-json-comments": "~2.0.1",
+            "table": "4.0.2",
+            "text-table": "~0.2.0"
+          }
+        },
+        "inquirer": {
+          "version": "3.3.0",
+          "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
+          "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
+          "dev": true,
+          "requires": {
+            "ansi-escapes": "^3.0.0",
+            "chalk": "^2.0.0",
+            "cli-cursor": "^2.1.0",
+            "cli-width": "^2.0.0",
+            "external-editor": "^2.0.4",
+            "figures": "^2.0.0",
+            "lodash": "^4.3.0",
+            "mute-stream": "0.0.7",
+            "run-async": "^2.2.0",
+            "rx-lite": "^4.0.8",
+            "rx-lite-aggregates": "^4.0.8",
+            "string-width": "^2.1.0",
+            "strip-ansi": "^4.0.0",
+            "through": "^2.3.6"
+          }
+        },
+        "table": {
+          "version": "4.0.2",
+          "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
+          "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
+          "dev": true,
+          "requires": {
+            "ajv": "^5.2.3",
+            "ajv-keywords": "^2.1.0",
+            "chalk": "^2.1.0",
+            "lodash": "^4.17.4",
+            "slice-ansi": "1.0.0",
+            "string-width": "^2.1.1"
+          }
+        }
       }
     },
     "@vue/cli-service": {
@@ -1368,7 +1469,7 @@
     },
     "ajv-keywords": {
       "version": "2.1.1",
-      "resolved": "http://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-2.1.1.tgz",
+      "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
       "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
       "dev": true
     },
@@ -1380,8 +1481,8 @@
     },
     "ansi-escapes": {
       "version": "3.1.0",
-      "resolved": "http://registry.npm.taobao.org/ansi-escapes/download/ansi-escapes-3.1.0.tgz",
-      "integrity": "sha1-9zIHu4EgfXX9bIPxJa8m7qN4yjA=",
+      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
+      "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==",
       "dev": true
     },
     "ansi-html": {
@@ -1921,6 +2022,15 @@
       "integrity": "sha1-1NDpudv8p3vwjusKikcVUP454ok=",
       "dev": true
     },
+    "axios": {
+      "version": "0.18.0",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
+      "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
+      "requires": {
+        "follow-redirects": "^1.3.0",
+        "is-buffer": "^1.1.5"
+      }
+    },
     "babel-code-frame": {
       "version": "6.26.0",
       "resolved": "http://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz",
@@ -1970,8 +2080,8 @@
     },
     "babel-eslint": {
       "version": "8.2.3",
-      "resolved": "http://registry.npm.taobao.org/babel-eslint/download/babel-eslint-8.2.3.tgz",
-      "integrity": "sha1-Gi5mgcybxEc8MomeWZFeGc1nM88=",
+      "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.3.tgz",
+      "integrity": "sha512-0HeSTtaXg/Em7FCUWxwOT+KeFSO1O7LuRuzhk7g+1BjwdlQGlHq4OyMi3GqGxrNfEq8jEi6Hmt5ylEQUhurgiQ==",
       "dev": true,
       "requires": {
         "@babel/code-frame": "7.0.0-beta.44",
@@ -1984,8 +2094,8 @@
       "dependencies": {
         "@babel/code-frame": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.0.0-beta.44.tgz",
-          "integrity": "sha1-KgJkM2jegJFhYr5whlyXd08629k=",
+          "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz",
+          "integrity": "sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==",
           "dev": true,
           "requires": {
             "@babel/highlight": "7.0.0-beta.44"
@@ -1993,8 +2103,8 @@
         },
         "@babel/generator": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.0.0-beta.44.tgz",
-          "integrity": "sha1-x+Z7m1KEr89pswm1DX038+UDPUI=",
+          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz",
+          "integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==",
           "dev": true,
           "requires": {
             "@babel/types": "7.0.0-beta.44",
@@ -2006,8 +2116,8 @@
         },
         "@babel/helper-function-name": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/helper-function-name/download/@babel/helper-function-name-7.0.0-beta.44.tgz",
-          "integrity": "sha1-4YVSqq4iMRAKbkheA4VLw1MtRN0=",
+          "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz",
+          "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==",
           "dev": true,
           "requires": {
             "@babel/helper-get-function-arity": "7.0.0-beta.44",
@@ -2017,8 +2127,8 @@
         },
         "@babel/helper-get-function-arity": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.0.0-beta.44.tgz",
-          "integrity": "sha1-0Dym3SufewseazLFbHKDYUDbOhU=",
+          "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz",
+          "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==",
           "dev": true,
           "requires": {
             "@babel/types": "7.0.0-beta.44"
@@ -2026,8 +2136,8 @@
         },
         "@babel/helper-split-export-declaration": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.0.0-beta.44.tgz",
-          "integrity": "sha1-wLNRc14PvLOCLIrY205YOwXr2dw=",
+          "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz",
+          "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==",
           "dev": true,
           "requires": {
             "@babel/types": "7.0.0-beta.44"
@@ -2035,8 +2145,8 @@
         },
         "@babel/highlight": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.0.0-beta.44.tgz",
-          "integrity": "sha1-GMlM5UORaoBVPtzc9oGJCyAHR9U=",
+          "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz",
+          "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==",
           "dev": true,
           "requires": {
             "chalk": "^2.0.0",
@@ -2046,8 +2156,8 @@
         },
         "@babel/template": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/template/download/@babel/template-7.0.0-beta.44.tgz",
-          "integrity": "sha1-+IMvT9zuXVm/UV5ZX8UQbFKbOU8=",
+          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz",
+          "integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==",
           "dev": true,
           "requires": {
             "@babel/code-frame": "7.0.0-beta.44",
@@ -2058,8 +2168,8 @@
         },
         "@babel/traverse": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.0.0-beta.44.tgz",
-          "integrity": "sha1-qXCixFR3rRgBfi5GWgYG/u4NKWY=",
+          "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz",
+          "integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==",
           "dev": true,
           "requires": {
             "@babel/code-frame": "7.0.0-beta.44",
@@ -2076,8 +2186,8 @@
         },
         "@babel/types": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/@babel/types/download/@babel/types-7.0.0-beta.44.tgz",
-          "integrity": "sha1-axsWRZH3fewKA0KsqZXy0Eazp1c=",
+          "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz",
+          "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==",
           "dev": true,
           "requires": {
             "esutils": "^2.0.2",
@@ -2087,8 +2197,8 @@
         },
         "babylon": {
           "version": "7.0.0-beta.44",
-          "resolved": "http://registry.npm.taobao.org/babylon/download/babylon-7.0.0-beta.44.tgz",
-          "integrity": "sha1-iRWeFebjDFCW4i1zjYwK+KDoyh0=",
+          "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
+          "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
           "dev": true
         }
       }
@@ -2122,7 +2232,7 @@
     },
     "babel-plugin-syntax-dynamic-import": {
       "version": "6.18.0",
-      "resolved": "http://registry.npm.taobao.org/babel-plugin-syntax-dynamic-import/download/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
+      "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
       "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=",
       "dev": true
     },
@@ -2802,8 +2912,8 @@
     },
     "circular-json": {
       "version": "0.3.3",
-      "resolved": "http://registry.npm.taobao.org/circular-json/download/circular-json-0.3.3.tgz",
-      "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=",
+      "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
+      "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==",
       "dev": true
     },
     "clap": {
@@ -3735,7 +3845,6 @@
       "version": "3.1.0",
       "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
       "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
-      "dev": true,
       "requires": {
         "ms": "2.0.0"
       }
@@ -3953,8 +4062,8 @@
     },
     "doctrine": {
       "version": "2.1.0",
-      "resolved": "http://registry.npm.taobao.org/doctrine/download/doctrine-2.1.0.tgz",
-      "integrity": "sha1-XNAfwQFiG0LEzX9dGmYkNxbT850=",
+      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+      "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
       "dev": true,
       "requires": {
         "esutils": "^2.0.2"
@@ -4225,8 +4334,8 @@
     },
     "eslint": {
       "version": "4.19.1",
-      "resolved": "http://registry.npm.taobao.org/eslint/download/eslint-4.19.1.tgz",
-      "integrity": "sha1-MtHWU+HZBAiFS/spbwdux+GGowA=",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
+      "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==",
       "dev": true,
       "requires": {
         "ajv": "^5.3.0",
@@ -4271,7 +4380,7 @@
       "dependencies": {
         "cross-spawn": {
           "version": "5.1.0",
-          "resolved": "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz",
+          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
           "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
           "dev": true,
           "requires": {
@@ -4725,8 +4834,8 @@
     },
     "external-editor": {
       "version": "2.2.0",
-      "resolved": "http://registry.npm.taobao.org/external-editor/download/external-editor-2.2.0.tgz",
-      "integrity": "sha1-BFURz9jRM/OEZnPRBHwVTiFK09U=",
+      "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
+      "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
       "dev": true,
       "requires": {
         "chardet": "^0.4.0",
@@ -5243,7 +5352,6 @@
       "version": "1.5.0",
       "resolved": "http://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.0.tgz",
       "integrity": "sha1-I09Jz3cLfzW0DnkPY2zroMOgq3c=",
-      "dev": true,
       "requires": {
         "debug": "^3.1.0"
       }
@@ -6705,8 +6813,8 @@
     },
     "iconv-lite": {
       "version": "0.4.23",
-      "resolved": "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.23.tgz",
-      "integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
+      "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
       "dev": true,
       "requires": {
         "safer-buffer": ">= 2.1.2 < 3"
@@ -6807,8 +6915,8 @@
     },
     "inquirer": {
       "version": "3.3.0",
-      "resolved": "http://registry.npm.taobao.org/inquirer/download/inquirer-3.3.0.tgz",
-      "integrity": "sha1-ndLyrXZdyrH/BEO0kUQqILoifck=",
+      "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
+      "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
       "dev": true,
       "requires": {
         "ansi-escapes": "^3.0.0",
@@ -6896,8 +7004,7 @@
     "is-buffer": {
       "version": "1.1.6",
       "resolved": "http://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz",
-      "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=",
-      "dev": true
+      "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4="
     },
     "is-builtin-module": {
       "version": "1.0.0",
@@ -7122,8 +7229,8 @@
     },
     "is-resolvable": {
       "version": "1.1.0",
-      "resolved": "http://registry.npm.taobao.org/is-resolvable/download/is-resolvable-1.1.0.tgz",
-      "integrity": "sha1-+xj4fOH+uSUWnJpAfBkxijIG7Yg=",
+      "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
+      "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
       "dev": true
     },
     "is-stream": {
@@ -7977,8 +8084,7 @@
     "ms": {
       "version": "2.0.0",
       "resolved": "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
-      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
-      "dev": true
+      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
     },
     "multicast-dns": {
       "version": "6.2.3",
@@ -8691,8 +8797,8 @@
     },
     "pluralize": {
       "version": "7.0.0",
-      "resolved": "http://registry.npm.taobao.org/pluralize/download/pluralize-7.0.0.tgz",
-      "integrity": "sha1-KYuJ34uTsCIdv0Ia0rGx6iP8Z3c=",
+      "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
+      "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
       "dev": true
     },
     "portfinder": {
@@ -10887,9 +10993,8 @@
     },
     "qs": {
       "version": "6.5.2",
-      "resolved": "http://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
-      "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=",
-      "dev": true
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
+      "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
     },
     "query-string": {
       "version": "4.3.4",
@@ -11229,8 +11334,8 @@
     },
     "regexpp": {
       "version": "1.1.0",
-      "resolved": "http://registry.npm.taobao.org/regexpp/download/regexpp-1.1.0.tgz",
-      "integrity": "sha1-DjUW3Qt5BPQT0tQZPc5GGMOmias=",
+      "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz",
+      "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==",
       "dev": true
     },
     "regexpu-core": {
@@ -11791,8 +11896,8 @@
     },
     "slice-ansi": {
       "version": "1.0.0",
-      "resolved": "http://registry.npm.taobao.org/slice-ansi/download/slice-ansi-1.0.0.tgz",
-      "integrity": "sha1-BE8aSdiEL/MHqta1Be0Xi9lQE00=",
+      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
+      "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
       "dev": true,
       "requires": {
         "is-fullwidth-code-point": "^2.0.0"
@@ -12336,8 +12441,8 @@
     },
     "table": {
       "version": "4.0.2",
-      "resolved": "http://registry.npm.taobao.org/table/download/table-4.0.2.tgz",
-      "integrity": "sha1-ozRHN1OR52atNNNIbm4q7chNLjY=",
+      "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
+      "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
       "dev": true,
       "requires": {
         "ajv": "^5.2.3",
@@ -12415,8 +12520,8 @@
     },
     "tmp": {
       "version": "0.0.33",
-      "resolved": "http://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz",
-      "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=",
+      "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
+      "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
       "dev": true,
       "requires": {
         "os-tmpdir": "~1.0.2"
@@ -13006,6 +13111,11 @@
         "vue-style-loader": "^4.1.0"
       }
     },
+    "vue-router": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.1.tgz",
+      "integrity": "sha512-vLLoY452L+JBpALMP5UHum9+7nzR9PeIBCghU9ZtJ1eWm6ieUI8Zb/DI3MYxH32bxkjzYV1LRjNv4qr8d+uX/w=="
+    },
     "vue-style-loader": {
       "version": "4.1.0",
       "resolved": "http://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.0.tgz",

+ 6 - 0
package.json

@@ -8,7 +8,10 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
+    "axios": "^0.18.0",
+    "qs": "^6.5.2",
     "vue": "^2.5.16",
+    "vue-router": "^3.0.1",
     "vuex": "^3.0.1"
   },
   "devDependencies": {
@@ -16,6 +19,9 @@
     "@vue/cli-plugin-eslint": "^3.0.0-beta.15",
     "@vue/cli-service": "^3.0.0-beta.15",
     "@vue/eslint-config-standard": "^3.0.0-beta.16",
+    "babel-eslint": "^8.2.3",
+    "babel-plugin-syntax-dynamic-import": "^6.18.0",
+    "eslint": "^4.19.1",
     "less": "^3.0.4",
     "less-loader": "^4.1.0",
     "vue-template-compiler": "^2.5.16"

+ 18 - 14
public/index.html

@@ -1,17 +1,21 @@
 <!DOCTYPE html>
 <html>
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>worldcup_front</title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but worldcup_front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
+
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+  <title>hooli世界杯</title>
+  <link rel="stylesheet" type="text/css" href="<%= BASE_URL %>normalize.css" />
+</head>
+
+<body>
+  <noscript>
+    <strong>We're sorry but worldcup_front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
+  </noscript>
+  <div id="app"></div>
+  <!-- built files will be auto injected -->
+</body>
+
 </html>

+ 341 - 0
public/normalize.css

@@ -0,0 +1,341 @@
+/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
+
+/* Document
+   ========================================================================== */
+
+/**
+ * 1. Correct the line height in all browsers.
+ * 2. Prevent adjustments of font size after orientation changes in iOS.
+ */
+
+html {
+  line-height: 1.15; /* 1 */
+  -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/* Sections
+   ========================================================================== */
+
+/**
+ * Remove the margin in all browsers.
+ */
+
+body {
+  margin: 0;
+}
+
+/**
+ * Correct the font size and margin on `h1` elements within `section` and
+ * `article` contexts in Chrome, Firefox, and Safari.
+ */
+
+h1 {
+  font-size: 2em;
+  margin: 0.67em 0;
+}
+
+/* Grouping content
+   ========================================================================== */
+
+/**
+ * 1. Add the correct box sizing in Firefox.
+ * 2. Show the overflow in Edge and IE.
+ */
+
+hr {
+  box-sizing: content-box; /* 1 */
+  height: 0; /* 1 */
+  overflow: visible; /* 2 */
+}
+
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+
+pre {
+  font-family: monospace, monospace; /* 1 */
+  font-size: 1em; /* 2 */
+}
+
+/* Text-level semantics
+   ========================================================================== */
+
+/**
+ * Remove the gray background on active links in IE 10.
+ */
+
+a {
+  background-color: transparent;
+}
+
+/**
+ * 1. Remove the bottom border in Chrome 57-
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
+ */
+
+abbr[title] {
+  border-bottom: none; /* 1 */
+  text-decoration: underline; /* 2 */
+  text-decoration: underline dotted; /* 2 */
+}
+
+/**
+ * Add the correct font weight in Chrome, Edge, and Safari.
+ */
+
+b,
+strong {
+  font-weight: bolder;
+}
+
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+
+code,
+kbd,
+samp {
+  font-family: monospace, monospace; /* 1 */
+  font-size: 1em; /* 2 */
+}
+
+/**
+ * Add the correct font size in all browsers.
+ */
+
+small {
+  font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` elements from affecting the line height in
+ * all browsers.
+ */
+
+sub,
+sup {
+  font-size: 75%;
+  line-height: 0;
+  position: relative;
+  vertical-align: baseline;
+}
+
+sub {
+  bottom: -0.25em;
+}
+
+sup {
+  top: -0.5em;
+}
+
+/* Embedded content
+   ========================================================================== */
+
+/**
+ * Remove the border on images inside links in IE 10.
+ */
+
+img {
+  border-style: none;
+}
+
+/* Forms
+   ========================================================================== */
+
+/**
+ * 1. Change the font styles in all browsers.
+ * 2. Remove the margin in Firefox and Safari.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+  font-family: inherit; /* 1 */
+  font-size: 100%; /* 1 */
+  line-height: 1.15; /* 1 */
+  margin: 0; /* 2 */
+}
+
+/**
+ * Show the overflow in IE.
+ * 1. Show the overflow in Edge.
+ */
+
+button,
+input { /* 1 */
+  overflow: visible;
+}
+
+/**
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
+ * 1. Remove the inheritance of text transform in Firefox.
+ */
+
+button,
+select { /* 1 */
+  text-transform: none;
+}
+
+/**
+ * Correct the inability to style clickable types in iOS and Safari.
+ */
+
+button,
+[type="button"],
+[type="reset"],
+[type="submit"] {
+  -webkit-appearance: button;
+}
+
+/**
+ * Remove the inner border and padding in Firefox.
+ */
+
+button::-moz-focus-inner,
+[type="button"]::-moz-focus-inner,
+[type="reset"]::-moz-focus-inner,
+[type="submit"]::-moz-focus-inner {
+  border-style: none;
+  padding: 0;
+}
+
+/**
+ * Restore the focus styles unset by the previous rule.
+ */
+
+button:-moz-focusring,
+[type="button"]:-moz-focusring,
+[type="reset"]:-moz-focusring,
+[type="submit"]:-moz-focusring {
+  outline: 1px dotted ButtonText;
+}
+
+/**
+ * Correct the padding in Firefox.
+ */
+
+fieldset {
+  padding: 0.35em 0.75em 0.625em;
+}
+
+/**
+ * 1. Correct the text wrapping in Edge and IE.
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
+ * 3. Remove the padding so developers are not caught out when they zero out
+ *    `fieldset` elements in all browsers.
+ */
+
+legend {
+  box-sizing: border-box; /* 1 */
+  color: inherit; /* 2 */
+  display: table; /* 1 */
+  max-width: 100%; /* 1 */
+  padding: 0; /* 3 */
+  white-space: normal; /* 1 */
+}
+
+/**
+ * Add the correct vertical alignment in Chrome, Firefox, and Opera.
+ */
+
+progress {
+  vertical-align: baseline;
+}
+
+/**
+ * Remove the default vertical scrollbar in IE 10+.
+ */
+
+textarea {
+  overflow: auto;
+}
+
+/**
+ * 1. Add the correct box sizing in IE 10.
+ * 2. Remove the padding in IE 10.
+ */
+
+[type="checkbox"],
+[type="radio"] {
+  box-sizing: border-box; /* 1 */
+  padding: 0; /* 2 */
+}
+
+/**
+ * Correct the cursor style of increment and decrement buttons in Chrome.
+ */
+
+[type="number"]::-webkit-inner-spin-button,
+[type="number"]::-webkit-outer-spin-button {
+  height: auto;
+}
+
+/**
+ * 1. Correct the odd appearance in Chrome and Safari.
+ * 2. Correct the outline style in Safari.
+ */
+
+[type="search"] {
+  -webkit-appearance: textfield; /* 1 */
+  outline-offset: -2px; /* 2 */
+}
+
+/**
+ * Remove the inner padding in Chrome and Safari on macOS.
+ */
+
+[type="search"]::-webkit-search-decoration {
+  -webkit-appearance: none;
+}
+
+/**
+ * 1. Correct the inability to style clickable types in iOS and Safari.
+ * 2. Change font properties to `inherit` in Safari.
+ */
+
+::-webkit-file-upload-button {
+  -webkit-appearance: button; /* 1 */
+  font: inherit; /* 2 */
+}
+
+/* Interactive
+   ========================================================================== */
+
+/*
+ * Add the correct display in Edge, IE 10+, and Firefox.
+ */
+
+details {
+  display: block;
+}
+
+/*
+ * Add the correct display in all browsers.
+ */
+
+summary {
+  display: list-item;
+}
+
+/* Misc
+   ========================================================================== */
+
+/**
+ * Add the correct display in IE 10+.
+ */
+
+template {
+  display: none;
+}
+
+/**
+ * Add the correct display in IE 10.
+ */
+
+[hidden] {
+  display: none;
+}

+ 40 - 14
src/App.vue

@@ -1,28 +1,54 @@
 <template>
-  <div id="app">
-    <img src="./assets/logo.png">
-    <HelloWorld msg="Welcome to Your Vue.js App"/>
-  </div>
+    <div id="app">
+        <router-view />
+    </div>
 </template>
 
 <script>
-import HelloWorld from './components/HelloWorld.vue'
-
 export default {
-  name: 'app',
-  components: {
-    HelloWorld
-  }
+  name: 'app'
 }
 </script>
 
 <style lang="less">
+html,
+body,
+#app {
+  width: 100%;
+  height: 100%;
+  margin: 0;
+  padding: 0;
+}
 #app {
-  font-family: 'Avenir', Helvetica, Arial, sans-serif;
+  font-family: "PingFangSC-Regular", "SimHei", "Microsoft YaHei", Helvetica,
+    Arial, sans-serif;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
-  text-align: center;
-  color: #2c3e50;
-  margin-top: 60px;
+}
+input:-webkit-autofill,
+textarea:-webkit-autofill,
+select:-webkit-autofill {
+  -webkit-box-shadow: 0 0 0px 1000px white inset;
+  box-shadow: 0 0 0px 1000px white inset;
+}
+img[src=""],
+img:not([src]) {
+  opacity: 0;
+}
+
+/* 单行超出部分以省略号显示 */
+.singleline {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+/* 超出两行以省略号显示 */
+.twoline {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
 }
 </style>

+ 9 - 0
src/common/api.js

@@ -0,0 +1,9 @@
+/**
+ * 接口地址url
+ */
+import cfg from './config.js'
+const api = cfg.api()
+const apis = {
+  api_user_login: `${api}/user/login` /* {mobile,code} */
+}
+export default apis

+ 16 - 0
src/common/c.js

@@ -0,0 +1,16 @@
+/**
+ * 项目中所用到的全部常量
+ */
+const CODE_NOT_LOGIN = 888 /* 接口返回未登录code */
+const DEBUG = true /* 全局是否开启console.log()调试 */
+const PULL_DOWN = 1 /* 下拉刷新数据 */
+const PULL_NONE = 2 /* 无上拉或下拉,正常请求数据 */
+const PULL_UP = 3 /* 上拉加载数据 */
+
+export default {
+  CODE_NOT_LOGIN,
+  DEBUG,
+  PULL_DOWN,
+  PULL_NONE,
+  PULL_UP
+}

+ 14 - 0
src/common/config.js

@@ -0,0 +1,14 @@
+const cfg = {
+  http: 'http://',
+  https: 'https://',
+  host: 'testapi.hoolihome.com',
+  host_cdn: 'testapi.hoolihome.com',
+  api: function () { /* 接口服务器域名 */
+    return this.http + this.host
+  },
+  cdn: function () { /* cdn服务器域名 */
+    return this.http + this.host_cdn
+  }
+}
+
+export default cfg

+ 120 - 0
src/common/net.js

@@ -0,0 +1,120 @@
+import Qs from 'qs'
+import axios from 'axios'
+import C from './c.js'
+import utils from './utils.js'
+import apis from './api.js'
+
+const net = {
+  req: (params, vm) => {
+    if (!params) {
+      return new Promise((resolve, reject) => {
+        reject(new Error('请设置请求参数'))
+      })
+    }
+    if (!params.url) {
+      return new Promise((resolve, reject) => {
+        reject(new Error('请设置请求url'))
+      })
+    }
+    return new Promise((resolve, reject) => {
+      params.data = utils.deepClone(params.data) || {}
+      let userToken = utils.storage.fetch('userToken')
+      if (userToken) {
+        params.data.user_token = userToken
+      }
+      if (!params.method) {
+        params.method = 'post'
+      }
+      let config = {
+        url: params.url,
+        method: params.method,
+        headers: {
+          'X-Requested-With': 'XMLHttpRequest',
+          'Content-Type': 'application/x-www-form-urlencoded'
+        },
+        responseType: params.responseType || 'json',
+        timeout: 30000,
+        paramsSerializer: function (params) {
+          return Qs.stringify(params, {
+            arrayFormat: 'brackets'
+          })
+        },
+        transformRequest: [function (data, headers) {
+          return Qs.stringify(data, {
+            arrayFormat: 'brackets'
+          })
+        }]
+      }
+      if (params.method.toLowerCase() === 'get') {
+        Object.assign(config, {
+          params: Object.assign(params.data, {
+            timestamp: Date.parse(new Date()) / 1000
+          })
+        })
+      } else {
+        Object.assign(config, {
+          params: {
+            timestamp: Date.parse(new Date()) / 1000
+          },
+          data: params.data
+        })
+      }
+      axios(config).then((response) => {
+        C.DEBUG && console.log(`${params.url}---response--->`, response)
+        let {data, status} = response
+        if (parseInt(status) === 200) {
+          let {code} = data
+          code = parseInt(code)
+          if (parseInt(code) === 0) {
+            resolve(data)
+          } else if (C.CODE_NOT_LOGIN === code) {
+            utils.storage.clear()
+            if (vm) {
+              let {fullPath} = vm.$route
+              vm.$router.push({
+                path: `/login?targetUrl=${encodeURIComponent(fullPath)}`,
+                replace: true
+              })
+            }
+          } else {
+            reject(data)
+          }
+        } else {
+          reject(response)
+        }
+      }).catch((e) => {
+        C.DEBUG && console.log(`${params.url}---catch--->`, e)
+        reject(e)
+      })
+      C.DEBUG && console.log(`${params.url}---params--->`, config)
+    })
+  },
+  login: (account, password, success, fail) => {
+    let params = {}
+    params.url = apis.api_admin_login
+    params.data = {
+      account: account,
+      password: password
+    }
+    net.req(params).then(
+      data => {
+        if (data) {
+          let userInfo = data.data
+          if (userInfo) {
+            if (userInfo.admin_token) {
+              utils.storage.save('userToken', userInfo.admin_token)
+            }
+            userInfo = encodeURIComponent(JSON.stringify(userInfo))
+            utils.storage.save('userInfo', userInfo)
+          }
+        }
+        success && success(data)
+      },
+      e => {
+        fail && fail(e)
+      }
+    )
+  }
+}
+
+export default net

+ 75 - 0
src/common/utils.js

@@ -0,0 +1,75 @@
+const utils = {
+  storage: {
+    save: (key, value) => {
+      let result = null
+      if (window) {
+        result = window.localStorage.setItem(key, JSON.stringify(value))
+      }
+      return result
+    },
+    fetch: (key) => {
+      let result = null
+      if (window && key) {
+        result = JSON.parse(window.localStorage.getItem(key))
+      }
+      return result
+    },
+    remove: (key) => {
+      if (window) {
+        window.localStorage.removeItem(key)
+      }
+    },
+    clear: () => {
+      if (window) {
+        window.localStorage.clear()
+      }
+    }
+  },
+  queryString: (name) => {
+    var result = location.search.match(new RegExp('[?&]' + name + '=([^&]+)', 'i'))
+    if (result == null || result.length < 1) {
+      return ''
+    }
+    return decodeURIComponent(result[1])
+  },
+  deepClone: (obj) => { /* 深度克隆对象 */
+    if (obj === null || typeof obj !== 'object') {
+      return obj
+    }
+    let clone
+    if (obj instanceof Date) {
+      clone = new Date()
+      clone.setTime(obj.getTime())
+      return clone
+    }
+    if (obj instanceof Array) {
+      clone = []
+      let i
+      let n = obj.length
+      for (i = 0; i < n; i++) {
+        clone[i] = utils.deepClone(obj[i])
+      }
+      return clone
+    }
+    if (obj instanceof Object) {
+      clone = {}
+      for (let key in obj) {
+        if (obj.hasOwnProperty(key)) {
+          clone[key] = utils.deepClone(obj[key])
+        }
+      }
+      return clone
+    }
+    throw new Error(`Unable to clone obj! Its type isn't supported.`)
+  },
+  checkIsLogin: () => {
+    let userToken = utils.storage.fetch('userToken')
+    if (userToken) {
+      return true
+    } else {
+      return false
+    }
+  }
+}
+
+export default utils

+ 17 - 0
src/components/Awards.vue

@@ -0,0 +1,17 @@
+<template>
+    <div class="awards"/>
+</template>
+
+<script>
+export default {
+  name: 'Awards'
+}
+</script>
+
+<style scoped lang="less">
+.awards {
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+}
+</style>

+ 0 - 57
src/components/HelloWorld.vue

@@ -1,57 +0,0 @@
-<template>
-  <div class="hello">
-    <h1>{{ msg }}</h1>
-    <p>
-      For guide and recipes on how to configure / customize this project,<br>
-      check out the
-      <a href="https://github.com/vuejs/vue-cli/tree/dev/docs" target="_blank">vue-cli documentation</a>.
-    </p>
-    <h3>Installed CLI Plugins</h3>
-    <ul>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank">babel</a></li>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank">eslint</a></li>
-    </ul>
-    <h3>Essential Links</h3>
-    <ul>
-      <li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
-      <li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
-      <li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
-      <li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
-    </ul>
-    <h3>Ecosystem</h3>
-    <ul>
-      <li><a href="https://router.vuejs.org" target="_blank">vue-router</a></li>
-      <li><a href="https://vuex.vuejs.org" target="_blank">vuex</a></li>
-      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank">vue-devtools</a></li>
-      <li><a href="https://vue-loader.vuejs.org" target="_blank">vue-loader</a></li>
-      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
-    </ul>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'HelloWorld',
-  props: {
-    msg: String
-  }
-}
-</script>
-
-<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped lang="less">
-h3 {
-  margin: 40px 0 0;
-}
-ul {
-  list-style-type: none;
-  padding: 0;
-}
-li {
-  display: inline-block;
-  margin: 0 10px;
-}
-a {
-  color: #42b983;
-}
-</style>

+ 17 - 0
src/components/Matches.vue

@@ -0,0 +1,17 @@
+<template>
+    <div class="matches"/>
+</template>
+
+<script>
+export default {
+  name: 'Matches'
+}
+</script>
+
+<style scoped lang="less">
+.matches {
+  width: 100%;
+  height: 100%;
+  background-color: #999;
+}
+</style>

+ 17 - 0
src/components/News.vue

@@ -0,0 +1,17 @@
+<template>
+    <div class="news"/>
+</template>
+
+<script>
+export default {
+  name: 'News'
+}
+</script>
+
+<style scoped lang="less">
+.news {
+  width: 100%;
+  height: 100%;
+  background-color: #ddd;
+}
+</style>

+ 17 - 0
src/components/Ranks.vue

@@ -0,0 +1,17 @@
+<template>
+    <div class="ranks"/>
+</template>
+
+<script>
+export default {
+  name: 'Ranks'
+}
+</script>
+
+<style scoped lang="less">
+.ranks {
+  width: 100%;
+  height: 100%;
+  background-color: #bbb;
+}
+</style>

+ 2 - 0
src/main.js

@@ -1,10 +1,12 @@
 import Vue from 'vue'
 import App from './App.vue'
+import router from './router'
 import store from './store'
 
 Vue.config.productionTip = false
 
 new Vue({
+  router,
   store,
   render: h => h(App)
 }).$mount('#app')

+ 39 - 0
src/router.js

@@ -0,0 +1,39 @@
+import Vue from 'vue'
+import Router from 'vue-router'
+
+Vue.use(Router)
+
+const routes = [{
+  path: '/home',
+  name: 'Home',
+  component: resolve => require(['./views/Home'], resolve)
+}, {
+  path: '/my',
+  name: 'My',
+  component: resolve => require(['./views/My'], resolve)
+}, {
+  path: '/index/:tabActive',
+  name: 'Index',
+  component: resolve => require(['./views/Index'], resolve)
+}, {
+  path: '*',
+  redirect: '/home'
+}]
+
+const router = new Router({
+  mode: 'history',
+  routes: routes,
+  base: '/worldcup'
+})
+
+router.beforeEach((to, from, next) => {
+  if (to.matched.length === 0) { /* 如果未匹配到路由 */
+    from.name ? next({
+      name: from.name
+    }) : next('/') /* 如果上级也未匹配到路由则跳转home首页,如果上级能匹配到则转上级路由 */
+  } else {
+    next() /* 如果匹配到正确跳转 */
+  }
+})
+
+export default router

+ 19 - 0
src/views/Home.vue

@@ -0,0 +1,19 @@
+<template>
+    <div class="home">
+        Home
+    </div>
+</template>
+
+<script>
+export default {
+  name: 'home'
+}
+</script>
+
+<style scoped lang="less">
+.home {
+  width: 100%;
+  height: 100%;
+  background-color: red;
+}
+</style>

+ 19 - 0
src/views/Index.vue

@@ -0,0 +1,19 @@
+<template>
+    <div class="index">
+        Index
+    </div>
+</template>
+
+<script>
+export default {
+  name: 'index'
+}
+</script>
+
+<style scoped lang="less">
+.index {
+  width: 100%;
+  height: 100%;
+  background-color: blue;
+}
+</style>

+ 19 - 0
src/views/My.vue

@@ -0,0 +1,19 @@
+<template>
+    <div class="my">
+        My
+    </div>
+</template>
+
+<script>
+export default {
+  name: 'my'
+}
+</script>
+
+<style scoped lang="less">
+.my {
+  width: 100%;
+  height: 100%;
+  background-color: green;
+}
+</style>

+ 4 - 0
vue.config.js

@@ -0,0 +1,4 @@
+module.exports = {
+  baseUrl: '/worldcup/',
+  outputDir: '/worldcup/'
+}