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.
|
|
|
|
/**
|
|
|
|
|
* 用户信息类型定义
|
|
|
|
|
*/
|
|
|
|
|
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 // 登录后返回的页面路径
|
|
|
|
|
|
|
|
|
|
[propName: string]: any
|
|
|
|
|
}
|
|
|
|
|
getUserInfo: (type?: 0 | 1 | 2) => Promise<any>
|
|
|
|
|
startLogin: (callback?: () => void) => void
|
|
|
|
|
waitLogin: (params?: { type?: 0 | 1 }) => Promise<void>
|
|
|
|
|
[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>
|
|
|
|
|
}
|
|
|
|
|
}
|