From 0c100f6c702db0dd8cf696c595e83fb3fead0232 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期六, 03 八月 2024 14:17:54 +0800 Subject: [PATCH] add 分享 --- sub_pages/supplier/supplier-info/supplier-info.vue | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sub_pages/supplier/supplier-info/supplier-info.vue b/sub_pages/supplier/supplier-info/supplier-info.vue index 2427a8c..2baac13 100644 --- a/sub_pages/supplier/supplier-info/supplier-info.vue +++ b/sub_pages/supplier/supplier-info/supplier-info.vue @@ -382,13 +382,17 @@ } }, async init_area() { - const res = await this.$http.request('get', '/api/pub/china/area/json') - // console.log('area', JSON.parse(res.data)) - this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', - 'text')) || [] - - // console.log('area', this.regionDataPlus) - + var a = this.$storage.getItem('cache_area') + if (a) { + this.regionDataPlus = JSON.parse(a) || [] + } else { + const res = await this.$http.request('get', '/api/pub/china/area/json') + // console.log('area', JSON.parse(res.data)) + this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll( + 'name', + 'text')) || [] + this.$storage.setItem('cache_area', JSON.stringify(this.regionDataPlus)) + } }, -- Gitblit v1.9.3