Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
ae1b01ab
提交
ae1b01ab
authored
4月 01, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(login): 登录页面_勤策判断有点问题
state 值用飞书时也有,导致勤策登录也走了,不对
上级
8a34c656
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
40 行增加
和
33 行删除
+40
-33
App.vue
src/App.vue
+16
-2
index.vue
src/mobile_views/promotion/detail/index.vue
+0
-25
promotion.vue
src/mobile_views/promotion/promotion.vue
+9
-0
index.js
src/router/index.js
+4
-3
login.vue
src/views/login.vue
+11
-3
没有找到文件。
src/App.vue
浏览文件 @
ae1b01ab
<
template
>
<router-view
/>
<router-view
v-slot=
"
{ Component }">
<keep-alive
include=
"ab"
>
<component
:is=
"Component"
></component>
</keep-alive>
</router-view>
<back-to-up></back-to-up>
</
template
>
<
script
setup
>
import
useSettingsStore
from
'@/store/modules/settings'
import
{
handleThemeStyle
}
from
'@/utils/theme'
import
{
constantRoutes
}
from
'@/router'
onMounted
(()
=>
{
nextTick
(()
=>
{
// 初始化主题样式
handleThemeStyle
(
useSettingsStore
().
theme
)
})
})
const
cachedViews
=
ref
([])
constantRoutes
.
forEach
(
o
=>
{
console
.
log
(
'1'
,
o
)
// 暂时只缓存第一层
if
(
o
.
meta
?.
keepAlive
)
{
cachedViews
.
value
.
push
(
o
.
name
)
}
})
console
.
log
(
cachedViews
.
value
)
</
script
>
src/mobile_views/promotion/detail/index.vue
浏览文件 @
ae1b01ab
...
...
@@ -67,31 +67,6 @@
<
/div
>
<
/template
>
<
/van-cell
>
<
van
-
cell
v
-
for
=
"item in planList"
:
key
=
"item.id"
label
-
class
=
"image-cell"
>
<
template
#
title
>
<
p
>
{{
item
.
temporaryName
}}
<
/p
>
<
p
>
{{
item
.
province
+
item
.
city
}}
<
/p
>
<
/template
>
<
template
#
label
>
<
div
class
=
"item"
v
-
for
=
"o in item.photoList"
>
<
template
v
-
if
=
"o.list"
>
<
p
>
{{
o
.
title
}}
<
/p
>
<
div
class
=
"image-wrap"
>
<
div
class
=
"small-item"
v
-
for
=
"obj, index in o.list"
>
<
van
-
image
:
src
=
"obj.photoUrl"
@
click
=
"previewImage(o.list, index)"
/>
<
p
>
{{
obj
.
title
}}
<
/p
>
<
p
>
{{
obj
.
time
}}
<
/p
>
<
/div
>
<
/div
>
<
/template
>
<
/div
>
<
/template
>
<
/van-cell
>
<
/van-cell-group
>
<
/van-list
>
<
/van-pull-refresh
>
...
...
src/mobile_views/promotion/
index
.vue
→
src/mobile_views/promotion/
promotion
.vue
浏览文件 @
ae1b01ab
...
...
@@ -147,6 +147,10 @@
<
/template
>
<
script
setup
>
// 指定当前组件的名字
defineOptions
({
name
:
'ab'
}
)
import
{
parseTime
}
from
'@/utils'
import
{
useDatePickerOptions
}
from
'@/hooks'
import
{
getChargeListAPI
,
getPlanListAPI
}
from
'@/api'
...
...
@@ -332,6 +336,11 @@ const resetFn = () => {
planQueryParams
.
pageNum
=
1
getPlanList
()
}
onUnmounted
(()
=>
{
console
.
log
(
'des'
)
}
)
<
/script
>
<
style
scoped
...
...
src/router/index.js
浏览文件 @
ae1b01ab
...
...
@@ -95,9 +95,10 @@ export const constantMobileRoutes = [
},
{
path
:
'/promotion'
,
component
:
()
=>
import
(
'@/mobile_views/promotion/
index
'
),
name
:
'
Index'
,
component
:
()
=>
import
(
'@/mobile_views/promotion/
promotion
'
),
name
:
'
Mobile_Promotion'
,
// 和组件内的名字保持一致
hidden
:
true
,
meta
:
{
keepAlive
:
true
}
// 标记该路由需要缓存
},
{
path
:
'/promotion_detail/:id'
,
...
...
@@ -190,7 +191,7 @@ if (isMobile()) {
const
router
=
createRouter
({
history
:
createWebHashHistory
(),
routes
:
constantRoutes
,
routes
:
[...
constantRoutes
]
,
scrollBehavior
(
to
,
from
,
savedPosition
)
{
if
(
savedPosition
)
{
return
savedPosition
...
...
src/views/login.vue
浏览文件 @
ae1b01ab
...
...
@@ -150,9 +150,17 @@ checkFsLoginAuth()
// 检查-是否勤策回跳,并客户端登录
const
checkQcLoginAuth
=
async
()
=>
{
isShowLogin
.
value
=
false
const
isState
=
window
.
location
.
href
.
includes
(
'state'
)
if
(
isState
)
{
loginByType
(
'qc'
,
window
.
location
.
href
.
split
(
'?'
)[
2
])
// 勤策的 state 取值比较特殊
// ?redirect=/promotion?state=STATE&code=CODE 这个格式
const
url
=
window
.
location
.
href
.
split
(
'?'
)[
2
]
if
(
url
)
{
const
params
=
new
URLSearchParams
(
url
);
const
state
=
params
.
get
(
'state'
);
if
(
state
===
'STATE'
)
{
loginByType
(
'qc'
,
window
.
location
.
href
.
split
(
'?'
)[
2
])
}
else
{
isShowLogin
.
value
=
true
}
}
else
{
isShowLogin
.
value
=
true
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论