Commit b51147891f4da09ec99ba68a7b731bf3fd617aa7
1 parent
c9033522
更新代码
Showing
11 changed files
with
30 additions
and
104 deletions
.env.development
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | ENV = 'development' | 2 | ENV = 'development' |
| 3 | 3 | ||
| 4 | # base api | 4 | # base api |
| 5 | -VUE_APP_BASE_API = '/dev-api' | 5 | +VUE_APP_BASE_API = '/api' |
| 6 | 6 | ||
| 7 | # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, | 7 | # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, |
| 8 | # to control whether the babel-plugin-dynamic-import-node plugin is enabled. | 8 | # to control whether the babel-plugin-dynamic-import-node plugin is enabled. |
.env.production
package.json
| @@ -12,7 +12,9 @@ | @@ -12,7 +12,9 @@ | ||
| 12 | "lint": "eslint --ext .js,.vue src", | 12 | "lint": "eslint --ext .js,.vue src", |
| 13 | "test:unit": "jest --clearCache && vue-cli-service test:unit", | 13 | "test:unit": "jest --clearCache && vue-cli-service test:unit", |
| 14 | "test:ci": "npm run lint && npm run test:unit", | 14 | "test:ci": "npm run lint && npm run test:unit", |
| 15 | - "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" | 15 | + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", |
| 16 | + "start": "node index.js", | ||
| 17 | + "server": "nodemon index.js --ignore client" | ||
| 16 | }, | 18 | }, |
| 17 | "dependencies": { | 19 | "dependencies": { |
| 18 | "axios": "0.18.1", | 20 | "axios": "0.18.1", |
src/api/user.js
| @@ -2,7 +2,7 @@ import request from '@/utils/request' | @@ -2,7 +2,7 @@ import request from '@/utils/request' | ||
| 2 | 2 | ||
| 3 | export function login(data) { | 3 | export function login(data) { |
| 4 | return request({ | 4 | return request({ |
| 5 | - url: '/vue-admin-template/user/login', | 5 | + url: '/login', |
| 6 | method: 'post', | 6 | method: 'post', |
| 7 | data | 7 | data |
| 8 | }) | 8 | }) |
src/main.js
| @@ -33,10 +33,10 @@ Vue.component(CollapseTransition.name, CollapseTransition) | @@ -33,10 +33,10 @@ Vue.component(CollapseTransition.name, CollapseTransition) | ||
| 33 | * Currently MockJs will be used in the production environment, | 33 | * Currently MockJs will be used in the production environment, |
| 34 | * please remove it before going online ! ! ! | 34 | * please remove it before going online ! ! ! |
| 35 | */ | 35 | */ |
| 36 | -if (process.env.NODE_ENV === 'production') { | ||
| 37 | - const { mockXHR } = require('../mock') | ||
| 38 | - mockXHR() | ||
| 39 | -} | 36 | +// if (process.env.NODE_ENV === 'production') { |
| 37 | +// const { mockXHR } = require('../mock') | ||
| 38 | +// mockXHR() | ||
| 39 | +// } | ||
| 40 | 40 | ||
| 41 | // set ElementUI lang to EN | 41 | // set ElementUI lang to EN |
| 42 | Vue.use(ElementUI, { locale }) | 42 | Vue.use(ElementUI, { locale }) |
src/utils/request.js
| @@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth' | @@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth' | ||
| 7 | const service = axios.create({ | 7 | const service = axios.create({ |
| 8 | baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url | 8 | baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url |
| 9 | // withCredentials: true, // send cookies when cross-domain requests | 9 | // withCredentials: true, // send cookies when cross-domain requests |
| 10 | - timeout: 5000 // request timeout | 10 | + timeout: 15000 // request timeout |
| 11 | }) | 11 | }) |
| 12 | 12 | ||
| 13 | // request interceptor | 13 | // request interceptor |
src/views/account/index.vue
| @@ -227,7 +227,8 @@ export default { | @@ -227,7 +227,8 @@ export default { | ||
| 227 | </script> | 227 | </script> |
| 228 | <style scoped> | 228 | <style scoped> |
| 229 | .app-container{ | 229 | .app-container{ |
| 230 | - max-width: 1100px; | 230 | + max-width: 1700px; |
| 231 | + min-width: 1100px; | ||
| 231 | background: #fff; | 232 | background: #fff; |
| 232 | margin:0 auto; | 233 | margin:0 auto; |
| 233 | margin-top:15px; | 234 | margin-top:15px; |
src/views/home/index.vue
| @@ -198,7 +198,8 @@ export default { | @@ -198,7 +198,8 @@ export default { | ||
| 198 | <style lang="scss" scoped> | 198 | <style lang="scss" scoped> |
| 199 | .dashboard { | 199 | .dashboard { |
| 200 | &-container { | 200 | &-container { |
| 201 | - max-width: 1100px; | 201 | + max-width: 1700px; |
| 202 | + min-width: 1100px; | ||
| 202 | margin: 0 auto; | 203 | margin: 0 auto; |
| 203 | background: #fff; | 204 | background: #fff; |
| 204 | margin-top: 15px; | 205 | margin-top: 15px; |
src/views/login/index.vue
| @@ -56,11 +56,11 @@ | @@ -56,11 +56,11 @@ | ||
| 56 | <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" /> | 56 | <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" /> |
| 57 | </span> | 57 | </span> |
| 58 | </el-form-item> | 58 | </el-form-item> |
| 59 | - | 59 | + <el-checkbox v-model="auto">自动登录</el-checkbox> |
| 60 | <el-button | 60 | <el-button |
| 61 | :loading="loading" | 61 | :loading="loading" |
| 62 | type="primary" | 62 | type="primary" |
| 63 | - style="width:80%;display:block;margin:0 auto; margin-bottom:30px;" | 63 | + style="width:80%;display:block;margin:0 auto; margin-bottom:30px;margin-top:10px;" |
| 64 | round | 64 | round |
| 65 | @click.native.prevent="handleLogin" | 65 | @click.native.prevent="handleLogin" |
| 66 | >登录</el-button> | 66 | >登录</el-button> |
| @@ -108,7 +108,9 @@ export default { | @@ -108,7 +108,9 @@ export default { | ||
| 108 | }, | 108 | }, |
| 109 | loading: false, | 109 | loading: false, |
| 110 | passwordType: 'password', | 110 | passwordType: 'password', |
| 111 | - redirect: undefined | 111 | + redirect: undefined, |
| 112 | + auto: false | ||
| 113 | + | ||
| 112 | } | 114 | } |
| 113 | }, | 115 | }, |
| 114 | watch: { | 116 | watch: { |
src/views/testpaper/page/creatpaper.vue
| @@ -249,95 +249,6 @@ export default { | @@ -249,95 +249,6 @@ export default { | ||
| 249 | testtime: '' | 249 | testtime: '' |
| 250 | }, | 250 | }, |
| 251 | paperdata: [ | 251 | paperdata: [ |
| 252 | - { | ||
| 253 | - title: '一、单选题', | ||
| 254 | - type: 1, | ||
| 255 | - total: 4, | ||
| 256 | - info: [ | ||
| 257 | - { | ||
| 258 | - rank: 1, | ||
| 259 | - score: 1, | ||
| 260 | - num: 4, | ||
| 261 | - right: 'A' | ||
| 262 | - }, | ||
| 263 | - { | ||
| 264 | - rank: 2, | ||
| 265 | - score: 1, | ||
| 266 | - num: 4, | ||
| 267 | - right: 'B' | ||
| 268 | - } | ||
| 269 | - ] | ||
| 270 | - }, | ||
| 271 | - { | ||
| 272 | - title: '二、多选题', | ||
| 273 | - type: 2, | ||
| 274 | - total: 4, | ||
| 275 | - info: [ | ||
| 276 | - { | ||
| 277 | - rank: 1, | ||
| 278 | - score: 1, | ||
| 279 | - num: 4, | ||
| 280 | - right: 'AB' | ||
| 281 | - }, | ||
| 282 | - { | ||
| 283 | - rank: 2, | ||
| 284 | - score: 1, | ||
| 285 | - num: 4, | ||
| 286 | - right: 'BD' | ||
| 287 | - } | ||
| 288 | - ] | ||
| 289 | - }, | ||
| 290 | - { | ||
| 291 | - title: '三、判断题', | ||
| 292 | - type: 3, | ||
| 293 | - total: 4, | ||
| 294 | - info: [ | ||
| 295 | - { | ||
| 296 | - rank: 1, | ||
| 297 | - score: 1, | ||
| 298 | - right: '✔' | ||
| 299 | - }, | ||
| 300 | - { | ||
| 301 | - rank: 2, | ||
| 302 | - score: 1, | ||
| 303 | - right: '✘' | ||
| 304 | - } | ||
| 305 | - ] | ||
| 306 | - }, | ||
| 307 | - { | ||
| 308 | - title: '四、数字题', | ||
| 309 | - type: 4, | ||
| 310 | - total: 4, | ||
| 311 | - info: [ | ||
| 312 | - { | ||
| 313 | - rank: 1, | ||
| 314 | - score: 1, | ||
| 315 | - right: '2.75' | ||
| 316 | - }, | ||
| 317 | - { | ||
| 318 | - rank: 2, | ||
| 319 | - score: 1, | ||
| 320 | - right: '12.3' | ||
| 321 | - } | ||
| 322 | - ] | ||
| 323 | - }, | ||
| 324 | - { | ||
| 325 | - title: '五、排序题', | ||
| 326 | - type: 5, | ||
| 327 | - total: 4, | ||
| 328 | - info: [ | ||
| 329 | - { | ||
| 330 | - rank: 1, | ||
| 331 | - score: 1, | ||
| 332 | - right: '12345' | ||
| 333 | - }, | ||
| 334 | - { | ||
| 335 | - rank: 2, | ||
| 336 | - score: 1, | ||
| 337 | - right: '54312' | ||
| 338 | - } | ||
| 339 | - ] | ||
| 340 | - } | ||
| 341 | ] | 252 | ] |
| 342 | } | 253 | } |
| 343 | }, | 254 | }, |
vue.config.js
| @@ -36,7 +36,16 @@ module.exports = { | @@ -36,7 +36,16 @@ module.exports = { | ||
| 36 | warnings: false, | 36 | warnings: false, |
| 37 | errors: true | 37 | errors: true |
| 38 | }, | 38 | }, |
| 39 | - before: require('./mock/mock-server.js') | 39 | + proxy: { |
| 40 | + '/api': { | ||
| 41 | + target: 'http://localhost:8080', // 这个链接是要代理到的api地址 | ||
| 42 | + changeOrigin: false, | ||
| 43 | + pathRewrite: { | ||
| 44 | + '^/api': '' | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + // before: require('./mock/mock-server.js') | ||
| 40 | }, | 49 | }, |
| 41 | configureWebpack: { | 50 | configureWebpack: { |
| 42 | // provide the app's title in webpack's name field, so that | 51 | // provide the app's title in webpack's name field, so that |