You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

64 lines
1.4 KiB

/**
* 用户信息类型定义
*/
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
initLoginInfo: Partial<{
isLogin: 0 | 1
isReg: 0 | 1
loginType: 1 | 2
needBind?: boolean
user?: UserInfo
}>
// JWT 令牌相关
accessToken?: string
tokenExpireIn?: number
openidSession?: string // 临时凭证(用于绑定)
userInfo?: UserInfo
loginRedirectUrl?: string // 登录后返回的页面路径
[propName: string]: any
}
getUserInfo: (type?: 0 | 1 | 2) => Promise<any>
startLogin: (callback?: () => void) => void
waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise<void>
checkLoginType: (type: 0 | 1 | 2 | 'any') => boolean
[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<any>
}
}