Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-annual-summary
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-annual-summary
提交
1245bf42
提交
1245bf42
编写于
11月 04, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
去掉日志
上级
e50220ad
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
22 行增加
和
25 行删除
+22
-25
main.js
src/main.js
+3
-3
user.js
src/store/modules/user.js
+3
-3
mixins.js
src/utils/mixins.js
+4
-4
coupon-list.vue
src/views/coupon/coupon-list.vue
+8
-11
goods-detail.vue
src/views/goods-detail.vue
+4
-4
未找到文件。
src/main.js
浏览文件 @
1245bf42
...
...
@@ -57,11 +57,11 @@ const router = new VueRouter({
// 过滤路由
function
fliterRoute
(
query
,
path
)
{
alert
(
'fliterRoute 111'
+
JSON
.
stringify
(
query
)
+
path
);
console
.
log
(
'fliterRoute 111'
+
JSON
.
stringify
(
query
)
+
path
);
let
has
=
false
;
// 登录token保存并替换路径
if
(
query
.
token
&&
query
.
token
!=
'undefined'
)
{
alert
(
'fliterRoute 222 '
+
JSON
.
stringify
(
query
)
+
path
);
console
.
log
(
'fliterRoute 222 '
+
JSON
.
stringify
(
query
)
+
path
);
store
.
dispatch
(
'setToken'
,
query
.
token
);
delete
query
.
token
;
has
=
true
;
...
...
@@ -85,7 +85,7 @@ function fliterRoute(query, path) {
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
alert
(
'beforeEach @@@@@@'
);
console
.
log
(
'beforeEach @@@@@@'
);
// 商品页授权登录路由处理
if
(
to
.
path
===
'/goods-detail'
)
{
let
searchQuery
=
querystring
(
location
.
search
);
...
...
src/store/modules/user.js
浏览文件 @
1245bf42
...
...
@@ -17,7 +17,7 @@ const user = {
mutations
:
{
SET_TOKEN
:
(
state
,
payload
)
=>
{
state
.
token
=
payload
;
alert
(
'state.token '
+
state
.
token
);
console
.
log
(
'state.token '
+
state
.
token
);
},
SET_USER_INFO_2
:
(
state
,
payload
)
=>
{
state
.
info
=
payload
;
...
...
@@ -32,11 +32,11 @@ const user = {
actions
:
{
// 外部登陆返回设置token
setToken
({
commit
,
dispatch
},
params
)
{
alert
(
'setToken 1'
,
params
);
console
.
log
(
'setToken 1'
,
params
);
if
(
typeof
(
params
)
==
'object'
)
{
params
=
params
.
join
(
""
);
}
alert
(
'setToken 2'
,
params
);
console
.
log
(
'setToken 2'
,
params
);
commit
(
'SET_TOKEN'
,
params
);
localStorage
.
setItem
(
'couponToken'
,
params
);
setCookie
(
'couponToken'
,
params
)
...
...
src/utils/mixins.js
浏览文件 @
1245bf42
...
...
@@ -16,7 +16,7 @@ module.exports = {
if
(
this
.
$route
!==
undefined
)
{
query
=
this
.
$route
.
query
}
//
alert
('this.token' + this.token)
//
console.log
('this.token' + this.token)
this
.
token
=
this
.
getUrlKey
(
'token'
)
||
(
query
&&
query
.
token
)
},
computed
:
{
...
...
@@ -231,16 +231,16 @@ module.exports = {
// 校验token,有效则调用回调函数,否则调起原生登陆页面
commonCheckToken
(
cb
)
{
alert
(
'5555 this.token'
+
this
.
token
);
console
.
log
(
'5555 this.token'
,
this
.
token
);
let
param
=
{
token
:
this
.
token
||
this
.
$store
.
state
.
user
.
token
||
this
.
$store
.
state
.
coop
.
userInfo
.
userToken
||
localStorage
.
getItem
(
"couponToken"
)
||
getCookie
(
"couponToken"
),
// token: this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken,
setEntry
:
true
};
alert
(
'this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken'
,
this
.
token
,
this
.
$store
.
state
.
user
.
token
,
this
.
$store
.
state
.
coop
.
userInfo
.
userToken
);
console
.
log
(
'this.token || this.$store.state.user.token || this.$store.state.coop.userInfo.userToken'
,
this
.
token
,
this
.
$store
.
state
.
user
.
token
,
this
.
$store
.
state
.
coop
.
userInfo
.
userToken
);
this
.
GET
(
"campaign/admin/task/checkToken"
,
param
).
then
(
res
=>
{
if
(
res
.
code
!==
"000000"
)
{
alert
(
'commonCheckToken'
,
window
.
__isWeb
);
console
.
log
(
'commonCheckToken'
,
window
.
__isWeb
);
if
(
window
.
__isWeb
)
{
this
.
goLogin
();
}
else
{
...
...
src/views/coupon/coupon-list.vue
浏览文件 @
1245bf42
...
...
@@ -49,7 +49,7 @@ export default {
watch
:
{
webUserInfo
:
{
handler
(
userInfo
)
{
alert
(
"userInfo"
,
userInfo
);
console
.
log
(
"userInfo"
,
userInfo
);
if
(
userInfo
.
id
)
{
this
.
getAllCoupons
();
}
...
...
@@ -79,7 +79,7 @@ export default {
}
window
.
__getUserInfo4CouponList
=
function
(
param
)
{
alert
(
"__getUserInfo4CouponList"
,
param
);
console
.
log
(
"__getUserInfo4CouponList"
,
param
);
_this
.
token
=
param
.
userToken
;
_this
.
setUserInfo
(
param
);
_this
.
getAllCoupons
();
...
...
@@ -96,16 +96,13 @@ export default {
let
{
token
,
info
}
=
this
.
$store
.
state
.
user
;
token
=
token
||
localStorage
.
getItem
(
"couponToken"
)
||
getCookie
(
"couponToken"
);
this
.
token
=
token
;
alert
(
"1111 token"
+
token
);
alert
(
"222"
+
localStorage
.
getItem
(
"couponToken"
));
alert
(
"333"
+
getCookie
(
"couponToken"
));
// if (!token) {
//
alert
('this.goLogin()');
//
console.log
('this.goLogin()');
// this.goLogin();
// return;
// }
if
(
token
&&
!
info
.
id
)
{
alert
(
'4444 this.token'
+
this
.
token
);
console
.
log
(
'4444 this.token'
+
this
.
token
);
// this.commonCheckToken(() => {
this
.
$store
.
dispatch
(
"getUserInfo"
);
// });
...
...
@@ -146,7 +143,7 @@ export default {
this
.
POST
(
`trade/coupon/app/receive/
${
couponId
}
`
,
{}).
then
(
({
code
,
data
})
=>
{
if
(
code
==
"000000"
)
{
alert
(
"data.description"
,
data
.
description
);
console
.
log
(
"data.description"
,
data
.
description
);
data
.
description
&&
Toast
(
data
.
description
);
this
.
searchCoupons
();
}
...
...
@@ -169,13 +166,13 @@ export default {
item
.
disabled
=
item
.
couponStatus
==
0
||
item
.
couponStatus
==
1
||
item
.
couponStatus
==
4
;
newList
.
push
(
item
);
});
alert
(
newList
);
console
.
log
(
newList
);
return
newList
;
},
// 获取所有优惠券列表
getAllCoupons
()
{
alert
(
'getAllCoupons'
);
console
.
log
(
'getAllCoupons'
);
this
.
commonCheckToken
(()
=>
{
let
couponId
=
this
.
couponId
;
if
(
couponId
)
{
...
...
@@ -204,7 +201,7 @@ export default {
imgUrl
:
"https://file.yunqueyi.com/logo.png"
},
()
=>
{
alert
(
"share success..."
);
console
.
log
(
"share success..."
);
}
);
if
(
this
.
fromPage
)
{
...
...
src/views/goods-detail.vue
浏览文件 @
1245bf42
...
...
@@ -268,10 +268,10 @@ export default {
this
.
token
=
token
;
console
.
log
(
"token && !info.id"
,
!
info
.
id
,
token
);
if
(
!
token
)
{
this
.
goLogin
();
return
;
}
//
if (!token) {
//
this.goLogin();
//
return;
//
}
if
(
token
&&
!
info
.
id
)
{
this
.
commonCheckToken
(()
=>
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录