提交 19646cfa authored 作者: 龙菲's avatar 龙菲

增加密码加密

上级 977376e3
......@@ -17,6 +17,7 @@
"echarts": "^5.3.3",
"element-ui": "^2.15.9",
"js-cookie": "^3.0.1",
"js-md5": "^0.7.3",
"mockjs": "^1.1.0",
"node-sass": "^7.0.1",
"postcss-pxtorem": "^5.1.1",
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
......@@ -208,6 +208,7 @@
import { mapGetters } from "vuex";
import { getVerify } from "@/api/user";
import { getDisplayExistDict } from "@/api/display";
import md5 from 'js-md5'
export default {
name: "NavBar",
computed: {
......@@ -475,6 +476,7 @@ export default {
captcha,
password,
};
params.password = md5(params.password)
if (this.isLoginByUsername) {
params.username = account;
} else {
......
<template>
<span>
<span class="operations">
<span class="operation-item" @click="handleCollect" >
<svg-icon
icon-class="collect-s"
:style="{
fontSize: iconSize + 'px',
color: collectCountStatus ? selectColor : '#61666d',
}"
></svg-icon>
<span>{{
formatNum(collectCount) == 0 ? "收藏" : formatNum(collectCount)
}}</span>
</span>
</span>
<el-dialog
title="登录提示"
:visible.sync="loginDialogVisible"
width="30%"
:before-close="handleLoginClose"
append-to-body
>
<span>读者功能需登录进行使用,是否去登录?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="loginDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.native="handleToLogin"
>确 定</el-button
>
</span>
</el-dialog>
</span>
</template>
<script>
import { mapGetters } from "vuex";
import { debounce, formatNum } from "@/utils/index";
export default {
name: "ReaderOperations",
props: {
// 是否需要收藏,默认需要
collect: {
type: Boolean,
default: true,
},
// 收藏数量
collectCount: {
type: String,
default: "0",
},
// 收藏状态
collectCountStatus: {
type: Boolean,
default: false,
},
sourceId: {
type: String,
default: "",
},
// 来源类型 biz_cultural_relic-文物;biz_exhibition-布展;biz_elite_exhibition-精品展
sourceType: {
type: String,
default: "",
},
title: {
type: String,
default: "",
},
iconSize: {
type: [Number, String],
default: 22,
},
selectColor: {
type: String,
default: "$themeColor",
},
},
data() {
return {
loginDialogVisible: false,
};
},
computed: {
...mapGetters(["token", "showLoginDialog"]),
},
methods: {
handleCollect: debounce(function () {
if (this.token) {
const params = {
sourceId: this.sourceId,
sourceType: this.sourceType,
title: this.title,
};
this.$store.dispatch("user/toggleCollect", params).then(() => {
if (!this.collectCountStatus) {
// 点赞
this.$message.success("已收藏!");
} else {
this.$message.success("已取消收藏!");
}
this.$emit("reload");
});
} else {
this.loginDialogVisible = true;
}
}),
handleLoginClose() {
this.loginDialogVisible = false;
},
handleToLogin() {
this.loginDialogVisible = false;
if (!this.showLoginDialog) {
this.$store.commit("app/OPEN_LOGIN_DIALOG", true);
}
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
},
formatNum(num) {
return formatNum(num);
},
},
};
</script>
<style lang="scss" scoped>
.operations {
// margin-top: 22px;
display: flex;
justify-content: space-between;
.operation-item {
display: flex;
align-items: center;
// margin-right: 32px;
cursor: pointer;
font-size: 14px;
}
.svg-icon {
margin-right: 10px;
font-size: 24px;
color: #61666d;
}
.collect {
color: #831122;
}
}
.el-button--text {
color: $themeColor;
}
::v-deep .el-input-group__append {
padding: 0 40px;
}
::v-deep .dialog-footer {
.el-button {
border-radius: 0;
}
.el-button--primary {
border: none;
background-color: $themeColor;
}
}
</style>
\ No newline at end of file
<template>
<span>
<span class="operations">
<span class="operation-item">
<!-- <svg-icon
@click="handleLike"
:icon-class="loveCountStatus ? 'like-s' : 'like'"
:style="{
fontSize: iconSize + 'px',
color: loveCountStatus ? selectColor : '#61666d',
}"
></svg-icon> -->
<svg-icon
@click="handleLike"
:icon-class="loveCountStatus ? 'like-s' : 'like'"
:style="{
fontSize: iconSize + 'px',
color: loveCountStatus ? selectColor : '#ddd',
}"
></svg-icon>
<span>{{
formatNum(loveCount) == 0 ? "点赞" : formatNum(loveCount)
}}</span>
</span>
</span>
<el-dialog
title="登录提示"
:visible.sync="loginDialogVisible"
width="30%"
:before-close="handleLoginClose"
append-to-body
>
<span>读者功能需登录进行使用,是否去登录?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="loginDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.native="handleToLogin"
>确 定</el-button
>
</span>
</el-dialog>
</span>
</template>
<script>
import { mapGetters } from "vuex";
import { debounce, formatNum } from "@/utils/index";
export default {
name: "Like",
props: {
// 点赞数量
loveCount: {
type: String,
default: "0",
},
// 点赞状态
loveCountStatus: {
type: Boolean,
default: false,
},
sourceId: {
type: String,
default: "",
},
// 来源类型 biz_cultural_relic-文物;biz_exhibition-布展;biz_elite_exhibition-精品展
sourceType: {
type: String,
default: "",
},
title: {
type: String,
default: "",
},
iconSize: {
type: [Number, String],
default: 22,
},
selectColor: {
type: String,
default: "$themeColor",
},
},
data() {
return {
loginDialogVisible: false,
};
},
computed: {
...mapGetters(["token", "showLoginDialog"]),
},
methods: {
// 点赞
handleLike: debounce(function () {
if (this.token) {
const params = {
sourceId: this.sourceId,
sourceType: this.sourceType,
title: this.title,
};
this.$store.dispatch("user/toggleLike", params).then(() => {
if (!this.loveCountStatus) {
// 点赞
this.$message.success("已点赞!");
} else {
this.$message.success("已取消点赞!");
}
this.$emit("reload");
});
} else {
this.loginDialogVisible = true;
}
}, 500),
handleShare() {
this.curLink = window.location.href.toString();
this.shareDialogVisible = true;
},
handleLoginClose() {
this.loginDialogVisible = false;
},
handleToLogin() {
this.loginDialogVisible = false;
if (!this.showLoginDialog) {
this.$store.commit("app/OPEN_LOGIN_DIALOG", true);
}
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
},
formatNum(num) {
return formatNum(num);
},
},
};
</script>
<style lang="scss" scoped>
.operations {
// margin-top: 22px;
display: flex;
justify-content: space-between;
.operation-item {
display: flex;
align-items: center;
// margin-right: 32px;
cursor: pointer;
font-size: 14px;
}
.svg-icon {
margin-right: 10px;
font-size: 24px;
color: #61666d;
}
.like {
color: #831122;
}
.collect {
color: #831122;
}
}
.el-button--text {
color: $themeColor;
}
::v-deep .el-input-group__append {
padding: 0 40px;
}
::v-deep .dialog-footer {
.el-button {
border-radius: 0;
}
.el-button--primary {
border: none;
background-color: $themeColor;
}
}
</style>
\ No newline at end of file
<template>
<span>
<span class="operations">
<span class="operation-item" @click="handleShare">
<svg-icon
icon-class="share2"
class="collect"
:style="{
fontSize: iconSize + 'px',
color: selectColor,
}"
></svg-icon>
<span>分享</span>
</span>
</span>
<el-dialog
title="分享给朋友"
:visible.sync="shareDialogVisible"
width="40%"
:before-close="handleShareClose"
append-to-body
>
<!-- <div class="qrcode">
</div> -->
<div class="copy">
<!-- <div class="link">{{ curLink }}</div> -->
<el-input v-model="curLink" style="width: 100%">
<template slot="append">
<el-button type="text" @click.native="copyUrl">
<svg-icon icon-class="copy"></svg-icon>
复制链接</el-button
></template
>
</el-input>
</div>
</el-dialog>
</span>
</template>
<script>
import { mapGetters } from "vuex";
import { debounce, formatNum } from "@/utils/index";
export default {
name: "Share",
props: {
sourceId: {
type: String,
default: "",
},
// 来源类型 biz_cultural_relic-文物;biz_exhibition-布展;biz_elite_exhibition-精品展
sourceType: {
type: String,
default: "",
},
title: {
type: String,
default: "",
},
iconSize: {
type: [Number, String],
default: 22,
},
selectColor: {
type: String,
default: "$themeColor",
},
},
data() {
return {
shareDialogVisible: false,
curLink: "", //当前地址栏的链接
};
},
computed: {
...mapGetters(["token", "showLoginDialog"]),
},
methods: {
handleShare() {
this.curLink = window.location.href.toString();
this.shareDialogVisible = true;
},
handleLoginClose() {
this.loginDialogVisible = false;
},
handleShareClose() {
this.shareDialogVisible = false;
},
handleToLogin() {
this.loginDialogVisible = false;
if (!this.showLoginDialog) {
this.$store.commit("app/OPEN_LOGIN_DIALOG", true);
}
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
},
copyUrl() {
let inputElement = document.createElement("input");
inputElement.value = this.curLink;
document.body.appendChild(inputElement);
inputElement.select();
document.execCommand("Copy");
inputElement.remove();
this.$message.success("已复制到剪贴板!赶快去分享吧~");
},
formatNum(num) {
return formatNum(num);
},
},
};
</script>
<style lang="scss" scoped>
.operations {
// margin-top: 22px;
display: flex;
justify-content: space-between;
.operation-item {
display: flex;
align-items: center;
// margin-right: 32px;
cursor: pointer;
font-size: 14px;
}
.svg-icon {
margin-right: 10px;
font-size: 24px;
color: #61666d;
}
}
.el-button--text {
color: $themeColor;
}
.copy {
display: flex;
align-items: center;
height: 180px;
}
.qrcode {
.img-container {
width: 200px;
height: 200px;
img {
width: 100%;
height: 100%;
}
}
}
::v-deep .el-input-group__append {
padding: 0 40px;
}
::v-deep .dialog-footer {
.el-button {
border-radius: 0;
}
.el-button--primary {
border: none;
background-color: $themeColor;
}
}
</style>
\ No newline at end of file
......@@ -230,8 +230,6 @@ export default {
CRDetail: {},
relateRelics: [],
audioPlaying: true,
dotImg: require("@/assets/imgs/display/normal/mz-dot.png"),
dotImgS: require("@/assets/imgs/display/normal/mz-dot-s.png"),
page: null,
currentRcKey: "type",
currentVideo: null,
......
......@@ -372,8 +372,6 @@
CRDetail: {},
relateRelics: [],
audioPlaying: true,
dotImg: require("@/assets/imgs/display/normal/mz-dot.png"),
dotImgS: require("@/assets/imgs/display/normal/mz-dot-s.png"),
page: null,
currentRcKey: "type",
currentVideo: null,
......
......@@ -132,8 +132,8 @@
@click="handleClickAudio"
v-if="displayDetail.audiosVo && displayDetail.audiosVo.length > 0"
>
<img src="@/assets/imgs/display/normal/music.png" alt="" />
<!-- <svg-icon icon-class="music"></svg-icon> -->
<!-- <img src="@/assets/imgs/display/normal/music.png" alt="" /> -->
<svg-icon icon-class="music"></svg-icon>
<AudioPlayer
style="display: none"
:url="$getFullUrl(displayDetail.audiosVo[0].url)"
......@@ -398,8 +398,6 @@ export default {
relateRelics: [],
audioPlaying: true,
curUnit: {},
dotImg: require("@/assets/imgs/display/normal/mz-dot.png"),
dotImgS: require("@/assets/imgs/display/normal/mz-dot-s.png"),
page: null,
currentVideo: {},
videoSwiperOption: {
......@@ -1339,54 +1337,6 @@ $titleFontFamily: SourceHanSerifCN-Bold;
}
}
::v-deep .el-tree .el-tree-node__expand-icon.expanded {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
//有子节点 且未展开
::v-deep .el-tree .el-icon-caret-right:before {
background: url("~@/assets/imgs/display/normal/tree-node.png") no-repeat 0 3px;
content: "";
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
}
//有子节点 且已展开
::v-deep
.el-tree
.el-tree-node__expand-icon.expanded.el-icon-caret-right:before {
background: url("~@/assets/imgs/display/normal/tree-node-s.png") no-repeat 0
3px;
content: "";
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
}
//没有子节点
::v-deep .el-tree .el-tree-node__expand-icon.is-leaf::before {
background: transparent;
content: "";
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
}
// 修改tree icon
::v-deep .el-carousel__item--card {
width: 100%;
height: 100%;
transform: translateX(0) scale(1) !important;
}
::v-deep .el-carousel {
height: 100%;
}
......@@ -1395,27 +1345,7 @@ $titleFontFamily: SourceHanSerifCN-Bold;
height: 100%;
}
::v-deep .el-tree {
background: transparent;
.el-tree-node__content {
height: 54px;
&:hover {
background-color: #fff;
color: $themeColor;
}
padding-left: 16px !important;
}
.is-current {
.el-tree-node__content {
background-color: #fff;
color: $themeColor;
}
}
}
@keyframes filmMoveLeft {
0% {
......
......@@ -111,7 +111,7 @@ $blue: $themeColor;
flex-direction: column;
align-items: center;
// background: url("@/assets/imgs/home/virtual-bg.png") 100% 50% 0% center no-repeat;
background-image: url("@/assets/imgs/home/virtual-bg.png");
// background-image: url("@/assets/imgs/home/virtual-bg.png");
background-size: 100% 50%;
background-repeat: no-repeat;
background-position-y: 70%;
......
......@@ -83,7 +83,7 @@
<script>
import { register } from "@/api/user";
import { checkUserName, checkPhone } from "@/utils/validate";
import md5 from 'js-md5'
export default {
data() {
var validatePass = (rule, value, callback) => {
......@@ -215,6 +215,7 @@ export default {
nickName,
status: 1,
};
params.password = md5(params.password)
register(params)
.then((res) => {
if (res.code == "0") {
......@@ -258,7 +259,8 @@ export default {
<style lang="scss" scoped>
.wrapper {
width: 100%;
background-image: url("@/assets/imgs/home/display-bg.png");
// background-image: url("@/assets/imgs/home/display-bg.png");
// background-color: rgba($color: $themeColor, $alpha: 0.2);
background-repeat: no-repeat;
background-size: 100%;
background-position: center;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论