fix: wrong api & services

This commit is contained in:
Dawn1Ocean
2024-04-12 01:51:22 +08:00
parent b68e3db0a3
commit 3313307e84
4 changed files with 24 additions and 3 deletions
+9 -2
View File
@@ -4,6 +4,8 @@ import pt from '@/plain-text';
import wechatUser from '@/wechat';
import { getUrl } from '.';
const reLaunchInterval = 1000;
export function askLeave(that: AskLeavePage) {
that.setState({
isLoading: true,
@@ -13,8 +15,8 @@ export function askLeave(that: AskLeavePage) {
method: 'POST',
data: {
token: wechatUser.getToken(),
week: that.state.range[0][that.state.shift[0]],
shift: that.state.range[1][that.state.shift[1]],
week: (that.state.shift[0] + 1).toString(),
shift: (that.state.shift[1] + 1).toString(),
reason: that.state.reason,
substitute: that.state.substitute,
},
@@ -28,6 +30,11 @@ export function askLeave(that: AskLeavePage) {
message: pt.get().button.submitText.success,
type: 'success',
});
setTimeout(() => {
Taro.reLaunch({
url: '/pages/index/index',
});
}, reLaunchInterval);
})
.catch((err) => {
console.log(err.errMsg);
+1 -1
View File
@@ -11,7 +11,7 @@ export function changeDutyCnt(that: MainPage) {
isLoading: true,
});
Taro.request({
url: getUrl('/tickets/addtooreo'),
url: getUrl('/member/dutycnt'),
method: 'POST',
data: {
token: wechatUser.getToken(),