登录接口格式

This commit is contained in:
2022-07-13 14:34:28 +08:00
parent 9332d9304a
commit c1f8d1cdba
2 changed files with 49 additions and 55 deletions

View File

@@ -1,5 +1,11 @@
import {post} from '@js/http.js' 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', { export const screenZK = (id, cid) => post('api/bigScreenScreen/zk', {
accountId: id, accountId: id,
center_id: cid center_id: cid

View File

@@ -84,6 +84,7 @@
</template> </template>
<script> <script>
import {screenLogin} from '@js/getData2.js'
export default { export default {
name: 'Login', name: 'Login',
data () { data () {
@@ -115,7 +116,7 @@ export default {
this.drift = num this.drift = num
this.heightLimit = num === 50 this.heightLimit = num === 50
}, },
_login () { async _login () {
if (this.loginname === '') { if (this.loginname === '') {
this.toast('用户名不能为空') this.toast('用户名不能为空')
return return
@@ -124,62 +125,49 @@ export default {
this.toast('密码不能为空') this.toast('密码不能为空')
return return
} }
let data = { let res = await screenLogin(this.loginname, this.password)
'_SRVNAME': 'server.app.screenAPI', if (res.code === '1') {
'_SRVMETHOD': 'verifyAccount', this.$store.dispatch('setUserInfo', res.result)
'_DATA': JSON.stringify({ if (this.equipId === 1) {
form: { this.$router.push('/workshop')
loginname: this.loginname, } else {
password: this.password if (this.stationCode === '070') {
} this.$router.push('/storagetank')
}) } else if (this.stationCode === '090') {
} this.$router.push('/storageData')
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
} else { } 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 () { _config () {
let obj = { let obj = {