refactor: typings 不用导出

This commit is contained in:
菲鸽 2024-03-09 15:02:29 +08:00
parent 27bb11e568
commit 367978416c
4 changed files with 5 additions and 5 deletions

View File

@ -66,6 +66,7 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'no-underscore-dangle': 'off',
'no-use-before-define': 'off',
'no-undef': 'off',
},
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
settings: {

View File

@ -1,6 +1,5 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { IUserInfo } from '../typings'
const initState = { nickname: '', avatar: '' }

7
src/typings.d.ts vendored
View File

@ -1,13 +1,14 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
// 全局要用的类型放到这里
export type IResData<T> = {
type IResData<T> = {
code: number
msg: string
result: T
}
export type IUserInfo = {
type IUserInfo = {
nickname?: string
avatar?: string
/** 微信的 openid非微信没有这个字段 */
@ -15,7 +16,7 @@ export type IUserInfo = {
token?: string
}
export enum TestEnum {
enum TestEnum {
A = 'a',
B = 'b',
}

View File

@ -1,7 +1,6 @@
/* eslint-disable no-param-reassign */
import qs from 'qs'
import { useUserStore } from '@/store'
import { IResData, IUserInfo } from '@/typings'
type CustomRequestOptions = UniApp.RequestOptions & { query?: Record<string, any> }