let array =self.components(separatedBy: "?") if array.count ==2 { let paramsStr = array[1] if paramsStr.count >0 { let paramsArray = paramsStr.components(separatedBy: "&") for param in paramsArray { let arr = param.components(separatedBy: "=") if arr.count ==2 { params[arr[0]] = arr[1] } } } }
return params } /// 处理千分符号 /// 10000 => 10,000 functhousandsNumber(content: Double) -> String { let format =NumberFormatter() format.numberStyle = .decimal format.usesGroupingSeparator =true format.groupingSeparator ="," format.groupingSize =3 guardlet result = format.string(for: NSNumber(value: content)) else { return"" } return result }