Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-professional-exam
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Culm
pica-professional-exam
提交
418b4222
提交
418b4222
编写于
8月 28, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改cookies写法
详情样式
上级
17308912
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
39 行增加
和
27 行删除
+39
-27
course-intro.vue
src/components/course/course-intro.vue
+3
-3
index.js
src/utils/index.js
+31
-23
test-components.vue
src/views/test-components.vue
+5
-1
未找到文件。
src/components/course/course-intro.vue
浏览文件 @
418b4222
...
@@ -78,11 +78,11 @@ export default {
...
@@ -78,11 +78,11 @@ export default {
// background: #fff;
// background: #fff;
position: absolute;
position: absolute;
right: 0;
right: 0;
bottom:
0
;
bottom:
-18px
;
display: flex;
display: flex;
align-items: center;
align-items: center;
padding-left: 30px;
//
padding-left: 30px;
background: linear-gradient(90deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 1));
//
background: linear-gradient(90deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 1));
img {
img {
position: relative;
position: relative;
top: 1px;
top: 1px;
...
...
src/utils/index.js
浏览文件 @
418b4222
...
@@ -205,28 +205,36 @@ export function isWeiXin() {
...
@@ -205,28 +205,36 @@ export function isWeiXin() {
}
}
}
}
export
const
setCookie
=
(
cname
,
cvalue
,
exdays
=
30
,
domain
=
'.yunqueyi.com'
)
=>
{
//yunqueyi.com
export
const
setCookie
=
(
name
,
value
,
time
)
=>
{
let
d
=
new
Date
(),
expires
=
''
;
var
expires
=
30
*
24
*
60
*
60
*
1000
;
//一天
if
(
BUILD_ENV
===
'dev'
)
{
var
date
=
new
Date
(
+
new
Date
()
+
expires
);
domain
=
window
.
location
.
hostname
;
if
(
time
)
{
document
.
cookie
=
name
+
'='
+
escape
(
value
)
+
'; path=/'
+
';expires='
+
date
.
toUTCString
();
}
else
{
document
.
cookie
=
name
+
'='
+
escape
(
value
)
+
'; path=/'
;
}
}
d
.
setTime
(
d
.
getTime
()
+
(
exdays
*
24
*
60
*
60
*
1000
));
};
expires
=
`expires=
${
d
.
toUTCString
()}
`
;
document
.
cookie
=
`
${
cname
}
=
${
cvalue
}
;path=/;
${
expires
}
;domain=
${
domain
}
`
;
export
const
delCookie
=
key
=>
{
}
var
expires
=
-
1
*
24
*
60
*
60
*
1000
;
//一天
var
date
=
new
Date
(
+
new
Date
()
+
expires
);
export
const
getCookie
=
(
cname
)
=>
{
document
.
cookie
=
const
reg
=
new
RegExp
(
'(^| )'
+
cname
+
'=([^;]*)(;|$)'
);
key
+
'='
+
escape
(
''
)
+
'; path=/'
+
';expires='
+
date
.
toUTCString
();
//这里只需要把Cookie保质期退回一天便可以删除
const
arr
=
document
.
cookie
.
match
(
reg
);
};
return
arr
?
unescape
(
arr
[
2
])
:
null
;
}
export
const
getCookie
=
key
=>
{
var
cookieArr
=
document
.
cookie
.
split
(
'; '
);
export
const
delCookie
=
(
cname
)
=>
{
for
(
var
i
=
0
;
i
<
cookieArr
.
length
;
i
++
)
{
var
exp
=
new
Date
();
var
arr
=
cookieArr
[
i
].
split
(
'='
);
exp
.
setTime
(
exp
.
getTime
()
-
1
);
if
(
arr
[
0
]
===
key
)
{
var
cval
=
getCookie
(
cname
);
return
arr
[
1
];
if
(
cval
!=
null
)
{
}
document
.
cookie
=
'token=; path=/; expires='
+
new
Date
(
0
).
toUTCString
();
document
.
cookie
=
'token=; path=/; domain=.yunqueyi.com; expires='
+
new
Date
(
0
).
toUTCString
();
}
}
}
return
''
;
\ No newline at end of file
};
\ No newline at end of file
src/views/test-components.vue
浏览文件 @
418b4222
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
</div>
-->
</div>
-->
<!--
<CourseCovers></CourseCovers>
-->
<!--
<CourseCovers></CourseCovers>
-->
<!--
<div
@
click=
"testDialog"
>
testDialog
</div>
-->
<!--
<div
@
click=
"testDialog"
>
testDialog
</div>
-->
<CourseIntro
:intro=
"intro"
></CourseIntro>
<BriefIntro></BriefIntro>
<BriefIntro></BriefIntro>
</div>
</div>
</
template
>
</
template
>
...
@@ -28,11 +29,13 @@ import CommonErrorTips from "@/components/course/common-error-tips";
...
@@ -28,11 +29,13 @@ import CommonErrorTips from "@/components/course/common-error-tips";
import
CourseButton
from
"@/components/course/course-button"
;
import
CourseButton
from
"@/components/course/course-button"
;
import
CourseCovers
from
"@/components/course/course-covers"
;
import
CourseCovers
from
"@/components/course/course-covers"
;
import
BriefIntro
from
"@/components/course/brief-intro"
;
import
BriefIntro
from
"@/components/course/brief-intro"
;
import
CourseIntro
from
"@/components/course/course-intro"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
isShowDialog
:
true
,
isShowDialog
:
true
,
intro
:
"更多其他课程,请前往鹊医App学习更多其他课程,请前往鹊医App学习更多其他课程,请前往鹊医App学习更多其他课程,请前往鹊医App学习更多其他课程,请前往鹊医App学习更多其他课程,请前往鹊医App学习更多其他课程,请前往鹊医App学习"
};
};
},
},
components
:
{
components
:
{
...
@@ -42,7 +45,8 @@ export default {
...
@@ -42,7 +45,8 @@ export default {
// CommonErrorTips,
// CommonErrorTips,
// CourseButton,
// CourseButton,
// CourseCovers,
// CourseCovers,
BriefIntro
BriefIntro
,
CourseIntro
},
},
mounted
()
{
mounted
()
{
// Toast
// Toast
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录