refactor: typings 不用导出
This commit is contained in:
parent
27bb11e568
commit
367978416c
@ -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: {
|
||||
|
@ -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
7
src/typings.d.ts
vendored
@ -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',
|
||||
}
|
||||
|
@ -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> }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user