| | |
| | | }, |
| | | |
| | | onLoad(options) { |
| | | // 保存页面参数 |
| | | this.pageOptions = options || {}; |
| | | // 页面加载时执行免登流程 |
| | | this.qyWechatAutoLogin(); |
| | | // 添加容错处理 |
| | | try { |
| | | // 保存页面参数 |
| | | this.pageOptions = options || {}; |
| | | // 页面加载时执行免登流程 |
| | | this.qyWechatAutoLogin(); |
| | | } catch (e) { |
| | | console.error('页面加载出错:', e); |
| | | this.loading = false; |
| | | this.error = true; |
| | | this.errorMessage = "页面初始化失败,请重试"; |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | // 检查是否有redirect参数指定跳转页面 |
| | | let redirectUrl = this.getUrlParam("redirect"); |
| | | |
| | | // 如果没有redirect参数,检查是否有保存的目标页面 |
| | | if (!redirectUrl) { |
| | | const { getTargetUrl } = require('@/utils/auth') |
| | | redirectUrl = getTargetUrl() |
| | | } |
| | | |
| | | if (redirectUrl) { |
| | | // 解码redirect参数 |
| | | redirectUrl = decodeURIComponent(redirectUrl); |