|
@@ -221,8 +221,10 @@ object SystemApi {
|
|
|
*/
|
|
|
suspend fun stationLogo(): DFSResult<String> {
|
|
|
val resultConfig = config(WayneApiConfig.CONFIG_LOGO)
|
|
|
- if (resultConfig.success && resultConfig.data!!.id.isNotEmpty()) {
|
|
|
- val resultFile = file(resultConfig.data.id)
|
|
|
+ // 保存油站名称前缀
|
|
|
+ GlobalData.belongName.set(resultConfig.data?.description ?: "")
|
|
|
+ if (resultConfig.success && !resultConfig.data?.configFileDescriptions?.get(0)?.id.isNullOrEmpty()) {
|
|
|
+ val resultFile = file(resultConfig.data!!.configFileDescriptions[0].id)
|
|
|
if (resultFile.success && resultFile.data != null) {
|
|
|
return DFSResult.success(resultFile.data)
|
|
|
}
|
|
@@ -317,15 +319,14 @@ object SystemApi {
|
|
|
/**
|
|
|
* 查询配置信息
|
|
|
*/
|
|
|
- private suspend fun config(type: String) = suspendCoroutine<DFSResult<ResultConfigDescItem>> {
|
|
|
+ private suspend fun config(type: String) = suspendCoroutine<DFSResult<ResultConfig>> {
|
|
|
serviceConfig.config(GlobalData.businessId.get(), type).enqueue(object : Callback<Array<ResultConfig>> {
|
|
|
override fun onResponse(call: Call<Array<ResultConfig>>, response: Response<Array<ResultConfig>>) {
|
|
|
val code = response.code()
|
|
|
val body = response.body()
|
|
|
if (code == 200 && !body.isNullOrEmpty() && body[0].configFileDescriptions.isNotEmpty()) {
|
|
|
if (body[0].configFileDescriptions.isNotEmpty()) {
|
|
|
- val obj = body[0].configFileDescriptions[0]
|
|
|
- it.resume(DFSResult.success(ResultConfigDescItem(obj.id, obj.name)))
|
|
|
+ it.resume(DFSResult.success(body[0]))
|
|
|
return
|
|
|
}
|
|
|
}
|