Przeglądaj źródła

【会员系统】解绑设备显示名称修改

dinglingui 1 tydzień temu
rodzic
commit
bfd281a41e

+ 6 - 1
PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift

@@ -442,6 +442,7 @@ class KMMemberCenterManager: NSObject {
                 var uniqueSn = ""
                 var deviceName = ""
                 var id = ""
+                var model = ""
 
                 if let token = dict["device_id"] {
                     device_id = token as? String ?? ""
@@ -456,11 +457,15 @@ class KMMemberCenterManager: NSObject {
                     deviceName = token as? String ?? ""
                 }
                 
+                if let token = dict["model"] {
+                    model = token as? String ?? ""
+                }
+                
                 if let token = dict["id"] {
                     id = token as? String ?? ""
                 }
                 
-                let list = KMMemberDeviceList(deviceId: device_id, productId: productId, uniqueSn: uniqueSn, appId: "", deviceName: deviceName)
+                let list = KMMemberDeviceList(deviceId: device_id, productId: productId, uniqueSn: uniqueSn, appId: "", device_model:model, deviceName: deviceName)
                 list.id = id
                 deviceLists.append(list)
             }

+ 5 - 4
PDF Office/PDF Master/MemberCenter/WindowsController/KMMemberCenterWindowController.swift

@@ -150,14 +150,15 @@ class KMMemberCenterWindowController: NSWindowController {
         
         for i in 0 ..< deviceList_Result.count {
             let device = deviceList_Result[i]
+            let name = String(format: "%@(%@)",device.deviceName ?? "PDF Reader Pro User for ",device.device_model ?? " Device Name")
             if i == 0 {
-                device1Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device1Label.stringValue = name
             } else if i == 1 {
-                device2Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device2Label.stringValue = name
             }  else if i == 2 {
-                device3Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device3Label.stringValue = name
             } else if i == 3 {
-                device4Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device4Label.stringValue = name
             }
         }
         let maxDeviceNum = memberCenterdeviceResult.maxDeviceNum ?? 1