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 @@ ...@@ -15,25 +15,27 @@
<script> <script>
export default { export default {
name: 'App', name: 'App',
data() { data () {
return { return {
showWindow: false
} }
}, },
watch: { watch: {
watchFlag: { watchFlag: {
immediate: true, immediate: true,
handler(newval) { handler (newval) {
console.log(newval, '===')
this.showWindow = newval this.showWindow = newval
this.hideLoading() this.hideLoading()
} }
} }
}, },
computed: { computed: {
watchFlag() { watchFlag () {
return this.$store.state.app.showWindow return this.$store.state.app.showWindow
} }
}, },
mounted() { mounted () {
}, },
methods: {} methods: {}
......
...@@ -32,8 +32,7 @@ const actions = { ...@@ -32,8 +32,7 @@ const actions = {
const wwCode = getParams('code'), const wwCode = getParams('code'),
{ corpId, agentId } = util.getLocalStorage('ww_storage_info'), { corpId, agentId } = util.getLocalStorage('ww_storage_info'),
paramsPhone = util.getLocalStorage('ww_params_phone'), paramsPhone = util.getLocalStorage('ww_params_phone'),
{ loginUrl } = window.$fetchConfig, { loginUrl } = window.$fetchConfig
[redirectUrl] = window.location.href.split('?')
if (wwCode) { if (wwCode) {
const { code, data, message } = await ssoApi.login({ const { code, data, message } = await ssoApi.login({
code: wwCode, code: wwCode,
...@@ -51,15 +50,15 @@ const actions = { ...@@ -51,15 +50,15 @@ const actions = {
// phone, // phone,
// }) // })
// if (res) { // if (res) {
let route = ['pc', 'mobile'].includes(state.lastPath) ? '' : state.lastPath || '', let route = state.lastPath,
jumpUrl = redirectUrl [jumpUrl] = window.location.href.split('/#/')
route = route.replace('.', '/') route = route.replace('.', '/')
util.setLocalStorage('ww_userInfo', userInfo) util.setLocalStorage('ww_userInfo', userInfo)
// util.setSessionId(res.sessionId) // util.setSessionId(res.sessionId)
// dispatch('registerHttp', res.sessionId) // dispatch('registerHttp', res.sessionId)
state.showWindow = true state.showWindow = true
if (route) window.location.replace(`${jumpUrl}${route}`) console.log(jumpUrl)
else window.location.replace(jumpUrl) window.location.replace(`${jumpUrl}/#/${route}`)
// } else throw '' // } else throw ''
} else throw '手机号不一致' } 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!