diff --git a/App.vue b/App.vue index 6c6e221..3a6b618 100644 --- a/App.vue +++ b/App.vue @@ -8,7 +8,7 @@ }, async onShow() { console.log('App Show') - // await this.$store.dispatch('initData') + await this.$store.dispatch('initData') // console.log('配置数据初始化完成') }, onHide: function() { diff --git a/api/modules/config.js b/api/modules/config.js index 9ac9de6..d30227a 100644 --- a/api/modules/config.js +++ b/api/modules/config.js @@ -2,13 +2,10 @@ import http from "@/api/http"; export default { - - async queryConfigList() { return http({ url: '/config/queryConfigList', - method: 'GET', - noToken: true + method: 'GET' }) }, diff --git a/api/request.js b/api/request.js index 44fcb20..9255aa3 100644 --- a/api/request.js +++ b/api/request.js @@ -6,12 +6,12 @@ export default function request ( { data = {}, showLoading = false, header = {} , - noToken = false, // 不需要token的接口 + needToken = false, // 需要token showToast = true // 默认显示失败的提示 } ) { if (showLoading) uni.showLoading({title: '加载中'}) - if(!noToken) { + if(needToken) { const token = uni.getStorageSync('token') if (token) { header['X-Access-Token'] = token diff --git a/config/index.js b/config/index.js index 8fa0653..014e709 100644 --- a/config/index.js +++ b/config/index.js @@ -6,8 +6,13 @@ * aliOSSConfig 阿里云配置 * debounceConfig 防抖相关配置 */ -const env = 'development' +const envParam = { + dev: 'development', + test: 'testing', + prod: 'production', +} +const env = 'testing' // 全局配置 const config = { @@ -16,13 +21,11 @@ const config = { development: { baseURL: 'http://augcl.natapp1.cc/exhibit-admin/exhibit', }, - testing: { - baseURL: 'https://exhibit.augcl.com/exhibit-admin/exhibi', + baseURL: 'https://exhibit.augcl.com/exhibit-admin/exhibit', }, - production: { - baseURL: '', + baseURL: 'https://exhibit.augcl.com/exhibit-admin/exhibit', } }, diff --git a/pages/index/user.vue b/pages/index/user.vue index 7fead9f..7c16b30 100644 --- a/pages/index/user.vue +++ b/pages/index/user.vue @@ -17,7 +17,7 @@ - 常用功能 + 常用功能 @@ -42,11 +42,11 @@ - + - - 待补充 - + + + @@ -70,6 +70,7 @@ export default { url: '/subPages/login/login' }) }, + // 跳转到基本信息页面 goToBasicInfo() { uni.navigateTo({ diff --git a/stores/index.js b/stores/index.js index 0d02b96..67a7d7d 100644 --- a/stores/index.js +++ b/stores/index.js @@ -8,28 +8,14 @@ const store = new Vuex.Store({ state: { // 存放状态 configList: [], - careerList: [], - qualificationList: [], - categoryGoodsList: [], - categoryActivityList: [] + }, mutations: { setConfigList(state, data) { state.configList = data }, - setCareerList(state, data) { - state.careerList = data - }, - setQualificationList(state, data) { - state.qualificationList = data - }, - setCategoryGoodsList(state, data) { - state.categoryGoodsList = data - }, - setCategoryActivityList(state, data) { - state.categoryActivityList = data - } + }, actions: { // 查询配置列表 @@ -48,43 +34,11 @@ const store = new Vuex.Store({ }, - // 查询职业列表 - async getCareer({ commit }) { - const res = await api.config.queryCareerList() - // if (res.code === 0) { - commit('setCareerList', res.result.records) - // } else { - // uni.showToast({ title: res.msg, icon: 'error' }) - // } - }, - - // 查询学历列表 - async getQualification({ commit }) { - const res = await api.config.queryQualificationList() - // if (res.code === 0) { - commit('setQualificationList', res.result.records) - // } else { - // uni.showToast({ title: res.msg, icon: 'error' }) - // } - }, - - // 查询商品分类列表 - async getCategoryGoodsList({ commit }) { - const res = await api.config.queryCategoryGoodsList() - commit('setCategoryGoodsList', res.result.records) - - }, - - // 查询活动分类列表 - async getCategoryActivityList({ commit }) { - const res = await api.config.queryCategoryActivityList() - commit('setCategoryActivityList', res.result.records) - }, - + // 初始化数据 async initData({ dispatch, state }) { // 检查是否已初始化 - if (state.configList.length > 0 && state.careerList.length > 0 && state.qualificationList.length > 0 && state.categoryGoodsList.length > 0 && state.categoryActivityList.length > 0) { + if (state.configList.length > 0) { console.log('配置数据已初始化,无需重复初始化') return @@ -93,10 +47,7 @@ const store = new Vuex.Store({ try { await Promise.all([ dispatch('getConfig'), - dispatch('getCareer'), - dispatch('getQualification'), - dispatch('getCategoryGoodsList'), - dispatch('getCategoryActivityList') + ]) console.log('所有配置数据初始化完成') } catch (error) { diff --git a/subPages/login/login.vue b/subPages/login/login.vue index 294d9fb..2c9b78f 100644 --- a/subPages/login/login.vue +++ b/subPages/login/login.vue @@ -7,7 +7,7 @@ - + 展品维保报修小程序