登录接口格式

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,19 +125,7 @@ export default {
this.toast('密码不能为空') this.toast('密码不能为空')
return return
} }
let data = { let res = await screenLogin(this.loginname, this.password)
'_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') { if (res.code === '1') {
this.$store.dispatch('setUserInfo', res.result) this.$store.dispatch('setUserInfo', res.result)
if (this.equipId === 1) { if (this.equipId === 1) {
@@ -179,7 +168,6 @@ export default {
} else { } else {
this.Dialog(res.desc) this.Dialog(res.desc)
} }
})
}, },
_config () { _config () {
let obj = { let obj = {