对接签名提交,工资详情查询
This commit is contained in:
+30
-9
@@ -1,31 +1,52 @@
|
||||
/*首页*/
|
||||
import { request, requestLogin } from "./index.js";
|
||||
import {
|
||||
request,
|
||||
requestLogin
|
||||
} from "./index.js";
|
||||
|
||||
// 登录
|
||||
export function getToken(authCode){
|
||||
export function getToken(authCode) {
|
||||
return requestLogin({
|
||||
method: "GET",
|
||||
url: `/login?code=${authCode}`,
|
||||
data: {
|
||||
},
|
||||
data: {},
|
||||
Header1: {
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取用户信息
|
||||
export function getUser(authCode){
|
||||
export function getUser(authCode) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/user",
|
||||
data: {
|
||||
},
|
||||
data: {},
|
||||
})
|
||||
}
|
||||
// 获取绩效考勤统计
|
||||
export function getPerformanceAttendanceApi(year,month){
|
||||
export function getPerformanceAttendanceApi(year, month) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: `/performance/attendance/detail/${year}/${month}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 工资条查询
|
||||
export function getPayrollSheets(year, month) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: `/payroll/sheets/detail/${year}/${month}`,
|
||||
})
|
||||
}
|
||||
|
||||
// 签字提交
|
||||
export function signatureOfMeetingMinutesApi(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: `/performance/attendance/emp/approve`,
|
||||
data: data,
|
||||
header: {
|
||||
'content-type': 'application/json' // 设置请求头为 JSON 格式
|
||||
}
|
||||
})
|
||||
}
|
||||
+86
-44
@@ -1,68 +1,95 @@
|
||||
|
||||
import allUrl from "./baseUrl.js"
|
||||
import allUrl from "./baseUrl.js"
|
||||
// const baseUrl = bootUrl
|
||||
export function request ( optaions ) {
|
||||
let { url, method, data, header1 } = optaions
|
||||
export function request(optaions) {
|
||||
let {
|
||||
url,
|
||||
method,
|
||||
data,
|
||||
header1
|
||||
} = optaions
|
||||
method = method || "GET"
|
||||
data = data || {}
|
||||
let newData = {}
|
||||
for( let key in data){
|
||||
if( data[key] !== null && data[key] !== ''){
|
||||
for (let key in data) {
|
||||
if (data[key] !== null && data[key] !== '') {
|
||||
newData[key] = data[key]
|
||||
}
|
||||
}
|
||||
data = newData || {}
|
||||
header1 = header1 || {
|
||||
header1 = header1 || {
|
||||
Authorization: 'Bearer ' + uni.getStorageSync('token')
|
||||
}
|
||||
return new Promise((reslove,reject)=>{
|
||||
}
|
||||
return new Promise((reslove, reject) => {
|
||||
uni.request({
|
||||
url: allUrl + url,
|
||||
method,
|
||||
header: header1,
|
||||
data,
|
||||
success: (res) => {
|
||||
if(res.data.errcode == 401 ){
|
||||
uni.showToast({ title: '登录已失效,即将重新登录!', icon: 'none' });
|
||||
if (res.data.errcode == 401) {
|
||||
uni.showToast({
|
||||
title: '登录已失效,即将重新登录!',
|
||||
icon: 'none'
|
||||
});
|
||||
uni.removeStorageSync('userInfo');
|
||||
uni.removeStorageSync('token');
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/homePage/homePage'
|
||||
});
|
||||
}, 1000);
|
||||
}else if(res.data.errcode != 0){
|
||||
} else if (res.data.errcode != 0) {
|
||||
console.log('不正确走的')
|
||||
reject(res)
|
||||
uni.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 });
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
} else {
|
||||
reslove(res.data)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('请求失败',err)
|
||||
console.log('请求失败', err)
|
||||
uni.hideLoading()
|
||||
if(err.statusCode == 401 ){
|
||||
uni.showToast({ title: '登录已失效,即将重新登录!', icon: 'none' });
|
||||
if (err.statusCode == 401) {
|
||||
uni.showToast({
|
||||
title: '登录已失效,即将重新登录!',
|
||||
icon: 'none'
|
||||
});
|
||||
uni.removeStorageSync('userInfo');
|
||||
uni.removeStorageSync('token');
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/homePage/homePage'
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
if(err.data.errcode == 401 ){
|
||||
uni.showToast({ title: '登录已失效,即将重新登录!', icon: 'none' });
|
||||
if (err.data.errcode == 401) {
|
||||
uni.showToast({
|
||||
title: '登录已失效,即将重新登录!',
|
||||
icon: 'none'
|
||||
});
|
||||
uni.removeStorageSync('userInfo');
|
||||
uni.removeStorageSync('token');
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
|
||||
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/homePage/homePage'
|
||||
});
|
||||
}, 1000);
|
||||
}else{
|
||||
uni.showToast({ title: err.data.errmsg, icon: 'none' });
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: err.data.errmsg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
reject()
|
||||
},
|
||||
complete: () => {
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 2000)
|
||||
}
|
||||
@@ -71,37 +98,52 @@ export function request ( optaions ) {
|
||||
}
|
||||
|
||||
|
||||
export function requestLogin ( optaions ) {
|
||||
let { url, method, data } = optaions
|
||||
export function requestLogin(optaions) {
|
||||
let {
|
||||
url,
|
||||
method,
|
||||
data,
|
||||
header
|
||||
} = optaions
|
||||
method = method || "GET"
|
||||
data = data || {}
|
||||
let newData = {}
|
||||
for( let key in data){
|
||||
if( data[key] !== null && data[key] !== ''){
|
||||
for (let key in data) {
|
||||
if (data[key] !== null && data[key] !== '') {
|
||||
newData[key] = data[key]
|
||||
}
|
||||
}
|
||||
data = newData || {}
|
||||
return new Promise((reslove,reject)=>{
|
||||
return new Promise((reslove, reject) => {
|
||||
uni.request({
|
||||
url: allUrl + url,
|
||||
method,
|
||||
data,
|
||||
header,
|
||||
success: (res) => {
|
||||
if(res.statusCode == 401 ){
|
||||
uni.showToast({ title: '登录已失效,即将返回首页!', icon: 'none' });
|
||||
if (res.statusCode == 401) {
|
||||
uni.showToast({
|
||||
title: '登录已失效,即将返回首页!',
|
||||
icon: 'none'
|
||||
});
|
||||
uni.removeStorageSync('userInfo');
|
||||
uni.removeStorageSync('token');
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
|
||||
}, 1000);
|
||||
}else if(res.statusCode != 200){
|
||||
// setTimeout(() => {
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/homePage/homePage'
|
||||
// });
|
||||
// }, 1000);
|
||||
} else if (res.statusCode != 200) {
|
||||
reject(res)
|
||||
uni.showToast({ title: res.data.msg, icon: 'none', duration: 2000 });
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
} else {
|
||||
reslove(res.data)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
fail: () => {
|
||||
reject()
|
||||
@@ -111,4 +153,4 @@ export function requestLogin ( optaions ) {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user