diff --git a/common/http.api.js b/common/http.api.js index f2a2df9..2c0ce9f 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -3,8 +3,21 @@ import { Encrypt, Decrypt } from '@/js_sdk/cainiao-crypto/cainiao-crypto.js' const install = (Vue, vm) => { const LYLAW_BASE = '/lylaw/api/hnlylaw' const lylawPost = (url, params = {}) => { - console.log('[原始参数]', url, JSON.stringify(params)); - return Vue.prototype.$u.post(url, { request: Encrypt(JSON.stringify(params)) }).then(res => { + const payload = Object.assign({}, params) + const forceSw = payload.__sw === true + const forceHj = payload.__hj === true + delete payload.__sw + delete payload.__hj + let authKey = 'authorizationSft' + if (forceSw || payload.wenjuan_id == 1006 || payload.wenjuanId == 1006) { + authKey = 'authorizationSw' + } else if (forceHj || payload.wenjuan_id == 1007 || payload.wenjuanId == 1007) { + authKey = 'authorizationHj' + } + const auth = uni.getStorageSync(authKey) + const header = auth ? { authorization: auth } : {} + console.log('[原始参数]', url, JSON.stringify(payload)); + return Vue.prototype.$u.post(url, { request: Encrypt(JSON.stringify(payload)) }, header).then(res => { if (res && res.Data) { if (res.Data === 'VFXeGhPbmE9mfQeg2iiwdA==') { res.Data = null @@ -18,10 +31,10 @@ const install = (Vue, vm) => { const k = Object.keys(obj).find(x => x.toLowerCase() === 'authorization') return k ? obj[k] : '' } - const auth = pickAuth(res.Data) || pickAuth(res) - if (auth) { - uni.setStorageSync('authorizationSft', auth) - console.log('[authorization已缓存]', auth) + const a = pickAuth(res.Data) || pickAuth(res) + if (a) { + uni.setStorageSync(authKey, a) + console.log('[authorization已缓存]', authKey, a) } } console.log('[解密返回]', url, JSON.stringify(res)); diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 3c9fb4f..4c4543a 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -15,24 +15,8 @@ const install = (Vue, vm) => { }); // 请求拦截,配置Token等参数 Vue.prototype.$u.http.interceptor.request = (config) => { - // config.header.Token = 'xxxxxx'; - - // 方式一,存放在vuex的token,假设使用了uView封装的vuex方式,见:https://uviewui.com/components/globalVariable.html - // config.header.token = vm.token; - - // 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取 - // config.header.token = vm.$store.state.token; - - // 方式三,如果token放在了globalData,通过getApp().globalData获取 - // config.header.token = getApp().globalData.username; - - // 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值 - const authorization = uni.getStorageSync('authorizationSft'); - if (authorization) { - config.header.authorization = authorization; - } - - return config; + // authorization 由 http.api.js 中 lylawPost 按活动(wenjuan_id)逐请求注入,此处不再全局设置 + return config; } // 响应拦截,判断状态码是否通过 Vue.prototype.$u.http.interceptor.response = (res) => { diff --git a/components/hj-tabbar/hj-tabbar.vue b/components/hj-tabbar/hj-tabbar.vue new file mode 100644 index 0000000..7c62e13 --- /dev/null +++ b/components/hj-tabbar/hj-tabbar.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/components/sw-tabbar/sw-tabbar.vue b/components/sw-tabbar/sw-tabbar.vue new file mode 100644 index 0000000..af5c19b --- /dev/null +++ b/components/sw-tabbar/sw-tabbar.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/pages.json b/pages.json index 0a7cb4d..be5c460 100644 --- a/pages.json +++ b/pages.json @@ -74,6 +74,144 @@ "style": { "navigationStyle": "custom" } + }, + { + "path": "pages/sw-index/sw-index", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-register/sw-register", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-answer/sw-answer", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-result/sw-result", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-records/sw-records", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-record-detail/sw-record-detail", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-rules/sw-rules", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-privacy/sw-privacy", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-win-records/sw-win-records", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-profile/sw-profile", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/sw-study/sw-study", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-index/hj-index", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-register/hj-register", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-answer/hj-answer", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-result/hj-result", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-records/hj-records", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-record-detail/hj-record-detail", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-rules/hj-rules", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-privacy/hj-privacy", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-study/hj-study", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-win-records/hj-win-records", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-profile/hj-profile", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/hj-web/hj-web", + "style": { + "navigationStyle": "custom" + } } ], "tabBar": { diff --git a/pages/hj-answer/hj-answer.vue b/pages/hj-answer/hj-answer.vue new file mode 100644 index 0000000..fa6df0c --- /dev/null +++ b/pages/hj-answer/hj-answer.vue @@ -0,0 +1,378 @@ + + + + + diff --git a/pages/hj-index/hj-index.vue b/pages/hj-index/hj-index.vue new file mode 100644 index 0000000..d0a577f --- /dev/null +++ b/pages/hj-index/hj-index.vue @@ -0,0 +1,305 @@ + + + + + diff --git a/pages/hj-privacy/hj-privacy.vue b/pages/hj-privacy/hj-privacy.vue new file mode 100644 index 0000000..3fe769b --- /dev/null +++ b/pages/hj-privacy/hj-privacy.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/pages/hj-profile/hj-profile.vue b/pages/hj-profile/hj-profile.vue new file mode 100644 index 0000000..a097d87 --- /dev/null +++ b/pages/hj-profile/hj-profile.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/pages/hj-record-detail/hj-record-detail.vue b/pages/hj-record-detail/hj-record-detail.vue new file mode 100644 index 0000000..9f9b464 --- /dev/null +++ b/pages/hj-record-detail/hj-record-detail.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/pages/hj-records/hj-records.vue b/pages/hj-records/hj-records.vue new file mode 100644 index 0000000..d40921b --- /dev/null +++ b/pages/hj-records/hj-records.vue @@ -0,0 +1,192 @@ + + + + + diff --git a/pages/hj-register/hj-register.vue b/pages/hj-register/hj-register.vue new file mode 100644 index 0000000..87f9cb8 --- /dev/null +++ b/pages/hj-register/hj-register.vue @@ -0,0 +1,340 @@ + + + + + diff --git a/pages/hj-result/hj-result.vue b/pages/hj-result/hj-result.vue new file mode 100644 index 0000000..85840d4 --- /dev/null +++ b/pages/hj-result/hj-result.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/pages/hj-rules/hj-rules.vue b/pages/hj-rules/hj-rules.vue new file mode 100644 index 0000000..8874b63 --- /dev/null +++ b/pages/hj-rules/hj-rules.vue @@ -0,0 +1,203 @@ + + + + + \ No newline at end of file diff --git a/pages/hj-study/hj-study.vue b/pages/hj-study/hj-study.vue new file mode 100644 index 0000000..f70128a --- /dev/null +++ b/pages/hj-study/hj-study.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/pages/hj-web/hj-web.vue b/pages/hj-web/hj-web.vue new file mode 100644 index 0000000..67f30b5 --- /dev/null +++ b/pages/hj-web/hj-web.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/pages/hj-win-records/hj-win-records.vue b/pages/hj-win-records/hj-win-records.vue new file mode 100644 index 0000000..25c85a7 --- /dev/null +++ b/pages/hj-win-records/hj-win-records.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/pages/home/home.vue b/pages/home/home.vue index 5b4fad6..6f4bd9e 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -6,10 +6,16 @@ - + + + + + + + + + 活动规则 + + ‹ + + + {{ blockTip }} + 本活动仅支持手机微信访问 + + + + + + + + + ✕ + + + + + + + + diff --git a/pages/sw-privacy/sw-privacy.vue b/pages/sw-privacy/sw-privacy.vue new file mode 100644 index 0000000..60c8f14 --- /dev/null +++ b/pages/sw-privacy/sw-privacy.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/pages/sw-profile/sw-profile.vue b/pages/sw-profile/sw-profile.vue new file mode 100644 index 0000000..16bf774 --- /dev/null +++ b/pages/sw-profile/sw-profile.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/pages/sw-record-detail/sw-record-detail.vue b/pages/sw-record-detail/sw-record-detail.vue new file mode 100644 index 0000000..f41eb42 --- /dev/null +++ b/pages/sw-record-detail/sw-record-detail.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/pages/sw-records/sw-records.vue b/pages/sw-records/sw-records.vue new file mode 100644 index 0000000..d79fd0e --- /dev/null +++ b/pages/sw-records/sw-records.vue @@ -0,0 +1,192 @@ + + + + + diff --git a/pages/sw-register/sw-register.vue b/pages/sw-register/sw-register.vue new file mode 100644 index 0000000..b7b1a63 --- /dev/null +++ b/pages/sw-register/sw-register.vue @@ -0,0 +1,340 @@ + + + + + diff --git a/pages/sw-result/sw-result.vue b/pages/sw-result/sw-result.vue new file mode 100644 index 0000000..4d7ef67 --- /dev/null +++ b/pages/sw-result/sw-result.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/pages/sw-rules/sw-rules.vue b/pages/sw-rules/sw-rules.vue new file mode 100644 index 0000000..1823811 --- /dev/null +++ b/pages/sw-rules/sw-rules.vue @@ -0,0 +1,215 @@ + + + + + \ No newline at end of file diff --git a/pages/sw-study/sw-study.vue b/pages/sw-study/sw-study.vue new file mode 100644 index 0000000..a04cd71 --- /dev/null +++ b/pages/sw-study/sw-study.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/pages/sw-win-records/sw-win-records.vue b/pages/sw-win-records/sw-win-records.vue new file mode 100644 index 0000000..822ef4f --- /dev/null +++ b/pages/sw-win-records/sw-win-records.vue @@ -0,0 +1,423 @@ + + + + +