Revert "Merge branch 'openapi'"

This reverts commit 9a6f0acdf0, reversing
changes made to 08a81e433b.
This commit is contained in:
feige996
2025-09-23 18:01:20 +08:00
parent 459c665ecb
commit 3b14ab942f
15 changed files with 784 additions and 149 deletions

View File

@@ -1,5 +1,5 @@
import type { IDoubleTokenRes } from '@/api/types/login'
import type { CustomRequestOptions, HttpRequestResult, IResponse } from '@/http/types'
import type { CustomRequestOptions, IResponse } from '@/http/types'
import { nextTick } from 'vue'
import { LOGIN_PAGE } from '@/router/config'
import { useTokenStore } from '@/store/token'
@@ -10,7 +10,7 @@ import { ResultEnum } from './tools/enum'
let refreshing = false // 防止重复刷新 token 标识
let taskQueue: { resolve: (value: any) => void, reject: (reason?: any) => void, options: CustomRequestOptions }[] = [] as { resolve: (value: any) => void, reject: (reason?: any) => void, options: CustomRequestOptions }[] // 刷新 token 请求队列
export function http<T>(options: CustomRequestOptions): HttpRequestResult<T> {
export function http<T>(options: CustomRequestOptions) {
let requestTask: UniApp.RequestTask | undefined
const promise = new Promise<T>((resolve, reject) => {
requestTask = uni.request({

View File

@@ -1,4 +1,4 @@
import type { CustomRequestOptions, HttpRequestResult } from '@/http/types'
import type { CustomRequestOptions } from '@/http/types'
import { http } from './http'
/*
@@ -10,7 +10,7 @@ export default function request<T = unknown>(
params?: Record<string, unknown>
headers?: Record<string, unknown>
},
): HttpRequestResult<T> {
) {
const requestOptions = {
url,
...options,