优化:去掉不必要的loading
This commit is contained in:
@@ -8,7 +8,7 @@ import type { ILoginResponse } from '@/types/user'
|
||||
* @param code 验证码
|
||||
*/
|
||||
export async function loginWithCode(tel: string, code: string) {
|
||||
const res = await mainClient.request<IApiResponse<ILoginResponse>>({
|
||||
const res = await mainClient.request<ILoginResponse>({
|
||||
url: 'book/user/registerOrLogin',
|
||||
method: 'GET',
|
||||
data: { tel, code }
|
||||
@@ -22,7 +22,7 @@ export async function loginWithCode(tel: string, code: string) {
|
||||
* @param password 密码
|
||||
*/
|
||||
export async function loginWithPassword(phone: string, password: string) {
|
||||
const res = await mainClient.request<IApiResponse<ILoginResponse>>({
|
||||
const res = await mainClient.request<ILoginResponse>({
|
||||
url: 'book/user/login',
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
|
||||
@@ -22,7 +22,7 @@ export const commonApi = {
|
||||
* @param id 协议 ID (111: 用户协议, 112: 隐私政策)
|
||||
*/
|
||||
getAgreement: async (id: number) => {
|
||||
const res = await mainClient.request<IApiResponse<IAgreement>>({
|
||||
const res = await skeletonClient.request<IApiResponse<IAgreement>>({
|
||||
url: 'sys/agreement/getAgreement',
|
||||
method: 'POST',
|
||||
data: { id }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// api/modules/user.ts
|
||||
import { mainClient } from '@/api/clients/main'
|
||||
import { mainClient, skeletonClient } from '@/api/clients'
|
||||
import { paymentClient } from '@/api/clients/payment'
|
||||
import type { IApiResponse } from '@/api/types'
|
||||
import type {
|
||||
@@ -17,7 +17,7 @@ import { SERVICE_MAP } from '@/api/config'
|
||||
* 获取用户信息
|
||||
*/
|
||||
export async function getUserInfo() {
|
||||
const res = await mainClient.request<IApiResponse<{ user: IUserInfo }>>({
|
||||
const res = await skeletonClient.request<IApiResponse<{ user: IUserInfo }>>({
|
||||
url: 'common/user/getUserInfo',
|
||||
method: 'POST'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user