/** * 用户信息类型定义 */ interface UserInfo { id: number nickname?: string avatarUrl?: string realName?: string studentNo?: string role?: 'student' | 'teacher' | 'staff' collegeId?: number collegeName?: string majorId?: number majorName?: string classId?: number className?: string grade?: string } interface IAppOption { globalData: { url?: string upFileUrl: string imageUrl: string Timestamp: number waitBindDoctorId: string // JWT 令牌相关 accessToken?: string tokenExpireIn?: number openidSession?: string // 临时凭证(用于绑定) userInfo?: UserInfo | {} loginRedirectUrl?: string // 登录后返回的页面路径 needBind: boolean loginPromise: Promise [propName: string]: any } getUserInfo: (type?: 0 | 1 | 2) => Promise startLogin: (callback?: () => void) => Promise waitLogin: (params?: { type?: 0 | 1 }) => Promise [propName: string]: any } interface IAgaxParams extends WechatMiniprogram.RequestOption { showMsg?: boolean loading?: boolean loadingText?: string isJSON?: boolean } declare namespace WechatMiniprogram { export interface Wx { ajax: (params: IAgaxParams) => Promise } }