@tmsfe/tms-core 0.0.178 → 0.0.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/encrypt/encrypt-util.ts +3 -3
- package/src/navbarUtils.js +18 -1
package/package.json
CHANGED
|
@@ -317,7 +317,7 @@ const cryptRuleUtil = {
|
|
|
317
317
|
// 远程加密服务是否开启
|
|
318
318
|
isServerOpen: (): boolean => !!wx.$_publicKey,
|
|
319
319
|
// 检查path是否符合下发的路由前缀
|
|
320
|
-
|
|
320
|
+
pathInEnablePrefix: (path: string): boolean => {
|
|
321
321
|
if (!wx.$_publicKey) {
|
|
322
322
|
return false;
|
|
323
323
|
}
|
|
@@ -392,8 +392,8 @@ const isCryptoRuleMath = (path: string, reqData: any): BaseResp<boolean> => {
|
|
|
392
392
|
if (!cryptRuleUtil.isServerOpen()) {
|
|
393
393
|
return new baseUtil.BaseRespFac(false, false, '服务端加密未开启');
|
|
394
394
|
}
|
|
395
|
-
//
|
|
396
|
-
if (cryptRuleUtil.
|
|
395
|
+
// 请求路由不满足服务端下发的加密规则,不走加密
|
|
396
|
+
if (!cryptRuleUtil.pathInEnablePrefix(path)) {
|
|
397
397
|
return new baseUtil.BaseRespFac(false, false, '未命中服务端加密规则');
|
|
398
398
|
}
|
|
399
399
|
// 请求接口是加密性能埋点上报接口,不加密
|
package/src/navbarUtils.js
CHANGED
|
@@ -135,6 +135,7 @@ const calNavBarHeight = (menuTop, menuHeight, statusBarHeight, apiCategory) => {
|
|
|
135
135
|
* @returns {Object} data.enterOptions 启动参数
|
|
136
136
|
* @returns {Object} data.enterOptions.apiCategory API 类别(不同apiCategory场景下的API有不同限制,UI也有不同)
|
|
137
137
|
*/
|
|
138
|
+
/* eslint-disable */
|
|
138
139
|
const getNavBarConfigData = () => { // eslint-disable-line require-jsdoc
|
|
139
140
|
const systemInfo = getSysInfo();
|
|
140
141
|
const { brand, getSystemInfoSuccess, platform } = systemInfo;
|
|
@@ -151,7 +152,9 @@ const getNavBarConfigData = () => { // eslint-disable-line require-jsdoc
|
|
|
151
152
|
statusBarHeight = isIOS ? StatusBarHeightOnIOS : StatusBarHeightOnAndroid;
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
const
|
|
155
|
+
const isPCShowNavBar = getPCNavbarShowStatus(systemInfo);
|
|
156
|
+
// 手机端微信版本version格式为7.0.0,电脑端为4.0.3.93,compareVersion(version, '7.0.0') >= 0只处理了手机端是否展示自定义导航栏
|
|
157
|
+
const enable = compareVersion(version, '7.0.0') >= 0 || brand === 'devtools' || platform === 'ohos' || isPCShowNavBar; // 微信版本是否支持自定义顶栏,不支持时自动隐藏
|
|
155
158
|
const enterOptions = getEnterOptions();
|
|
156
159
|
if (enable) {
|
|
157
160
|
return { enable, ...calculateNavBarLayout(isIOS, statusBarHeight, enterOptions.apiCategory) };
|
|
@@ -160,6 +163,20 @@ const getNavBarConfigData = () => { // eslint-disable-line require-jsdoc
|
|
|
160
163
|
return { enable };
|
|
161
164
|
};
|
|
162
165
|
|
|
166
|
+
// 电脑端是否展示导航栏
|
|
167
|
+
const getPCNavbarShowStatus = (systemInfo) => {
|
|
168
|
+
const { SDKVersion, platform } = systemInfo;
|
|
169
|
+
if (['windows', 'mac'].includes(platform)) {
|
|
170
|
+
try {
|
|
171
|
+
return compareVersion(SDKVersion, '3.6.1') >= 0;
|
|
172
|
+
} catch (_) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
163
180
|
// 获取需要对外暴露的启动参数
|
|
164
181
|
const getEnterOptions = () => {
|
|
165
182
|
const options = wx.getEnterOptionsSync();
|