Try to use vuex to store user profile and website config, upgrade some package

This commit is contained in:
zema1 2017-09-24 21:30:14 +08:00
parent 58c859db44
commit a4ff420f8e
15 changed files with 453 additions and 346 deletions

475
oj/package-lock.json generated
View File

@ -185,9 +185,9 @@
"dev": true
},
"asap": {
"version": "2.0.5",
"resolved": "http://registry.npm.taobao.org/asap/download/asap-2.0.5.tgz",
"integrity": "sha1-UidltQw1EEkOUtfc/ghe+bqWlY8=",
"version": "2.0.6",
"resolved": "http://registry.npm.taobao.org/asap/download/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"dev": true,
"optional": true
},
@ -219,11 +219,10 @@
}
},
"assert-plus": {
"version": "0.2.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-0.2.0.tgz",
"integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=",
"dev": true,
"optional": true
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true
},
"async": {
"version": "2.4.1",
@ -270,9 +269,9 @@
}
},
"aws-sign2": {
"version": "0.6.0",
"resolved": "http://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.6.0.tgz",
"integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=",
"version": "0.7.0",
"resolved": "http://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
"dev": true,
"optional": true
},
@ -1509,12 +1508,13 @@
"dev": true
},
"boom": {
"version": "2.10.1",
"resolved": "http://registry.npm.taobao.org/boom/download/boom-2.10.1.tgz",
"integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
"version": "4.3.1",
"resolved": "http://registry.npm.taobao.org/boom/download/boom-4.3.1.tgz",
"integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
"dev": true,
"optional": true,
"requires": {
"hoek": "2.16.3"
"hoek": "4.2.0"
}
},
"brace-expansion": {
@ -2170,13 +2170,25 @@
}
},
"cryptiles": {
"version": "2.0.5",
"resolved": "http://registry.npm.taobao.org/cryptiles/download/cryptiles-2.0.5.tgz",
"integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=",
"version": "3.1.2",
"resolved": "http://registry.npm.taobao.org/cryptiles/download/cryptiles-3.1.2.tgz",
"integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=",
"dev": true,
"optional": true,
"requires": {
"boom": "2.10.1"
"boom": "5.2.0"
},
"dependencies": {
"boom": {
"version": "5.2.0",
"resolved": "http://registry.npm.taobao.org/boom/download/boom-5.2.0.tgz",
"integrity": "sha1-XdnabuOl8wIHdDYpDLcX0/SlTgI=",
"dev": true,
"optional": true,
"requires": {
"hoek": "4.2.0"
}
}
}
},
"crypto-browserify": {
@ -2204,9 +2216,9 @@
"dev": true
},
"css-loader": {
"version": "0.28.5",
"resolved": "http://registry.npm.taobao.org/css-loader/download/css-loader-0.28.5.tgz",
"integrity": "sha1-3QK7kblFRXECEu9/aqpmZjET11Q=",
"version": "0.28.7",
"resolved": "http://registry.npm.taobao.org/css-loader/download/css-loader-0.28.7.tgz",
"integrity": "sha1-Xy7pid0y7dkHcX+VMxdlYWCZnBs=",
"dev": true,
"requires": {
"babel-code-frame": "6.22.0",
@ -2360,15 +2372,6 @@
"optional": true,
"requires": {
"assert-plus": "1.0.0"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true,
"optional": true
}
}
},
"date-now": {
@ -2404,9 +2407,9 @@
"dev": true
},
"deepmerge": {
"version": "1.5.1",
"resolved": "http://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.1.tgz",
"integrity": "sha1-wFO/Bv1ydvGZT3DAmgdgy2GlYjc="
"version": "1.5.2",
"resolved": "http://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz",
"integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M="
},
"defined": {
"version": "1.0.0",
@ -3104,9 +3107,9 @@
}
},
"extsprintf": {
"version": "1.0.2",
"resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.0.2.tgz",
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=",
"version": "1.3.0",
"resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"dev": true
},
"fast-deep-equal": {
@ -3266,9 +3269,9 @@
"optional": true
},
"form-data": {
"version": "2.1.4",
"resolved": "http://registry.npm.taobao.org/form-data/download/form-data-2.1.4.tgz",
"integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=",
"version": "2.3.1",
"resolved": "http://registry.npm.taobao.org/form-data/download/form-data-2.3.1.tgz",
"integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=",
"dev": true,
"optional": true,
"requires": {
@ -4088,14 +4091,6 @@
}
}
},
"string_decoder": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"requires": {
"safe-buffer": "5.0.1"
}
},
"string-width": {
"version": "1.0.2",
"bundled": true,
@ -4106,6 +4101,14 @@
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"requires": {
"safe-buffer": "5.0.1"
}
},
"stringstream": {
"version": "0.0.5",
"bundled": true,
@ -4253,15 +4256,6 @@
"optional": true,
"requires": {
"assert-plus": "1.0.0"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true,
"optional": true
}
}
},
"glob": {
@ -4388,21 +4382,43 @@
}
},
"har-schema": {
"version": "1.0.5",
"resolved": "http://registry.npm.taobao.org/har-schema/download/har-schema-1.0.5.tgz",
"integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=",
"version": "2.0.0",
"resolved": "http://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
"dev": true,
"optional": true
},
"har-validator": {
"version": "4.2.1",
"resolved": "http://registry.npm.taobao.org/har-validator/download/har-validator-4.2.1.tgz",
"integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=",
"version": "5.0.3",
"resolved": "http://registry.npm.taobao.org/har-validator/download/har-validator-5.0.3.tgz",
"integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
"dev": true,
"optional": true,
"requires": {
"ajv": "4.11.8",
"har-schema": "1.0.5"
"ajv": "5.2.2",
"har-schema": "2.0.0"
},
"dependencies": {
"ajv": {
"version": "5.2.2",
"resolved": "http://registry.npm.taobao.org/ajv/download/ajv-5.2.2.tgz",
"integrity": "sha1-R8aNaehvXZUxA7AHSpQw3GPaXjk=",
"dev": true,
"optional": true,
"requires": {
"co": "4.6.0",
"fast-deep-equal": "1.0.0",
"json-schema-traverse": "0.3.0",
"json-stable-stringify": "1.0.1"
}
},
"fast-deep-equal": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-1.0.0.tgz",
"integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=",
"dev": true,
"optional": true
}
}
},
"has": {
@ -4455,16 +4471,16 @@
}
},
"hawk": {
"version": "3.1.3",
"resolved": "http://registry.npm.taobao.org/hawk/download/hawk-3.1.3.tgz",
"integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
"version": "6.0.2",
"resolved": "http://registry.npm.taobao.org/hawk/download/hawk-6.0.2.tgz",
"integrity": "sha1-r02RTrBl+bXOTZ0RwcshJu7MMDg=",
"dev": true,
"optional": true,
"requires": {
"boom": "2.10.1",
"cryptiles": "2.0.5",
"hoek": "2.16.3",
"sntp": "1.0.9"
"boom": "4.3.1",
"cryptiles": "3.1.2",
"hoek": "4.2.0",
"sntp": "2.0.2"
}
},
"he": {
@ -4490,9 +4506,9 @@
}
},
"hoek": {
"version": "2.16.3",
"resolved": "http://registry.npm.taobao.org/hoek/download/hoek-2.16.3.tgz",
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
"version": "4.2.0",
"resolved": "http://registry.npm.taobao.org/hoek/download/hoek-4.2.0.tgz",
"integrity": "sha1-ctnQdU9/4lyi0BrY+PmpRJqJUm0=",
"dev": true
},
"home-or-tmp": {
@ -4630,14 +4646,14 @@
}
},
"http-signature": {
"version": "1.1.1",
"resolved": "http://registry.npm.taobao.org/http-signature/download/http-signature-1.1.1.tgz",
"integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=",
"version": "1.2.0",
"resolved": "http://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"dev": true,
"optional": true,
"requires": {
"assert-plus": "0.2.0",
"jsprim": "1.4.0",
"assert-plus": "1.0.0",
"jsprim": "1.4.1",
"sshpk": "1.13.1"
}
},
@ -4664,7 +4680,7 @@
"integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=",
"dev": true,
"requires": {
"postcss": "6.0.9"
"postcss": "6.0.11"
},
"dependencies": {
"ansi-styles": {
@ -4684,7 +4700,7 @@
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.2.1"
"supports-color": "4.4.0"
}
},
"has-flag": {
@ -4694,20 +4710,26 @@
"dev": true
},
"postcss": {
"version": "6.0.9",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.9.tgz",
"integrity": "sha1-VIGXZnhKUcZbHsTVTC+TdlQ4w1o=",
"version": "6.0.11",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.11.tgz",
"integrity": "sha1-9I2yELHTen96tkmbelSYKZerb3I=",
"dev": true,
"requires": {
"chalk": "2.1.0",
"source-map": "0.5.6",
"supports-color": "4.2.1"
"source-map": "0.5.7",
"supports-color": "4.4.0"
}
},
"source-map": {
"version": "0.5.7",
"resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"supports-color": {
"version": "4.2.1",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.2.1.tgz",
"integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=",
"version": "4.4.0",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.4.0.tgz",
"integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=",
"dev": true,
"requires": {
"has-flag": "2.0.0"
@ -5046,7 +5068,7 @@
"requires": {
"async-validator": "1.8.1",
"core-js": "2.5.1",
"deepmerge": "1.5.1",
"deepmerge": "1.5.2",
"popper.js": "0.6.4",
"tinycolor2": "1.4.1"
},
@ -5065,9 +5087,9 @@
"dev": true
},
"js-beautify": {
"version": "1.6.14",
"resolved": "http://registry.npm.taobao.org/js-beautify/download/js-beautify-1.6.14.tgz",
"integrity": "sha1-07j3Mi0CuSd9WL0jgmTDJ+WARM0=",
"version": "1.7.3",
"resolved": "http://registry.npm.taobao.org/js-beautify/download/js-beautify-1.7.3.tgz",
"integrity": "sha1-P1YwZxYs0GNchhFobR+guxRIdzo=",
"dev": true,
"requires": {
"config-chain": "1.1.11",
@ -5168,25 +5190,16 @@
"dev": true
},
"jsprim": {
"version": "1.4.0",
"resolved": "http://registry.npm.taobao.org/jsprim/download/jsprim-1.4.0.tgz",
"integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=",
"version": "1.4.1",
"resolved": "http://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"dev": true,
"optional": true,
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.0.2",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.3.6"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true,
"optional": true
}
"verror": "1.10.0"
}
},
"kind-of": {
@ -5234,7 +5247,7 @@
"mime": "1.3.6",
"mkdirp": "0.5.1",
"promise": "7.3.1",
"request": "2.81.0",
"request": "2.82.0",
"source-map": "0.5.6"
}
},
@ -6011,9 +6024,9 @@
}
},
"performance-now": {
"version": "0.2.0",
"resolved": "http://registry.npm.taobao.org/performance-now/download/performance-now-0.2.0.tgz",
"integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=",
"version": "2.1.0",
"resolved": "http://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true,
"optional": true
},
@ -6280,7 +6293,7 @@
"integrity": "sha1-thTJcgvmgW6u41+zpfqh26agXds=",
"dev": true,
"requires": {
"postcss": "6.0.9"
"postcss": "6.0.11"
},
"dependencies": {
"ansi-styles": {
@ -6300,7 +6313,7 @@
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.2.1"
"supports-color": "4.4.0"
}
},
"has-flag": {
@ -6310,20 +6323,26 @@
"dev": true
},
"postcss": {
"version": "6.0.9",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.9.tgz",
"integrity": "sha1-VIGXZnhKUcZbHsTVTC+TdlQ4w1o=",
"version": "6.0.11",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.11.tgz",
"integrity": "sha1-9I2yELHTen96tkmbelSYKZerb3I=",
"dev": true,
"requires": {
"chalk": "2.1.0",
"source-map": "0.5.6",
"supports-color": "4.2.1"
"source-map": "0.5.7",
"supports-color": "4.4.0"
}
},
"source-map": {
"version": "0.5.7",
"resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"supports-color": {
"version": "4.2.1",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.2.1.tgz",
"integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=",
"version": "4.4.0",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.4.0.tgz",
"integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=",
"dev": true,
"requires": {
"has-flag": "2.0.0"
@ -6338,7 +6357,7 @@
"dev": true,
"requires": {
"css-selector-tokenizer": "0.7.0",
"postcss": "6.0.9"
"postcss": "6.0.11"
},
"dependencies": {
"ansi-styles": {
@ -6358,7 +6377,7 @@
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.2.1"
"supports-color": "4.4.0"
}
},
"has-flag": {
@ -6368,20 +6387,26 @@
"dev": true
},
"postcss": {
"version": "6.0.9",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.9.tgz",
"integrity": "sha1-VIGXZnhKUcZbHsTVTC+TdlQ4w1o=",
"version": "6.0.11",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.11.tgz",
"integrity": "sha1-9I2yELHTen96tkmbelSYKZerb3I=",
"dev": true,
"requires": {
"chalk": "2.1.0",
"source-map": "0.5.6",
"supports-color": "4.2.1"
"source-map": "0.5.7",
"supports-color": "4.4.0"
}
},
"source-map": {
"version": "0.5.7",
"resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"supports-color": {
"version": "4.2.1",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.2.1.tgz",
"integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=",
"version": "4.4.0",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.4.0.tgz",
"integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=",
"dev": true,
"requires": {
"has-flag": "2.0.0"
@ -6396,7 +6421,7 @@
"dev": true,
"requires": {
"css-selector-tokenizer": "0.7.0",
"postcss": "6.0.9"
"postcss": "6.0.11"
},
"dependencies": {
"ansi-styles": {
@ -6416,7 +6441,7 @@
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.2.1"
"supports-color": "4.4.0"
}
},
"has-flag": {
@ -6426,20 +6451,26 @@
"dev": true
},
"postcss": {
"version": "6.0.9",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.9.tgz",
"integrity": "sha1-VIGXZnhKUcZbHsTVTC+TdlQ4w1o=",
"version": "6.0.11",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.11.tgz",
"integrity": "sha1-9I2yELHTen96tkmbelSYKZerb3I=",
"dev": true,
"requires": {
"chalk": "2.1.0",
"source-map": "0.5.6",
"supports-color": "4.2.1"
"source-map": "0.5.7",
"supports-color": "4.4.0"
}
},
"source-map": {
"version": "0.5.7",
"resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"supports-color": {
"version": "4.2.1",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.2.1.tgz",
"integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=",
"version": "4.4.0",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.4.0.tgz",
"integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=",
"dev": true,
"requires": {
"has-flag": "2.0.0"
@ -6454,7 +6485,7 @@
"dev": true,
"requires": {
"icss-replace-symbols": "1.1.0",
"postcss": "6.0.9"
"postcss": "6.0.11"
},
"dependencies": {
"ansi-styles": {
@ -6474,7 +6505,7 @@
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.2.1"
"supports-color": "4.4.0"
}
},
"has-flag": {
@ -6484,20 +6515,26 @@
"dev": true
},
"postcss": {
"version": "6.0.9",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.9.tgz",
"integrity": "sha1-VIGXZnhKUcZbHsTVTC+TdlQ4w1o=",
"version": "6.0.11",
"resolved": "http://registry.npm.taobao.org/postcss/download/postcss-6.0.11.tgz",
"integrity": "sha1-9I2yELHTen96tkmbelSYKZerb3I=",
"dev": true,
"requires": {
"chalk": "2.1.0",
"source-map": "0.5.6",
"supports-color": "4.2.1"
"source-map": "0.5.7",
"supports-color": "4.4.0"
}
},
"source-map": {
"version": "0.5.7",
"resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"supports-color": {
"version": "4.2.1",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.2.1.tgz",
"integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=",
"version": "4.4.0",
"resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-4.4.0.tgz",
"integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=",
"dev": true,
"requires": {
"has-flag": "2.0.0"
@ -6676,7 +6713,7 @@
"dev": true,
"optional": true,
"requires": {
"asap": "2.0.5"
"asap": "2.0.6"
}
},
"proto-list": {
@ -6733,9 +6770,9 @@
"dev": true
},
"qs": {
"version": "6.4.0",
"resolved": "http://registry.npm.taobao.org/qs/download/qs-6.4.0.tgz",
"integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=",
"version": "6.5.1",
"resolved": "http://registry.npm.taobao.org/qs/download/qs-6.5.1.tgz",
"integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=",
"dev": true,
"optional": true
},
@ -7096,34 +7133,53 @@
}
},
"request": {
"version": "2.81.0",
"resolved": "http://registry.npm.taobao.org/request/download/request-2.81.0.tgz",
"integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=",
"version": "2.82.0",
"resolved": "http://registry.npm.taobao.org/request/download/request-2.82.0.tgz",
"integrity": "sha1-K6ipLNesRWYOorEKU65nzSR1Fuo=",
"dev": true,
"optional": true,
"requires": {
"aws-sign2": "0.6.0",
"aws-sign2": "0.7.0",
"aws4": "1.6.0",
"caseless": "0.12.0",
"combined-stream": "1.0.5",
"extend": "3.0.1",
"forever-agent": "0.6.1",
"form-data": "2.1.4",
"har-validator": "4.2.1",
"hawk": "3.1.3",
"http-signature": "1.1.1",
"form-data": "2.3.1",
"har-validator": "5.0.3",
"hawk": "6.0.2",
"http-signature": "1.2.0",
"is-typedarray": "1.0.0",
"isstream": "0.1.2",
"json-stringify-safe": "5.0.1",
"mime-types": "2.1.15",
"mime-types": "2.1.17",
"oauth-sign": "0.8.2",
"performance-now": "0.2.0",
"qs": "6.4.0",
"performance-now": "2.1.0",
"qs": "6.5.1",
"safe-buffer": "5.1.1",
"stringstream": "0.0.5",
"tough-cookie": "2.3.2",
"tough-cookie": "2.3.3",
"tunnel-agent": "0.6.0",
"uuid": "3.1.0"
},
"dependencies": {
"mime-db": {
"version": "1.30.0",
"resolved": "http://registry.npm.taobao.org/mime-db/download/mime-db-1.30.0.tgz",
"integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=",
"dev": true,
"optional": true
},
"mime-types": {
"version": "2.1.17",
"resolved": "http://registry.npm.taobao.org/mime-types/download/mime-types-2.1.17.tgz",
"integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=",
"dev": true,
"optional": true,
"requires": {
"mime-db": "1.30.0"
}
}
}
},
"require-directory": {
@ -7411,13 +7467,13 @@
"dev": true
},
"sntp": {
"version": "1.0.9",
"resolved": "http://registry.npm.taobao.org/sntp/download/sntp-1.0.9.tgz",
"integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
"version": "2.0.2",
"resolved": "http://registry.npm.taobao.org/sntp/download/sntp-2.0.2.tgz",
"integrity": "sha1-UGQRDwr4X3z9t9a2ekACjOUrSys=",
"dev": true,
"optional": true,
"requires": {
"hoek": "2.16.3"
"hoek": "4.2.0"
}
},
"sort-keys": {
@ -7492,15 +7548,6 @@
"getpass": "0.1.7",
"jsbn": "0.1.1",
"tweetnacl": "0.14.5"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true,
"optional": true
}
}
},
"stackframe": {
@ -7544,15 +7591,6 @@
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
"dev": true
},
"string_decoder": {
"version": "1.0.3",
"resolved": "http://registry.npm.taobao.org/string_decoder/download/string_decoder-1.0.3.tgz",
"integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"string-length": {
"version": "1.0.1",
"resolved": "http://registry.npm.taobao.org/string-length/download/string-length-1.0.1.tgz",
@ -7573,6 +7611,15 @@
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
"version": "1.0.3",
"resolved": "http://registry.npm.taobao.org/string_decoder/download/string_decoder-1.0.3.tgz",
"integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"stringstream": {
"version": "0.0.5",
"resolved": "http://registry.npm.taobao.org/stringstream/download/stringstream-0.0.5.tgz",
@ -7714,9 +7761,9 @@
"dev": true
},
"tough-cookie": {
"version": "2.3.2",
"resolved": "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.3.2.tgz",
"integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=",
"version": "2.3.3",
"resolved": "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.3.3.tgz",
"integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=",
"dev": true,
"optional": true,
"requires": {
@ -7955,13 +8002,15 @@
"dev": true
},
"verror": {
"version": "1.3.6",
"resolved": "http://registry.npm.taobao.org/verror/download/verror-1.3.6.tgz",
"integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=",
"version": "1.10.0",
"resolved": "http://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"dev": true,
"optional": true,
"requires": {
"extsprintf": "1.0.2"
"assert-plus": "1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "1.3.0"
}
},
"vm-browserify": {
@ -7974,9 +8023,9 @@
}
},
"vue": {
"version": "2.4.2",
"resolved": "http://registry.npm.taobao.org/vue/download/vue-2.4.2.tgz",
"integrity": "sha1-qYVSYfGRyXjMDcEVBTG40IFJtYw="
"version": "2.4.4",
"resolved": "http://registry.npm.taobao.org/vue/download/vue-2.4.4.tgz",
"integrity": "sha1-6pVQuWpxRl/SuLF7YWc7NWGGF4k="
},
"vue-codemirror": {
"version": "3.1.4",
@ -8014,11 +8063,6 @@
"integrity": "sha1-nKWKbg35B4VUzhcIaItleHVNht4=",
"dev": true
},
"vue-lazyload": {
"version": "1.1.3",
"resolved": "http://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.1.3.tgz",
"integrity": "sha1-UnoePmumUJ/icybTTwq5aHyaHpU="
},
"vue-loader": {
"version": "12.2.2",
"resolved": "http://registry.npm.taobao.org/vue-loader/download/vue-loader-12.2.2.tgz",
@ -8027,7 +8071,7 @@
"requires": {
"consolidate": "0.14.5",
"hash-sum": "1.0.2",
"js-beautify": "1.6.14",
"js-beautify": "1.7.3",
"loader-utils": "1.1.0",
"lru-cache": "4.1.1",
"postcss": "5.2.17",
@ -8036,7 +8080,7 @@
"resolve": "1.3.3",
"source-map": "0.5.6",
"vue-hot-reload-api": "2.1.0",
"vue-style-loader": "3.0.1",
"vue-style-loader": "3.0.3",
"vue-template-es2015-compiler": "1.5.3"
}
},
@ -8046,9 +8090,9 @@
"integrity": "sha1-FtQkSTqlHDyMzot8chDqTDqJr/E="
},
"vue-style-loader": {
"version": "3.0.1",
"resolved": "http://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-3.0.1.tgz",
"integrity": "sha1-yLY5uy8kuvnXgnTcF+TyZMHe2gg=",
"version": "3.0.3",
"resolved": "http://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-3.0.3.tgz",
"integrity": "sha1-YjZY+BUGrvnRIc3BE6T1ycrDLfc=",
"dev": true,
"requires": {
"hash-sum": "1.0.2",
@ -8056,9 +8100,9 @@
}
},
"vue-template-compiler": {
"version": "2.4.2",
"resolved": "http://registry.npm.taobao.org/vue-template-compiler/download/vue-template-compiler-2.4.2.tgz",
"integrity": "sha1-WkXYQ/FIsJj2wdHjWsIMSVbTCtE=",
"version": "2.4.4",
"resolved": "http://registry.npm.taobao.org/vue-template-compiler/download/vue-template-compiler-2.4.4.tgz",
"integrity": "sha1-LN47cEEkmFwn1QtTh8lpG6UV+1c=",
"dev": true,
"requires": {
"de-indent": "1.0.2",
@ -8071,6 +8115,11 @@
"integrity": "sha1-Inh95ON+vZM5t0IjvEZ9Gt7jBUU=",
"dev": true
},
"vuex": {
"version": "2.4.0",
"resolved": "http://registry.npm.taobao.org/vuex/download/vuex-2.4.0.tgz",
"integrity": "sha1-4dBDBkYoK0AAf90G7Groip9aHhQ="
},
"watchpack": {
"version": "1.4.0",
"resolved": "http://registry.npm.taobao.org/watchpack/download/watchpack-1.4.0.tgz",

View File

@ -17,13 +17,13 @@
"i": "^0.3.5",
"iview": "^2.3.2",
"moment": "^2.18.1",
"vue": "^2.4.2",
"vue": "^2.4.4",
"vue-codemirror": "^3.1.4",
"vue-cropper": "^0.2.1",
"vue-echarts": "^2.4.0",
"vue-highlightjs": "^1.3.3",
"vue-lazyload": "^1.1.3",
"vue-router": "^2.7.0"
"vue-router": "^2.7.0",
"vuex": "^2.4.0"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
@ -37,7 +37,7 @@
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.5",
"css-loader": "^0.28.7",
"eslint": "^3.19.0",
"eslint-config-standard": "^6.2.1",
"eslint-friendly-formatter": "^2.0.7",
@ -48,7 +48,7 @@
"eventsource-polyfill": "^0.9.6",
"express": "^4.15.4",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"file-loader": "^0.11.2",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.30.1",
"http-proxy-middleware": "^0.17.3",
@ -60,10 +60,10 @@
"rimraf": "^2.6.0",
"semver": "^5.4.1",
"shelljs": "^0.7.6",
"url-loader": "^0.5.8",
"url-loader": "^0.5.9",
"vue-loader": "^12.2.2",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.4.2",
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "^2.4.4",
"webpack": "^2.7.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-middleware": "^1.12.0",

View File

@ -1,39 +1,38 @@
<template>
<div>
<NavBar></NavBar>
<!--<breadcrumb></breadcrumb>-->
<div class="content-app">
<router-view></router-view>
<div class="footer">
{{footer}} Build Version: {{ version }}
{{website.footer}} Build Version: {{ version }}
</div>
</div>
</div>
</template>
<script>
import api from '@/api'
import utils from '@/utils/utils'
import {mapActions, mapState} from 'vuex'
import NavBar from './components/NavBar.vue'
export default {
name: 'app',
mounted() {
api.getWebsiteConf().then(res => {
utils.setWebsiteConf(res.data.data)
this.footer = res.data.data.footer
})
this.getWebsiteConfig()
},
data() {
return {
version: process.env.VERSION,
footer: ''
version: process.env.VERSION
}
},
components: {
NavBar
},
methods: {}
methods: {
...mapActions(['getWebsiteConfig'])
},
computed: {
...mapState(['website'])
}
}
</script>

View File

@ -1,7 +1,7 @@
<template>
<div id="header">
<Menu theme="light" mode="horizontal" @on-select="handleRoute" :active-name="activeMenu" class="oj-menu">
<div class="logo"><span>{{websiteConf.name}}</span></div>
<div class="logo"><span>{{website.name}}</span></div>
<Menu-item name="/test">
<Icon type="home"></Icon>
Home
@ -34,14 +34,14 @@
<Icon type="information-circled"></Icon>
About
</Menu-item>
<template v-if="!isAuthed">
<template v-if="!isAuthenticated">
<div class="btn-menu">
<Button type="ghost"
ref="loginBtn"
shape="circle"
@click="handleBtnClick('login')">Login
</Button>
<Button v-if="websiteConf.allow_register"
<Button v-if="website.allow_register"
type="ghost"
shape="circle"
@click="handleBtnClick('register')"
@ -63,16 +63,13 @@
</Dropdown>
</template>
</Menu>
<LoginOrRegister :visible.sync="modalVisible" :mode.sync="modalMode"></LoginOrRegister>
<LoginOrRegister></LoginOrRegister>
</div>
</template>
<script>
import api from '@/api'
import auth from '../utils/auth'
import utils from '@/utils/utils'
import {mapGetters, mapActions} from 'vuex'
import LoginOrRegister from '@/views/user/LoginOrRegister'
export default {
@ -82,66 +79,32 @@
data() {
return {
modalMode: 'login',
modalVisible: false,
isAuthed: false,
username: '',
websiteConf: {}
modalVisible: false
}
},
mounted() {
this.$bus.$on('login', () => {
this.$refs['loginBtn'].handleClick()
})
this.$bus.$on('login-success', (res) => {
this.username = res.user.username
this.isAuthed = true
})
this.$bus.$on('logout', () => {
this.isAuthed = false
this.username = ''
})
this.getUserInfo()
this.websiteConf = utils.getWebsiteConf()
this.getProfile()
},
methods: {
getUserInfo() {
api.getUserInfo().then((res) => {
let data = res.data.data
if (data.hasOwnProperty('user')) {
this.username = data.user.username
this.isAuthed = true
auth.setUser(data)
} else {
this.isAuthed = false
this.username = ''
auth.clear()
}
}, (res) => {
})
},
...mapActions(['getProfile', 'changeModalStatus']),
handleRoute(route) {
if (route) {
this.$router.push(route)
}
},
handleBtnClick(mode) {
this.modalVisible = true
this.modalMode = mode
this.changeModalStatus({
visible: true,
mode: mode
})
}
},
computed: {
...mapGetters(['website', 'username', 'isAuthenticated']),
//
activeMenu() {
return '/' + this.$route.path.split('/')[1]
}
},
watch: {
'$route'() {
if (!auth.isAuthicated()) {
this.username = ''
this.isAuthed = false
}
}
}
}
</script>

View File

@ -1,6 +1,7 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import router from './router'
import store from './store'
import iView from 'iview'
import locale from 'iview/src/locale/lang/en-US'
import VueHighlightJS from 'vue-highlightjs'
@ -56,5 +57,6 @@ Vue.prototype.$Message.config({
Vue.prototype.$error = Vue.prototype.$Message.error
Vue.prototype.$info = Vue.prototype.$Message.info
Vue.prototype.$success = Vue.prototype.$Message.success
new Vue(Vue.util.extend({router}, App)).$mount('#app')
new Vue(Vue.util.extend({router, store}, App)).$mount('#app')

15
oj/src/store/actions.js Normal file
View File

@ -0,0 +1,15 @@
import api from '@/api'
import types from './types'
export default {
getWebsiteConfig({commit}) {
api.getWebsiteConf().then(res => {
commit(types.UPDATE_WEBSITE_CONF, {
websiteConfig: res.data.data
})
})
},
changeModalStatus({commit}, payload) {
commit(types.CHANGE_MODAL_STATUS, payload)
}
}

8
oj/src/store/getters.js Normal file
View File

@ -0,0 +1,8 @@
export default {
'website'(state) {
return state.website
},
'modalStatus'(state) {
return state.modalStatus
}
}

29
oj/src/store/index.js Normal file
View File

@ -0,0 +1,29 @@
import Vue from 'vue'
import Vuex from 'vuex'
import actions from './actions'
import getters from './getters'
import mutations from './mutations'
import user from './modules/user'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
export default new Vuex.Store({
modules: {
user
},
state: {
website: {},
modalStatus: {
mode: 'login', // or register,
visible: false
}
},
getters,
mutations,
actions,
strict: debug
})
export {types} from './types'

View File

@ -0,0 +1,45 @@
import types from '../types'
import api from '@/api'
const state = {
profile: {}
}
const getters = {
user: state => state.profile.user || null,
username: (state, getters) => {
return getters.user && getters.user.username
},
isAuthenticated: (state, getters) => {
return !!getters.user
}
}
const mutations = {
[types.CHANGE_PROFILE](state, {profile}) {
state.profile = profile
}
}
const actions = {
getProfile({commit}) {
api.getUserInfo().then(res => {
commit(types.CHANGE_PROFILE, {
profile: res.data.data
})
})
},
clearProfile({commit}) {
commit(types.CHANGE_PROFILE, {
profile: {}
})
}
}
export default {
state,
getters,
actions,
mutations
}

15
oj/src/store/mutations.js Normal file
View File

@ -0,0 +1,15 @@
import types from './types'
export default {
[types.UPDATE_WEBSITE_CONF](state, payload) {
state.website = payload.websiteConfig
},
[types.CHANGE_MODAL_STATUS](state, {mode, visible}) {
if (mode !== undefined) {
state.modalStatus.mode = mode
}
if (visible !== undefined) {
state.modalStatus.visible = visible
}
}
}

16
oj/src/store/types.js Normal file
View File

@ -0,0 +1,16 @@
function keyMirror(obj) {
if (obj instanceof Object) {
var _obj = Object.assign({}, obj)
var _keyArray = Object.keys(obj)
_keyArray.forEach(key => {
_obj[key] = key
})
return _obj
}
}
export default keyMirror({
'CHANGE_PROFILE': null,
'CHANGE_MODAL_STATUS': null,
'UPDATE_WEBSITE_CONF': null
})

View File

@ -42,21 +42,11 @@ function filterEmptyValue(object) {
})
return query
}
function setWebsiteConf(data) {
storage.set(STORAGE_KEY.websiteConf, data)
}
function getWebsiteConf() {
return storage.get(STORAGE_KEY.websiteConf)
}
export default {
submissionMemoryFormat: submissionMemoryFormat,
submissionTimeFormat: submissionTimeFormat,
getACRate: getACRate,
loadContest: loadContest,
filterEmptyValue: filterEmptyValue,
setWebsiteConf: setWebsiteConf,
getWebsiteConf: getWebsiteConf
filterEmptyValue: filterEmptyValue
}

View File

@ -170,7 +170,7 @@
if (contest.contest_type !== 'Public') {
if (!auth.isAuthicated()) {
this.$error('Please login first.')
this.$bus.$emit('login')
this.$store.dispatch('changeModalStatus', {visible: true})
} else if (contest.created_by.id === auth.getUid()) {
// contest.created_by is user self.
this.$router.push(route)

View File

@ -1,9 +1,9 @@
<template>
<Modal :value="visible" @on-cancel="handleUpdateProp('update:visible', false)" :width="400" className="modal">
<Modal v-model="visible" :width="400" className="modal">
<div slot="header">
<span class="title">Welcome to OJ</span>
</div>
<template v-if="mode === 'login'">
<template v-if="modalStatus.mode === 'login'">
<Form ref="formLogin" :model="formLogin" :rules="ruleLogin">
<FormItem prop="username">
<Input type="text" v-model="formLogin.username" placeholder="Username" size="large">
@ -23,7 +23,7 @@
</Form>
</template>
<template v-else>
<Form v-if="mode === 'register'" ref="formRegister" :model="formRegister" :rules="ruleRegister">
<Form v-if="modalStatus.mode === 'register'" ref="formRegister" :model="formRegister" :rules="ruleRegister">
<FormItem prop="username">
<Input type="text" v-model="formRegister.username" placeholder="Username" size="large">
<Icon type="ios-person-outline" slot="prepend"></Icon>
@ -61,7 +61,7 @@
</Form>
</template>
<div slot="footer" class="footer">
<template v-if="mode === 'login'">
<template v-if="modalStatus.mode === 'login'">
<Button
type="primary"
@click="handleLogin()"
@ -69,7 +69,7 @@
:loading="btnLoginLoading">
Login
</Button>
<a v-if="websiteConf.allow_register" @click.stop="handleUpdateProp('update:mode', 'register')">No account? Register now!</a>
<a v-if="website.allow_register" @click.stop="handleBtnClick('register')">No account? Register now!</a>
<a @click.stop="goResetPassword" style="float: right">Forget Password</a>
</template>
<template v-else>
@ -82,7 +82,7 @@
</Button>
<Button
type="ghost"
@click="handleUpdateProp('update:mode', 'login')"
@click="handleBtnClick('login')"
class="btn" long>
Already registed? Login now!
</Button>
@ -92,28 +92,13 @@
</template>
<script>
import {mapGetters, mapActions} from 'vuex'
import api from '@/api'
import auth from '@/utils/auth'
import utils from '@/utils/utils'
import {FormMixin} from '~/mixins'
export default {
mixins: [FormMixin],
props: {
visible: {
required: true,
type: Boolean,
default: true
},
mode: {
required: true,
type: String,
// login or register
default: 'login'
}
},
mounted() {
this.websiteConf = utils.getWebsiteConf()
},
data() {
const CheckUsernameNotExist = (rule, value, callback) => {
@ -161,7 +146,6 @@
tfaRequired: false,
btnRegisterLoading: false,
btnLoginLoading: false,
websiteConf: {},
formRegister: {
username: '',
password: '',
@ -206,8 +190,12 @@
}
},
methods: {
handleUpdateProp(eventName, value) {
this.$emit(eventName, value)
...mapActions(['changeModalStatus', 'getProfile']),
handleBtnClick(mode) {
this.changeModalStatus({
mode,
visible: true
})
},
handleRegister() {
this.validateForm('formRegister').then(valid => {
@ -234,37 +222,27 @@
}
api.login(formData).then(res => {
this.btnLoginLoading = false
api.getUserInfo().then(res => {
auth.setUser(res.data.data)
this.$bus.$emit('login-success', res.data.data)
this.$success('Welcome back to OJ')
this.handleUpdateProp('update:visible', false)
})
this.changeModalStatus({visible: false})
this.getProfile()
this.$success('Welcome back to OJ')
}, _ => {
this.btnLoginLoading = false
})
})
},
goResetPassword() {
this.handleUpdateProp('update:visible', false)
this.changeModalStatus({visible: false})
this.$router.push({name: 'apply-reset-password'})
}
},
watch: {
'mode'(newVal) {
if (newVal === 'login') {
this.$nextTick(() => {
this.$refs['formLogin'].resetFields()
})
} else {
this.$nextTick(() => {
this.$refs['formRegister'].resetFields()
})
}
},
'visible'(newVal) {
if (newVal === true && this.mode === 'register') {
this.getCaptchaSrc()
computed: {
...mapGetters(['website', 'modalStatus']),
visible: {
get() {
return this.modalStatus.visible
},
set(value) {
this.changeModalStatus({visible: value})
}
}
}

View File

@ -3,14 +3,12 @@
<script>
import api from '../../api.js'
import auth from '@/utils/auth'
export default {
mounted() {
api.logout().then(res => {
this.$success('logout succeeded')
auth.clear()
this.$bus.$emit('logout')
this.$store.dispatch('clearProfile')
this.$router.replace({
path: '/'
})