Commit 778fd751 by 李伟康

```

feat(app): 优化应用组件和状态管理逻辑

- 在App.vue中添加showWindow数据属性用于控制窗口显示状态
- 调整App.vue中的函数声明格式,统一使用空格格式化
- 在watchFlag监听器中添加日志输出以便调试
- 优化store模块中企业微信登录逻辑,简化URL处理
- 移除未使用的redirectUrl变量,使用location.href分割获取跳转URL
- 更新路由跳转逻辑,使用新的URL格式进行页面重定向
```
1 parent 0d718fa7
......@@ -15,25 +15,27 @@
<script>
export default {
name: 'App',
data() {
data () {
return {
showWindow: false
}
},
watch: {
watchFlag: {
immediate: true,
handler(newval) {
handler (newval) {
console.log(newval, '===')
this.showWindow = newval
this.hideLoading()
}
}
},
computed: {
watchFlag() {
watchFlag () {
return this.$store.state.app.showWindow
}
},
mounted() {
mounted () {
},
methods: {}
......
......@@ -32,8 +32,7 @@ const actions = {
const wwCode = getParams('code'),
{ corpId, agentId } = util.getLocalStorage('ww_storage_info'),
paramsPhone = util.getLocalStorage('ww_params_phone'),
{ loginUrl } = window.$fetchConfig,
[redirectUrl] = window.location.href.split('?')
{ loginUrl } = window.$fetchConfig
if (wwCode) {
const { code, data, message } = await ssoApi.login({
code: wwCode,
......@@ -51,15 +50,15 @@ const actions = {
// phone,
// })
// if (res) {
let route = ['pc', 'mobile'].includes(state.lastPath) ? '' : state.lastPath || '',
jumpUrl = redirectUrl
route = route.replace('.', '/')
util.setLocalStorage('ww_userInfo', userInfo)
// util.setSessionId(res.sessionId)
// dispatch('registerHttp', res.sessionId)
state.showWindow = true
if (route) window.location.replace(`${jumpUrl}${route}`)
else window.location.replace(jumpUrl)
let route = state.lastPath,
[jumpUrl] = window.location.href.split('/#/')
route = route.replace('.', '/')
util.setLocalStorage('ww_userInfo', userInfo)
// util.setSessionId(res.sessionId)
// dispatch('registerHttp', res.sessionId)
state.showWindow = true
console.log(jumpUrl)
window.location.replace(`${jumpUrl}/#/${route}`)
// } else throw ''
} else throw '手机号不一致'
} else throw ''
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!