feat: 新增sw(税务)与hj(生态环境)专区模块;自制hj/sw-tabbar底栏;hj-web内嵌阅读(双指缩放);hnlylaw三活动authorization隔离(Sft/Sw/Hj);缓存键Hj后缀;问卷1006/1007;home专区入口接线;sw/hj规则与隐私文案、学习清单及链接校修复
This commit is contained in:
+19
-6
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user