Преглед на файлове

refactor: typings 不用导出

菲鸽 преди 2 години
родител
ревизия
367978416c
променени са 4 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 1 0
      .eslintrc.cjs
  2. 0 1
      src/store/user.ts
  3. 4 3
      src/typings.d.ts
  4. 0 1
      src/utils/http.ts

+ 1 - 0
.eslintrc.cjs

@@ -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: {

+ 0 - 1
src/store/user.ts

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

+ 4 - 3
src/typings.d.ts

@@ -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',
 }

+ 0 - 1
src/utils/http.ts

@@ -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> }