46 lines
980 B
Swift
46 lines
980 B
Swift
//
|
||
// UserConfigModel.swift
|
||
// QuickLocation
|
||
//
|
||
// Created by 八条 on 2026/5/26.
|
||
//
|
||
|
||
import ObjectMapper
|
||
import RxDataSources
|
||
|
||
struct UserConfigModel: Mappable {
|
||
var token: String?
|
||
var phone: String?
|
||
var name: String?
|
||
var avater: String?
|
||
/// 头像,对应本地图标
|
||
var head_pic: String = "1"
|
||
/// 用户头像
|
||
var userIcon: UIImage {
|
||
UIImage(named: "UserIcon/\(head_pic)") ?? UIImage()
|
||
}
|
||
/// 是否游客
|
||
var temp: Bool = true
|
||
|
||
/// 用户 ID
|
||
var uid: String?
|
||
|
||
/// 会员 1:非会员 2:普通会员 3:终身会员
|
||
var vip: Int = 1
|
||
|
||
init?(map: Map) {
|
||
|
||
}
|
||
|
||
mutating func mapping(map: Map) {
|
||
token <- map["token"]
|
||
temp <- map["temp"]
|
||
phone <- map["phone"]
|
||
name <- map["name"]
|
||
uid <- map["user_id"]
|
||
avater <- map["avater"]
|
||
head_pic <- (map["head_pic"], kIntTransformStr)
|
||
vip <- map["vip"]
|
||
}
|
||
}
|