Browse Source

登录默认选项调整

pull/14/head
liwei 3 years ago
parent
commit
9b0a0ba9c7
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      .env.production
  2. +3
    -2
      src/views/login/index.vue

+ 1
- 1
.env.production View File

@ -5,4 +5,4 @@ NODE_ENV = 'production'
# 正式环境 # 正式环境
VUE_APP_BASE_API = 'http://8.140.133.55:8096' VUE_APP_BASE_API = 'http://8.140.133.55:8096'
# 测试环境 # 测试环境
#VUE_APP_BASE_API = 'http://8.140.133.55:8090'
# VUE_APP_BASE_API = 'http://8.140.133.55:8090'

+ 3
- 2
src/views/login/index.vue View File

@ -79,7 +79,7 @@ export default {
loginForm: { loginForm: {
userid: '', userid: '',
password: '', password: '',
pid: 100
pid: ""
}, },
loginRules: { loginRules: {
pid: [{ required: true, trigger: 'blur', message: '不能为空' }], pid: [{ required: true, trigger: 'blur', message: '不能为空' }],
@ -123,7 +123,8 @@ export default {
getPlants() { getPlants() {
getCourts().then((res) => { getCourts().then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.options = res.data
this.options = res.data || [];
this.loginForm.pid = this.options[0].cid || "";
localStorage.setItem('cid', JSON.stringify(this.options)) localStorage.setItem('cid', JSON.stringify(this.options))
} }
}) })


Loading…
Cancel
Save