fix: 请求成功的判断条件code改为status(部分)

This commit is contained in:
chenjinsong
2023-08-24 17:15:41 +08:00
parent 7b0ec06a05
commit 21f32dfdda
75 changed files with 422 additions and 5595 deletions

View File

@@ -39,7 +39,6 @@
<script>
import { mapActions } from 'vuex'
import { get } from '@/utils/http'
import axios from 'axios'
import { useRouter } from 'vue-router'
import { storageKey, defaultLang } from '@/utils/constants'
@@ -72,7 +71,7 @@ export default {
this.loading = true
axios.post(api.login, { username: this.username, pin: this.pin }).then(
res => {
if (res.data.code === 200) {
if (res.status === 200) {
if (!_.isEmpty(res.data.data.user.lang)) {
localStorage.setItem(storageKey.language, res.data.data.user.lang)
}
@@ -103,9 +102,9 @@ export default {
})
},
queryAppearance () {
get(api.appearance).then(res => {
if (res.code === 200) {
this.appearanceOut(res.data)
axios.get(api.appearance).then(res => {
if (res.status === 200) {
this.appearanceOut(res.data.data)
}
})
},