61 lines
1.2 KiB
JavaScript
61 lines
1.2 KiB
JavaScript
import baseurl from '../baseurl.js'
|
|
import requesttwo from '../request.js'
|
|
|
|
var request = function(config) {
|
|
return new Promise((resolve, rejected) => {
|
|
uni.showLoading({
|
|
title: ''
|
|
});
|
|
uni.request({
|
|
url: baseurl + config.url,
|
|
data: config.data,
|
|
method: config.method,
|
|
timeout: 50000,
|
|
header: {
|
|
'token': uni.getStorageSync('token'),
|
|
'mobileLogin': true,
|
|
"content-type": "application/x-www-form-urlencoded"
|
|
},
|
|
success(res) {
|
|
if (res.data.errorCode == 'B1002' && res.data.msg == '用户账号密码错误(或登录超时)') {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: res.data.msg,
|
|
duration: 1500
|
|
});
|
|
setTimeout(function() {
|
|
uni.reLaunch({
|
|
url: '/pages/login/login'
|
|
})
|
|
|
|
uni.removeStorageSync('token')
|
|
|
|
}, 1500);
|
|
|
|
}
|
|
uni.hideLoading();
|
|
resolve(res.data)
|
|
},
|
|
fail(err) {
|
|
uni.hideLoading();
|
|
rejected(err)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
// 评价机构名称
|
|
export function pjjgListno() {
|
|
return requesttwo({
|
|
url: `/dzzyb/a/zyb/logon/pjjgListno`,
|
|
method: 'post',
|
|
})
|
|
}
|
|
// 提交
|
|
export function insertJcxxno(data) {
|
|
return request({
|
|
url: `/dzzyb/a/zyb/logon/insertJcxxno`,
|
|
method: 'post',
|
|
data: data,
|
|
})
|
|
} |