登录接口格式
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import {post} from '@js/http.js'
|
||||
|
||||
/** 登陆 */
|
||||
export const screenLogin = (user, password) => post('api/bigScreenScreen/login', {
|
||||
user: user,
|
||||
password: password
|
||||
})
|
||||
|
||||
export const screenZK = (id, cid) => post('api/bigScreenScreen/zk', {
|
||||
accountId: id,
|
||||
center_id: cid
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {screenLogin} from '@js/getData2.js'
|
||||
export default {
|
||||
name: 'Login',
|
||||
data () {
|
||||
@@ -115,7 +116,7 @@ export default {
|
||||
this.drift = num
|
||||
this.heightLimit = num === 50
|
||||
},
|
||||
_login () {
|
||||
async _login () {
|
||||
if (this.loginname === '') {
|
||||
this.toast('用户名不能为空')
|
||||
return
|
||||
@@ -124,62 +125,49 @@ export default {
|
||||
this.toast('密码不能为空')
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
'_SRVNAME': 'server.app.screenAPI',
|
||||
'_SRVMETHOD': 'verifyAccount',
|
||||
'_DATA': JSON.stringify({
|
||||
form: {
|
||||
loginname: this.loginname,
|
||||
password: this.password
|
||||
}
|
||||
})
|
||||
}
|
||||
this
|
||||
.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.$store.dispatch('setUserInfo', res.result)
|
||||
if (this.equipId === 1) {
|
||||
this.$router.push('/workshop')
|
||||
} else {
|
||||
if (this.stationCode === '070') {
|
||||
this.$router.push('/storagetank')
|
||||
} else if (this.stationCode === '090') {
|
||||
this.$router.push('/storageData')
|
||||
} else {
|
||||
// 原先看板+新看板
|
||||
// this.$router.push('/producedata')
|
||||
this.$router.push('/kanbanSelect')
|
||||
}
|
||||
}
|
||||
let element = document.documentElement
|
||||
if (this.fullscreen) {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen()
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen()
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen()
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen()
|
||||
}
|
||||
} else {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen()
|
||||
} else if (element.webkitRequestFullScreen) {
|
||||
element.webkitRequestFullScreen()
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen()
|
||||
} else if (element.msRequestFullscreen) {
|
||||
// IE11
|
||||
element.msRequestFullscreen()
|
||||
}
|
||||
}
|
||||
this.fullscreen = !this.fullscreen
|
||||
let res = await screenLogin(this.loginname, this.password)
|
||||
if (res.code === '1') {
|
||||
this.$store.dispatch('setUserInfo', res.result)
|
||||
if (this.equipId === 1) {
|
||||
this.$router.push('/workshop')
|
||||
} else {
|
||||
if (this.stationCode === '070') {
|
||||
this.$router.push('/storagetank')
|
||||
} else if (this.stationCode === '090') {
|
||||
this.$router.push('/storageData')
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
// 原先看板+新看板
|
||||
// this.$router.push('/producedata')
|
||||
this.$router.push('/kanbanSelect')
|
||||
}
|
||||
})
|
||||
}
|
||||
let element = document.documentElement
|
||||
if (this.fullscreen) {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen()
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen()
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen()
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen()
|
||||
}
|
||||
} else {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen()
|
||||
} else if (element.webkitRequestFullScreen) {
|
||||
element.webkitRequestFullScreen()
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen()
|
||||
} else if (element.msRequestFullscreen) {
|
||||
// IE11
|
||||
element.msRequestFullscreen()
|
||||
}
|
||||
}
|
||||
this.fullscreen = !this.fullscreen
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
_config () {
|
||||
let obj = {
|
||||
|
||||
Reference in New Issue
Block a user