Giter Site home page Giter Site logo

axits's People

Contributors

kinglisky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axits's Issues

作者你好,请问为啥我的header没有带去后端?

import {APISchema} from './axios/type';
import {createRequestClient} from './axios/request';
import {RegisterParams} from "@/api/model/user";
import {getCookies} from "@/utils/auth";

interface UserSchema extends APISchema {
userLogin: {
request: {
username: string;
passwordHash: string;
}
response: {
code: number,
data: {
token: string
},
msg: string
}

};
userRegister: {
request: {
user: RegisterParams, captchaCode: string, captchaId: string
};
response: {
code: number,
data: {},
msg: string
}
};
logout: {
request: {};
response: {
code: number,
data: {},
msg: string
};
};
getUserInfo: {
request: {};
response: {
code: number,
data: {
id: string | number;
username: string;
nickname: string;
sex: string;
avatar: string;
description?: string;

  },
  msg: string
};

};
savaUserInfo: {
request: {
userinfo: string
};
response: {
code: number,
data: {
token: string
},
msg: string
};
};
}
const token=getCookies('TOKEN__')
export const userApi = createRequestClient({
baseURL: process.env.NODE_ENV === 'development'
? process.env.VUE_APP_API_HOST + ''
: '',
apis: {
userLogin:'POST /login',
userRegister: 'POST /register',
logout: {
path: '/logout',
method: 'POST',
headers: {'token': token}
},
getUserInfo: {
path: '/user',
method: 'GET',
headers: {'token': token}
},
savaUserInfo: 'PUT api/user',
}
});

请教一下 ts 书籍推荐,比如讲过 indexSigature的

刚接触 typescript 时在知乎上看到您关于 axios 封装的文章 ,太nb了
最近练手 ,尝试 按文章思路 封装 axios ,碰到 参数类型有 indexSigature 时 不能按预期约束传参 的问题,但官方文档没找到这方面的内容,只能试错推测

请教大神 推荐 相关的 博客,书,项目

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.