feat: security hardening, wechat pay v3 platform cert integration, companion certification revocation, and audit closed-loop
这个提交包含在:
@@ -1,9 +1,9 @@
|
||||
<script>
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from './common/theme.js';
|
||||
import { installRoleGuard } from './common/role.js';
|
||||
import { installRoleGuard, getCurrentRole, ROLE_TYPES, isExpertCertified, safeRedirectToExpertHall } from './common/role.js';
|
||||
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
onLaunch: function (options) {
|
||||
// #ifdef H5
|
||||
if (typeof window !== 'undefined' && window.addEventListener) {
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
@@ -50,6 +50,16 @@ export default {
|
||||
// 注册全流程角色权限守卫拦截器 (Role Guard)
|
||||
installRoleGuard();
|
||||
|
||||
// 如果以大神身份冷启动或刷新进入首页根路径,自动平滑路由至大神接单大厅
|
||||
try {
|
||||
const launchPath = options && options.path;
|
||||
if (!launchPath || launchPath === 'pages/index/index' || launchPath === '/pages/index/index') {
|
||||
if (getCurrentRole() === ROLE_TYPES.EXPERT && isExpertCertified()) {
|
||||
safeRedirectToExpertHall('/pages/expert/hall');
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
// 注册全局路由切换拦截器,在跳转目标页面前预先同步 Native 导航栏与窗口背景,消除切页黑屏闪烁
|
||||
const routeMethods = ['navigateTo', 'redirectTo', 'reLaunch', 'switchTab'];
|
||||
routeMethods.forEach((method) => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户