[更新]基础框架,登录流程

This commit is contained in:
唐明明
2020-12-27 09:54:49 +08:00
parent 286f8111bd
commit 49275bc648
125 changed files with 2611 additions and 167 deletions

View File

@@ -3,8 +3,8 @@ import {errInfo} from './err'
import {updToken} from './updateToken'
// 请求方式配置
// const api = "https://mi-org.cnskl.com/api/"
const api = "https://new-web-test.cnskl.com/api/"
// const api = "https://mi-org.cnskl.com/api/"
const header = {
"Accept": "application/json"
}
@@ -36,11 +36,13 @@ const req = (obj) => {
if (res.data.status_code == 200) {
resolve(res.data.data)
} else {
if (res.data.status_code == 401 || res.data.status_code == 400) {
if (res.data.status_code == 401) {
reject({
login : false,
codeBeen: false
})
} else{
reject(res.data)
}
errInfo(res.data)
}
@@ -70,7 +72,6 @@ const upload = (obj) => {
title: "上传中..",
mask: true
})
wx.uploadFile({
url : api + obj.url,
header : header,
@@ -87,10 +88,9 @@ const upload = (obj) => {
if (jsonData.status_code == 200) {
resolve(jsonData.data)
} else {
if (res.data.status_code == 401 || res.data.status_code == 400) {
if (jsonData.status_code == 401) {
reject({
login : false,
codeBeen: false
login: false
})
}
errInfo(jsonData)