diff --git a/api/api.js b/api/api.js index 349142f..71f0e14 100644 --- a/api/api.js +++ b/api/api.js @@ -1,11 +1,10 @@ import http from './http.js' import utils from '../utils/utils.js' - let limit = {} let debounce = {} -const models = ['login', 'index', 'vip', 'info'] +const models = ['login', 'index', 'vip', 'info','zhaomu'] const config = { // 示例 diff --git a/api/http.js b/api/http.js index 1e4537a..0d27a3c 100644 --- a/api/http.js +++ b/api/http.js @@ -1,7 +1,7 @@ import Vue from 'vue' import utils from '../utils/utils.js' - +import store from '../store/store.js' function http(uri, data, callback, method = 'GET', showLoading, title) { @@ -20,7 +20,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { 'Content-Type' : 'application/x-www-form-urlencoded' }, success: (res) => { - + console.log(res,'res') if(showLoading){ uni.hideLoading(); } @@ -28,9 +28,9 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { if(res.statusCode == 401 || res.data.message == '操作失败,token非法无效!' || res.data.message == '操作失败,用户不存在!'){ - uni.removeStorageSync('token') + store.commit('logout') console.error('登录过期'); - utils.toLogin() + // utils.toLogin() } if(res.statusCode == 200 && res.data.code != 200 diff --git a/api/model/zhaomu.js b/api/model/zhaomu.js new file mode 100644 index 0000000..95adae0 --- /dev/null +++ b/api/model/zhaomu.js @@ -0,0 +1,11 @@ + +const api = { + // 招募订单 + recruitPageList: { + url: '/popularize-admin/shop_common/getRecruitPageList', + method: 'GET', + }, + +} + +export default api \ No newline at end of file diff --git a/pages/index/member.vue b/pages/index/member.vue index 8c7efa0..95c3552 100644 --- a/pages/index/member.vue +++ b/pages/index/member.vue @@ -5,19 +5,19 @@ - + - - + + - 点击授权登录 - 普通用户 + {{token ? userInfo.nickName : '请点击登录'}} + - ID:000001 - 复制 + {{token ? userInfo.id : ''}} + 复制 @@ -50,7 +50,7 @@