登录接口格式

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'
/** 登陆 */
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

View File

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