shaogen1995 3 yıl önce
ebeveyn
işleme
2288652b76

+ 1 - 1
new_backstage/package.json

@@ -12,7 +12,7 @@
     "core-js": "^3.6.5",
     "echarts": "^5.3.0",
     "element-ui": "^2.15.3",
-    "js-base64": "^3.6.1",
+    "js-base64": "^3.7.2",
     "moment": "^2.29.1",
     "vue": "^2.6.11",
     "vue-router": "^3.2.0",

BIN
new_backstage/public/template.xlsx


+ 9 - 0
new_backstage/src/configue/api.js

@@ -345,4 +345,13 @@ export const getReportVote = (data) => {
     url: 'cms/report/vote',
     data
   })
+}
+
+// 修改密码
+export const userupdatePwd = (data) => {
+  return axios({
+    method: 'post',
+    url: 'sys/user/updatePwd',
+    data
+  })
 }

+ 2 - 2
new_backstage/src/configue/http.js

@@ -8,9 +8,9 @@ const vue = new Vue();
 var isProduction = process.env.NODE_ENV === "production";
 let loading = "";
 // 线上打包
-const serverName = isProduction ? "/" : "http://192.168.0.245:8003/";
+// const serverName = isProduction ? "/" : "http://192.168.0.245:8003/";
 // 线下调试
-// const serverName = isProduction ? "/" : "http://192.168.0.135:8003/";
+const serverName = isProduction ? "/" : "http://192.168.0.135:8003/";
 
 const serverLocation = window.location.hostname;
 

+ 1 - 1
new_backstage/src/configue/menu.js

@@ -190,7 +190,7 @@ let main = [
   {
     name: "统计管理",
     key: "info",
-    icon: "iconsys_nav_system",
+    icon: "el-icon-s-data",
     routes: [],
     id: "3"
   },

+ 2 - 1
new_backstage/src/pages/content/collection/componets/leftTab.vue

@@ -102,7 +102,7 @@ export default {
   }
   .hover {
     cursor: pointer;
-    width: 52px;
+    width: 40px;
     display: flex;
     justify-content: right;
     align-items: center;
@@ -112,6 +112,7 @@ export default {
     right: 0;
     & > i {
       margin-right: 2px;
+      width: 18px;
       &:hover {
         color: #b63c25;
       }

+ 10 - 4
new_backstage/src/pages/content/collection/index.vue

@@ -69,7 +69,12 @@
 
             <el-button @click="getList" type="primary">查询</el-button>
             <el-button
-              @click="(search.date = ''), (search.inputKey = ''),(search.sortType = 'time'), getList()"
+              @click="
+                (search.date = ''),
+                  (search.inputKey = ''),
+                  (search.sortType = 'time'),
+                  getList()
+              "
               >重置</el-button
             >
           </div>
@@ -212,7 +217,7 @@ export default {
         inputKey: "",
         date: "",
         state: "",
-        sortType:'time'
+        sortType: "time",
       },
       status: "all",
       menu: [],
@@ -280,6 +285,8 @@ export default {
         return this.$message.warning("模块名称不能为空");
       if (this.ruleForm.isVote === 1 && this.ruleForm.voteCount < 1)
         return this.$message.warning("投票数量不能小于1");
+      if (this.ruleForm.isVote === 1 && this.ruleForm.voteCount > 99)
+        return this.$message.warning("投票数量不能大于99");
       else {
         let res = await addTabList(this.ruleForm);
         if (res.code === 0) {
@@ -314,7 +321,7 @@ export default {
     },
 
     getList() {
-      let { inputKey, date,sortType } = this.search;
+      let { inputKey, date, sortType } = this.search;
       getList(
         this.type,
         {
@@ -326,7 +333,6 @@ export default {
           status: this.status == "all" ? "" : this.status,
           type: this.subMenu,
           goodsModuleId: this.goodsModuleId,
-
         },
         (data) => {
           this.list = data.data;

+ 5 - 3
new_backstage/src/pages/content/interaction/componets/questionGroup.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-form-item label="题组标题:" prop="name">
-      <el-input v-model="form.name" :maxlength="INPUTLENGTH" show-word-limit></el-input>
+      <el-input v-model="form.name" :maxlength="100" show-word-limit></el-input>
     </el-form-item>
 
     <el-form-item prop="answerStr">
@@ -17,7 +17,7 @@
           </div>
           <div class="qtitle">
             <label class="required">题目:</label>
-            <el-input v-model="item.question" :maxlength="INPUTLENGTH" show-word-limit></el-input>
+            <el-input v-model="item.question" :maxlength="100" show-word-limit></el-input>
           </div>
 
           <div class="qanswer">
@@ -25,7 +25,7 @@
             <draggable tag="ul" animation="300" v-model="item.answer">
               <li v-for="(sub,idx) in item.answer" :key="idx">
                 <el-radio v-model="item.correct" :label="sub.val"><span style="display:none">{{idx}}</span></el-radio>
-                <input v-model="sub.name" placeholder="请输入选项内容"  :maxlength="INPUTLENGTH" show-word-limit type="text">
+                <input v-model="sub.name" placeholder="请输入选项内容"  :maxlength="100" show-word-limit type="text" style="width:90%">
                 <i @click="delAnswer(item,idx)" class="el-icon-close"></i>
               </li>
               <el-button size="small" @click="addAnswer(item)" type="primary">增加选项<i class="el-icon-plus el-icon--right"></i></el-button>
@@ -137,7 +137,9 @@ input{
       >ul{
         display: flex;
         align-items: center;
+        width: 100%;
         >li{
+          width: 23%;
           margin-right: 10px;
           padding: 0 10px;
           background: #f3f3f3;

+ 84 - 25
new_backstage/src/pages/info/statistics/index.vue

@@ -37,7 +37,7 @@
                 >
                 </el-date-picker>
               </div>
-              <el-button type="primary" @click="search(index,item)"
+              <el-button type="primary" @click="search(index, item)"
                 >查询统计</el-button
               >
             </div>
@@ -118,7 +118,7 @@ export default {
         {
           name: "注册用户统计",
           time: [],
-          txt: ["超级管理员", "游客", "审核管理员", "内容管理员"],
+          txt: [],
           title: "数量",
           className: "ech_tow",
         },
@@ -135,31 +135,54 @@ export default {
   components: {},
   methods: {
     // 最后一个图表的查询
-    searchLast(){
-      if(this.timeLast===null) return this.$message.warning('请选择时间范围');
-      let temp1=this.timeLast[0].split('-')
-      let temp2=this.timeLast[1].split('-')
-      if(Number(temp2[0])>Number(temp1[0])&&Number(temp2[1])>Number(temp1[1])){
-        return this.$message.warning('时间范围不能超过1年');
-      } 
-      this.getReportVote(this.timeLast[0]+' 00:00:00',this.timeLast[1]+' 23:59:59')
+    searchLast() {
+      if (this.timeLast === null)
+        return this.$message.warning("请选择时间范围");
+      let temp1 = this.timeLast[0].split("-");
+      let temp2 = this.timeLast[1].split("-");
+      if (
+        Number(temp2[0]) > Number(temp1[0]) &&
+        Number(temp2[1]) > Number(temp1[1])
+      ) {
+        return this.$message.warning("时间范围不能超过1年");
+      }
+      if (Number(temp2[0]) - Number(temp1[0]) > 1)
+        return this.$message.warning("时间范围不能超过1年");
+      this.getReportVote(
+        this.timeLast[0] + " 00:00:00",
+        this.timeLast[1] + " 23:59:59"
+      );
       // this.$message.success('查询成功')
     },
     // 点击查询
-    search(index,item) {
+    search(index, item) {
       // console.log(item.time);
-      if(item.time===null) return this.$message.warning('请选择时间范围');
-      let temp1=item.time[0].split('-')
-      let temp2=item.time[1].split('-')
-      if(Number(temp2[0])>Number(temp1[0])&&Number(temp2[1])>Number(temp1[1])){
-        return this.$message.warning('时间范围不能超过1年');
-      } 
+      if (item.time === null) return this.$message.warning("请选择时间范围");
+      let temp1 = item.time[0].split("-");
+      let temp2 = item.time[1].split("-");
+      if (
+        Number(temp2[0]) > Number(temp1[0]) &&
+        Number(temp2[1]) > Number(temp1[1])
+      ) {
+        return this.$message.warning("时间范围不能超过1年");
+      }
+      if (Number(temp2[0]) - Number(temp1[0]) > 1)
+        return this.$message.warning("时间范围不能超过1年");
       if (index === 0) {
-        this.getReportVisit(item.time[0]+' 00:00:00',item.time[1]+' 23:59:59');
+        this.getReportVisit(
+          item.time[0] + " 00:00:00",
+          item.time[1] + " 23:59:59"
+        );
       } else if (index === 1) {
-        this.getReportUser(item.time[0]+' 00:00:00',item.time[1]+' 23:59:59');
+        this.getReportUser(
+          item.time[0] + " 00:00:00",
+          item.time[1] + " 23:59:59"
+        );
       } else if (index === 2) {
-        this.getReportInteract(item.time[0]+' 00:00:00',item.time[1]+' 23:59:59');
+        this.getReportInteract(
+          item.time[0] + " 00:00:00",
+          item.time[1] + " 23:59:59"
+        );
       }
       // this.$message.success('查询成功')
     },
@@ -168,6 +191,12 @@ export default {
       const chartDom = document.querySelector(dom);
       const myChart = echarts.init(chartDom);
       const option = {
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "shadow",
+          },
+        },
         color: ["#5c7bd9"],
         xAxis: [
           {
@@ -196,6 +225,12 @@ export default {
       const chartDom = document.querySelector(".ech_four");
       const myChart = echarts.init(chartDom);
       const option = {
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "shadow",
+          },
+        },
         color: ["#5c7bd9", "#c0504d"],
         xAxis: {
           type: "category",
@@ -237,7 +272,7 @@ export default {
 
     // 封装注册用户统计方法
     async getReportUser(startTime, endTime) {
-     let res2= await getReportUser({ endTime, startTime });
+      let res2 = await getReportUser({ endTime, startTime });
       // 由于接口没有完善,先模拟数据
       // let moni1 = [
       //   { count: 1, name: "超级管理员" },
@@ -256,6 +291,9 @@ export default {
         tempFont = {
           interval: 0, //强制文字产生间隔
           rotate: 45, //文字逆时针旋转45°
+          formatter: function (value) {
+            return value.length > 5 ? value.substring(0, 5) + "..." : value;
+          },
         };
       }
       res2.data.forEach((v) => {
@@ -277,7 +315,7 @@ export default {
 
     // 封装投票点赞统计方法
     async getReportVote(startTime, endTime) {
-     let res4 = await getReportVote({ endTime, startTime });
+      let res4 = await getReportVote({ endTime, startTime });
       //模拟数据
       // let moni2 = [
       //   { countLike: 1, countVote: 2, name: "实物模型" },
@@ -292,7 +330,18 @@ export default {
       let temp4_1 = [];
       let temp4_2 = [];
       let temp4Font = {};
-      if (res4.data.length > 6) temp4Font = { interval: 0, rotate: 45 };
+
+
+      if (res4.data.length > 6) {
+        temp4Font = {
+          interval: 0, //强制文字产生间隔
+          rotate: 45, //文字逆时针旋转45°
+          formatter: function (value) {
+            return value.length > 5 ? value.substring(0, 5) + "..." : value;
+          },
+        };
+
+      }
       res4.data.forEach((v) => {
         temp4Txt.push(v.name);
         temp4_1.push(v.countVote);
@@ -324,12 +373,12 @@ export default {
     });
     //  当前时间 格式2022-02-10
     let nowTime = moment(new Date()).format("YYYY-MM-DD");
-    nowTime=nowTime+' 23:59:59'
+    nowTime = nowTime + " 23:59:59";
     // 一个月之前 格式2022-01-10
     let nowTimeBefore = moment(new Date())
       .subtract(1, "months")
       .format("YYYY-MM-DD");
-      nowTimeBefore=nowTimeBefore+' 00:00:00'
+    nowTimeBefore = nowTimeBefore + " 00:00:00";
     // console.log(nowTime, nowTimeBefore);
     // 设置初始时间为当前时间和前一个月
     this.ecBox.forEach((v) => {
@@ -456,6 +505,16 @@ export default {
         }
       }
     }
+    /deep/.el-button--primary:focus {
+      color: #fff;
+      background-color: #b63c25;
+      border-color: #b63c25;
+    }
+    /deep/.el-button--primary:hover {
+      background: #c56351;
+      border-color: #c56351;
+      color: #fff;
+    }
   }
 }
 </style>

+ 45 - 24
new_backstage/src/pages/layout/aside.vue

@@ -7,7 +7,7 @@
           <i class="iconfont" :class="item.icon"></i>{{ item.name }}
         </div>
         <div
-          @click="goto(sub,idx)"
+          @click="goto(sub, idx)"
           v-for="(sub, idx) in item.routes"
           :key="idx"
           :class="{ activeFont: activeIdx === sub.key }"
@@ -30,7 +30,7 @@ export default {
       main,
       menu: [],
       tmpRoute: [],
-      myInd:null
+      myInd: null,
     };
   },
   computed: {
@@ -62,7 +62,7 @@ export default {
   },
   methods: {
     goto(item) {
-      if(item.key===this.activeIdx) return
+      if (item.key === this.activeIdx) return;
       //当前页面不在精品典藏,进入精品典藏的时候把本地存储id变成1
       if (item.id === 200 && this.$route.path !== "/collection/model") {
         localStorage.setItem("XJ_goodsModuleId", 1);
@@ -74,6 +74,7 @@ export default {
       };
       this.$router.push(path);
     },
+
     async getResource() {
       let result = await this.$http({
         method: "GET",
@@ -81,43 +82,63 @@ export default {
       });
       // console.log(123,result);
       // 把权限本地存储起来,用来管理新增的功能自定义模块
-       localStorage.setItem('XJ_limits_ZDY',JSON.stringify(result.data[1].children[3].children))
+      localStorage.setItem(
+        "XJ_limits_ZDY",
+        JSON.stringify(result.data[1].children[3].children)
+      );
 
       this.tmpRoute = routes.filter((item) => {
         let tmp = "";
         result.data.forEach((sub) => {
           if (item.name == sub.name) {
-            if (sub.authority) {
+            if (sub.name == "操作日志") {
+              sub.authority = sub.children[0].authority;
+            }
+
+            let ttmp = "";
+            if (sub.children) {
+              for (let i = 0; i < sub.children.length; i++) {
+                let cccc = sub.children[i];
+                if (cccc.children) {
+                  ttmp = cccc.children.find((tttt) => tttt.authority);
+                } else {
+                  ttmp = cccc.authority;
+                }
+
+                if (ttmp) {
+                  break;
+                }
+              }
+            }
+            if (ttmp) {
+              sub.authority = true;
               tmp = sub;
             }
           }
         });
-        if (item.type == "system") {
-          if (window.localStorage.getItem("role") == "sys_admin") {
-            tmp = item;
-          } else {
-            tmp = "";
-          }
-        }
         return tmp ? Object.assign(item, tmp) : tmp;
       });
-      // 只有管理员能看网站数据统计
-      if(window.localStorage.getItem("role") == "sys_admin") {
-        this.tmpRoute.push({
-          id: "9",
-          key: "statistics",
-          name: "网站数据统计",
-          noEdit: true,
-          type: "info",
-        });
-      }
-      //---------------------没有设置权限,临时push进去----------------------------------
 
       console.log(this.tmpRoute);
+
+      // 只有管理员能看网站数据统计
+      // if (window.localStorage.getItem("role") == "sys_admin") {
+      //   this.tmpRoute.push({
+      //     id: "9",
+      //     key: "statistics",
+      //     name: "网站数据统计",
+      //     noEdit: true,
+      //     type: "info",
+      //   });
+      // }
+
+      console.log(this.tmpRoute, "temp");
+
       let temp = this.tmpRoute.filter((item) => {
         return item.key == this.activeIdx;
       });
-      this.$store.commit("SetActiveMenu", temp[0]);
+
+      this.$store.commit("SetActiveMenu", temp[0] || this.tmpRoute[0]);
 
       this.menu = main.filter((item) => {
         let route = [];

+ 179 - 72
new_backstage/src/pages/layout/head.vue

@@ -1,96 +1,183 @@
 <!--  -->
 <template>
-<div class='header card'>
-  <div class="header-title">
-    <img src="@/assets/img/logo.png" alt="">
-    <span>中国人民武装警察部队新疆生产建设兵团总队</span>
-  </div>
-  <div class="header-user">
-    <div class="avatars" @click="handleAvatar">
-      <img v-if="userInfo.img" :src="userInfo.img" alt="">
-      <span>{{userInfo.nickName}}</span>
+  <div class="header card">
+    <div class="header-title">
+      <img src="@/assets/img/logo.png" alt="" />
+      <span>中国人民武装警察部队新疆生产建设兵团总队</span>
+    </div>
+    <div class="header-user" @mouseenter="cut = true" @mouseleave="cut = false">
+      <div class="avatars" @click="handleAvatar">
+        <img v-if="userInfo.img" :src="userInfo.img" alt="" />
+        <span>{{ userInfo.nickName }}</span>
+      </div>
+      <!-- 下箭头 -->
+      <div class="pull_down" v-if="cut"></div>
+      <div class="pull_up" v-else></div>
+      <!-- 鼠标移入箭头出来的ul -->
+      <ul class="user_handle" v-show="cut">
+        <li @click="isShow = true">修改密码</li>
+        <li @click="logoutcomfirm">退出登录</li>
+      </ul>
+      <!-- <div @click="logoutcomfirm" class="logout"><img src="@/assets/img/logout.png" alt="">退出</div> -->
     </div>
-    <div @click="logoutcomfirm" class="logout"><img src="@/assets/img/logout.png" alt="">退出</div>
-  </div>
 
-  <usereditdialog :key="ran" @logout="logout(true)" :form="userInfo" :show="isShowEdit" @close="isShowEdit=false"/>
-  
-</div>
+    <!-- <usereditdialog :key="ran" @logout="logout(true)" :form="userInfo" :show="isShowEdit" @close="isShowEdit=false"/> -->
+    <!-- 点击修改密码出现弹窗 -->
+    <el-dialog title="修改密码" :visible.sync="isShow" @close="btnX()">
+      <el-form :model="form" label-width="100px" :rules="rules" ref="ruleForm">
+        <el-form-item label="旧密码:" prop="oldPassword">
+          <el-input
+            v-model="form.oldPassword"
+            placeholder="请输入"
+            show-password
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="新密码:" prop="newPassword">
+          <el-input
+            v-model="form.newPassword"
+            placeholder="请输入"
+            show-password
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="确定新密码:" prop="checkPass">
+          <el-input
+            v-model="form.checkPass"
+            placeholder="请输入"
+            show-password
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="btnX">取 消</el-button>
+        <el-button type="primary" @click="btnOk">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-import usereditdialog from '@/components/editcomponent/usereditdialog'
-import {getSysDetail} from "@/configue/api";
+import { encodeStr } from './pass.js'
+import { Base64 } from 'js-base64'
+// import usereditdialog from '@/components/editcomponent/usereditdialog'
+import { getSysDetail,userupdatePwd } from "@/configue/api";
 
 export default {
-  components: {usereditdialog},
-  data () {
-    return {
-      isShowEdit:false,
-      ran:'',
-      userId:'',
-      userInfo:{}
+  // components: {usereditdialog},
+  data() {
+    // 这里存放数据
+    const validatePass2 = (rule, value, callback) => {
+      if (value !== this.form.newPassword) {
+        callback(new Error('两次输入密码不一致!'))
+      } else {
+        callback()
+      }
     }
+        return {
+      isShow: false,
+      cut: false,
+      // 用户的退出,修改密码的显示和隐藏
+      isShowEdit: false,
+      ran: "",
+      userId: "",
+      userInfo: {},
+      // 修改密码
+      form: {
+        oldPassword: '',
+        newPassword: '',
+        checkPass: ''
+      },
+      rules: {
+        checkPass: [{ validator: validatePass2, trigger: 'blur' }],
+        oldPassword: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        newPassword: [
+          { required: true, message: '不能为空', trigger: 'blur' },
+          { max: 15, message: '不能超过15个字', trigger: 'blur' }
+        ]
+      },
+    };
   },
   watch: {
-    isShowEdit(){
-      this.getDetail()
-    }
+    isShowEdit() {
+      this.getDetail();
+    },
   },
   methods: {
-    handleAvatar(){
+    // 修改密码点击取消
+    btnX () {
+      this.$refs.ruleForm.resetFields()
+      this.cut = false
+      this.isShow = false
+      this.form = {
+        oldPassword: '',
+        newPassword: '',
+        checkPass: ''
+      }
+    },
+    // 修改密码点击确定
+    async btnOk () {
+      await this.$refs.ruleForm.validate()
+      try {
+        const data = {
+          oldPassword: encodeStr(Base64.encode(this.form.oldPassword)),
+          newPassword: encodeStr(Base64.encode(this.form.newPassword))
+        }
+        await userupdatePwd(data)
+        this.$message.success('修改成功')
+        localStorage.clear('token')
+        this.$router.push('/login')
+      } catch (error) {
+        this.$message.error('旧密码错误')
+      }
+    },
+        handleAvatar() {
+      let role = window.localStorage.getItem("role");
 
-      let role =  window.localStorage.getItem("role")
-    
       console.log(this.juese[role]);
-      
 
       if (!this.juese[role]) {
-        return
+        return;
       }
-      this.isShowEdit=true
-      this.ran=Math.random()
+      this.isShowEdit = true;
+      this.ran = Math.random();
     },
-    logoutcomfirm(){
-      this.confirm('确定退出登录?',()=>{
-        this.logout()
-      })
+    logoutcomfirm() {
+      this.confirm("确定退出登录?", () => {
+        this.logout();
+      });
     },
-    getDetail(){
-      getSysDetail('user',{id:this.userId},res=>{
-          this.userInfo = {...res.data}
-      })
+    getDetail() {
+      getSysDetail("user", { id: this.userId }, (res) => {
+        this.userInfo = { ...res.data };
+      });
     },
-    logout (type=null) {
+    logout(type = null) {
       this.$http({
-        method: 'get',
-        url: 'admin/logout'
-      }).then(res => {
+        method: "get",
+        url: "admin/logout",
+      }).then((res) => {
         if (res.code === 0) {
-          window.localStorage.setItem('token', '')
-          window.localStorage.setItem('role', '')
-          this.$alert(type?'修改成功,请重新登录':'退出成功', '提示', {
-            confirmButtonText: '确定',
+          window.localStorage.setItem("token", "");
+          window.localStorage.setItem("role", "");
+          this.$alert(type ? "修改成功,请重新登录" : "退出成功", "提示", {
+            confirmButtonText: "确定",
             callback: () => {
-              window.localStorage.setItem('userInfo', '')
-              this.$router.push('/login')
-            }
-          })
+              window.localStorage.setItem("userInfo", "");
+              this.$router.push("/login");
+            },
+          });
         }
-      })
-    }
+      });
+    },
   },
-  created () {
-
+  created() {},
+  mounted() {
+    this.userId = window.localStorage.getItem("userId") || "";
+    this.getDetail();
   },
-  mounted () {
-    this.userId = window.localStorage.getItem('userId')|| ''
-    this.getDetail()
-  }
-}
+};
 </script>
 
-<style scoped>
+<style scoped lang='less'>
 .header {
   height: 4.25rem;
   width: 100%;
@@ -100,7 +187,7 @@ export default {
   line-height: 4.25rem;
   padding: 0 1.875rem;
   box-sizing: border-box;
-  background-color: #B63C25!important;
+  background-color: #b63c25 !important;
 }
 
 .header-title {
@@ -109,12 +196,12 @@ export default {
   text-align: center;
   vertical-align: middle;
 }
-.header-title img{
+.header-title img {
   vertical-align: middle;
   max-width: 56px;
   margin-right: 4px;
 }
-.header-title span{
+.header-title span {
   vertical-align: middle;
   display: inline-block;
   font-size: 24px;
@@ -122,9 +209,29 @@ export default {
   font-weight: bold;
 }
 .header-user {
+  position: relative;
   display: flex;
   align-items: center;
   cursor: pointer;
+  .user_handle {
+    width: 150px;
+    z-index: 999;
+    position: absolute;
+    right: -30px;
+    top: 58px;
+    background-color: #b63c25;
+    li {
+      text-align: center;
+      height: 40px;
+      line-height: 40px;
+      color: #fff;
+      cursor: pointer;
+      margin: 10px 0;
+    }
+    li:hover {
+      color: orange;
+    }
+  }
 }
 
 .header-user .logout img {
@@ -140,7 +247,7 @@ export default {
   color: #fff;
 }
 
-.header-user .avatars{
+.header-user .avatars {
   display: flex;
   align-items: center;
   cursor: pointer;
@@ -149,13 +256,13 @@ export default {
   color: #fff;
 }
 
-.header-user .avatars span{
+.header-user .avatars span {
   margin-left: 10px;
 }
 
-.header-user .avatars img{
-  width:3rem;
-  height:3rem;
-  border-radius:50%;
+.header-user .avatars img {
+  width: 3rem;
+  height: 3rem;
+  border-radius: 50%;
 }
 </style>

+ 106 - 0
new_backstage/src/pages/layout/pass.js

@@ -0,0 +1,106 @@
+/* eslint-disable */
+function NoToChinese (num) {
+  num = String(num)
+  var chnNumChar = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
+  if (num == 0) {
+    return chnNumChar[0]
+  }
+  let tmp = ''
+  for (let i = 0; i < num.length; i++) {
+    const ele = num.charAt(i)
+    tmp += chnNumChar[ele]
+  }
+
+  return tmp
+}
+
+function randomWord (randomFlag, min, max) {
+  let str = ''
+  let range = min
+  const arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
+  // 随机产生
+  if (randomFlag) {
+    range = Math.round(Math.random() * (max - min)) + min
+  }
+  for (var i = 0; i < range; i++) {
+    const pos = Math.round(Math.random() * (arr.length - 1))
+    str += arr[pos]
+  }
+  return str
+}
+
+module.exports = {
+  formatDate: function (time) {
+    var weekArr = ['日', '一', '二', '三', '四', '五', '六']
+    var date = new Date(time)
+    var year = date.getFullYear()
+    var month = date.getMonth() + 1
+    var day = date.getDate()
+    var week = '星期' + weekArr[date.getDay()]
+    if (window.innerWidth < 1700) {
+      return (
+        year +
+        '年' +
+        (String(month).length > 1 ? month : '0' + month) +
+        '月' +
+        (String(day).length > 1 ? day : '0' + day) +
+        '日' +
+        '<br/>' +
+        week
+      )
+    }
+    return (
+      year +
+      '年' +
+      (String(month).length > 1 ? month : '0' + month) +
+      '月' +
+      (String(day).length > 1 ? day : '0' + day) +
+      '日' +
+      ' ' +
+      week
+    )
+  },
+  smoothscrollpos: function (domName) {
+    if (domName == '/') {
+      return window.scrollTo(0, 0)
+    }
+    const smoothscroll = () => {
+      const dom = document.getElementById(domName)
+      // window.scrollTo({
+      //   top:dom.offsetTop - 100,
+      //   left:0,
+      //   behavior: "smooth"
+      // })
+      dom && window.scrollTo(0, dom.offsetTop - 120)
+    }
+    smoothscroll()
+  },
+
+  formatTime: function (time, fan = false) {
+    let t1 = time.split(' ')[0].split('-')
+    if (fan) {
+      t1 = t1.map((item) => {
+        const t = NoToChinese(item)
+        return t
+      })
+    }
+    return t1
+  },
+  encodeStr: function (str, strv = '') {
+    const NUM = 2
+    const front = randomWord(false, 8)
+    const middle = randomWord(false, 8)
+    const end = randomWord(false, 8)
+
+    const str1 = str.substring(0, NUM)
+    const str2 = str.substring(NUM)
+
+    if (strv) {
+      const strv1 = strv.substring(0, NUM)
+      const strv2 = strv.substring(NUM)
+      return [front + str2 + middle + str1 + end, front + strv2 + middle + strv1 + end]
+    }
+
+    return front + str2 + middle + str1 + end
+  }
+}

+ 0 - 0
web/src/assets/theme/theme.css


+ 1 - 1
web/src/assets/theme/theme.less

@@ -531,7 +531,7 @@
   }
 
   .lightborderThemeStyle {
-    border: 1px solid @color;
+    border: 1px solid @color !important;
     cursor: pointer;
 
   }

+ 6 - 4
web/src/components/Danmaku.vue

@@ -9,15 +9,15 @@
       <transition-group  appear tag="ul" class="danmaku-list" name="dm">
         <li
           class="danmaku-list-item"
-          v-for="(item) in showDanmakuData"
-          :key="item"
+          v-for="(item,index) in showDanmakuData"
+          :key="index"
         >
           <span v-html="item"></span>
         </li>
       </transition-group>
     </div>
     <div class="input-container" v-if="!isMobile">
-        <input @click.stop="toggleSelectMenu" v-model="danmu" type="text" placeholder="请选择弹幕发送吧~" class="send-choices">
+        <input @click.stop="toggleSelectMenu" v-model="danmu" type="text" placeholder="请选择弹幕发送吧~" class="send-choices">
       <div class="send-btn-container">
         <img
           @click="hideList"
@@ -45,7 +45,7 @@
       </ul>
     </div>
     <div class="input-mobile" v-else>
-      <span class="send-choices" @click.stop="toggleSelectMenu">请选择弹幕发送吧~</span>
+      <span class="send-choices" @click.stop="toggleSelectMenu">请选择弹幕发送吧~</span>
       <div class="send-btn-container">
         <img
           @click="hideList"
@@ -168,6 +168,7 @@ export default {
           this.sendDanmakuSelf(tmp)
         }
       })
+
     },
     autoPopAnimation() {
       if (!this.isNotInputAction) {
@@ -186,6 +187,7 @@ export default {
   },
   mounted() {
     this.autoPopAnimation();
+    console.log(111,this.quotes);
   },
 };
 </script>

+ 10 - 0
web/src/config/api.js

@@ -330,4 +330,14 @@ export const goodsVoteDelApi = (goodsId) => {
     method: 'get',
     url: `cms/web/manage/goods/vote/del/${goodsId}`,
   })
+}
+
+
+
+// 检查留言---------
+export const webMesCheck = () => {
+  return axios({
+    method: 'get',
+    url: '/cms/web/manage/check/message',
+  })
 }

+ 2 - 2
web/src/config/http.js

@@ -2,9 +2,9 @@ import axios from 'axios'
 
 var isProduction = process.env.NODE_ENV === 'production'
 // 线上打包
-const serverName = isProduction ? '/' : 'http://192.168.0.245:8003/'
+// const serverName = isProduction ? '/' : 'http://192.168.0.245:8003/'
 // 线下调试
-// const serverName = isProduction ? "/" : "http://192.168.0.135:8003/"
+const serverName = isProduction ? "/" : "http://192.168.0.135:8003/"
 
 const orginLink = window.location.origin
 

+ 1 - 1
web/src/views/collection/index.vue

@@ -197,7 +197,7 @@ export default {
           display: inline-block;
           position: relative;
           color: #999;
-          font-size: 20px;
+          font-size: 18px;
           &::before {
             position: absolute;
             top: 50%;

+ 215 - 158
web/src/views/message/Message.vue

@@ -1,150 +1,207 @@
 <template>
   <div class="message-body">
     <div class="message">
-        <div class="con borderIrr">
-          <i class="bottoml"></i>
-          <i class="bottomr"></i>
-          <ul class="form">
-            <li>
-              <span>留言人:</span>
-              <div class="name">
-                <sradio @click.native="select = 'nickName'" :checked="select == 'nickName'" class="radio" :name="'使用昵称'"/>
-                <sradio @click.native="select = 'realName'" :checked="select == 'realName'" class="radio" :name="'使用真实姓名'"/>
-              </div>
-            </li>
-            <li>
-              <span>留言内容:</span>
-              <div class="input">
-                <textarea placeholder="请留下你的留言" maxlength='250' v-model="msg" rows="4" cols="80">
-                </textarea>
-                <span>{{msg.length}}/250</span>
-                <span class="loginwarn" v-if="!token" @click.stop="tologin"><img :src="require('@/assets/images/warn.png')" alt="">
-                请先登录后,再进行留言</span>
-              </div>
-            </li>
-          </ul>
-          <div>
-            <div class="button primarybtn" @click="leaveMsg('','')">
-              提交
+      <div class="con borderIrr">
+        <i class="bottoml"></i>
+        <i class="bottomr"></i>
+        <ul class="form">
+          <li>
+            <span>留言人:</span>
+            <div class="name">
+              <sradio
+                @click.native="select = 'nickName'"
+                :checked="select == 'nickName'"
+                class="radio"
+                :name="'使用昵称'"
+              />
+              <sradio
+                @click.native="select = 'realName'"
+                :checked="select == 'realName'"
+                class="radio"
+                :name="'使用真实姓名'"
+              />
+            </div>
+          </li>
+          <li>
+            <span>留言内容:</span>
+            <div class="input">
+              <textarea
+                :placeholder="mesTrue?'请输入您的留言,您的留言将直接显示':'请输入您的留言'"
+                maxlength="250"
+                v-model="msg"
+                rows="4"
+                cols="80"
+              >
+              </textarea>
+              <span>{{ msg.length }}/250</span>
+              <span class="loginwarn" v-if="!token" @click.stop="tologin"
+                ><img :src="require('@/assets/images/warn.png')" alt="" />
+                请先登录后,再进行留言</span
+              >
             </div>
-            <div class="button" @click="msg=''">重置</div>
-          </div>
+          </li>
+        </ul>
+        <div>
+          <div class="button primarybtn" @click="leaveMsg('', '')">提交</div>
+          <div class="button" @click="msg = ''">重置</div>
         </div>
-        <div class="leaving">
-          <div class="title primaryColor">
-            <span>全部留言
-              <i class="btmLine"></i>
-            </span>
-          </div>
-          <ul class="content">
-            <li v-for="(item,i) in message" :key="i">
-              <div class="info">
-                <span class="primaryColor">{{(item.isRealName?item.realName:item.nickName)||'匿名用户'}}</span>
-                <span>{{item.createTime}}</span>
+      </div>
+      <div class="leaving">
+        <div class="title primaryColor">
+          <span
+            >全部留言
+            <i class="btmLine"></i>
+          </span>
+        </div>
+        <ul class="content">
+          <li v-for="(item, i) in message" :key="i">
+            <div class="info">
+              <span class="primaryColor">{{
+                (item.isRealName ? item.realName : item.nickName) || "匿名用户"
+              }}</span>
+              <span>{{ item.createTime }}</span>
+            </div>
+            <div class="body">
+              <span>{{ item.content }}</span>
+              <div class="txtSameHover" @click="showComment(item, i)">
+                <img
+                  class="xhidden"
+                  :src="require(`@/assets/images/xinjiang/content.png`)"
+                  alt=""
+                />
+                <img
+                  class="xshow"
+                  :src="
+                    require(`@/assets/images/xinjiang/content_${theme}.png`)
+                  "
+                  alt=""
+                />
+                <span>评论</span>
               </div>
-              <div class="body">
-                <span>{{item.content}}</span>
-                <div class="txtSameHover" @click="showComment(item,i)">
-                  <img  class="xhidden" :src="require(`@/assets/images/xinjiang/content.png`)" alt="">
-                  <img class="xshow" :src="require(`@/assets/images/xinjiang/content_${theme}.png`)" alt="">
-                  <span>评论</span>
+            </div>
+            <ul class="response-text" v-if="item.children">
+              <li v-for="(sub, idx) in item.children" :key="idx">
+                <div>{{ sub.content }}</div>
+                <div>
+                  来自:{{
+                    sub.isRealName ? sub.realName : sub.nickName
+                  }}
+                  的评论 {{ sub.createTime }}
                 </div>
+              </li>
+            </ul>
+            <template v-if="item.showComment">
+              <div class="response input">
+                <textarea
+                  v-model="item.comment"
+                  rows="3"
+                  maxlength="250"
+                  cols="80"
+                  placeholder="请写下您的评论"
+                ></textarea>
+                <span>{{ item.comment.length }}/250</span>
               </div>
-              <ul class="response-text" v-if="item.children">
-                <li v-for="(sub,idx) in item.children" :key="idx">
-                  <div>{{sub.content}}</div>
-                  <div>来自:{{sub.isRealName?sub.realName:sub.nickName}} 的评论 {{sub.createTime}}</div>
-                </li>
-              </ul>
-              <template v-if="item.showComment">
-                <div class="response input" >
-                  <textarea v-model="item.comment" rows="3" maxlength='250' cols="80" placeholder="请写下您的评论"></textarea>
-                  <span>{{item.comment.length}}/250</span>
-                </div>
-                <div class="subbutton button primarybtn" @click="leaveMsg(item,i)">提交</div>
-              </template>
-            </li>
-          </ul>
-        </div>
-        <div v-if="!loadAll" class="loadmore" @click="loadmore"><span class="borderThemeStyle primaryColor">加载更多</span></div>
+              <div
+                class="subbutton button primarybtn"
+                @click="leaveMsg(item, i)"
+              >
+                提交
+              </div>
+            </template>
+          </li>
+        </ul>
+      </div>
+      <div v-if="!loadAll" class="loadmore" @click="loadmore">
+        <span class="borderThemeStyle primaryColor">加载更多</span>
       </div>
+    </div>
   </div>
 </template>
 
 <script>
-import { getMsg,saveMsg } from "@/config/api";
+import { getMsg, saveMsg, webMesCheck } from "@/config/api";
 
 export default {
   data() {
     return {
-      msg:'',
-      message:[],
+      mesTrue:false,
+      msg: "",
+      message: [],
       select: "nickName",
       mtotal: 0,
       mpageSize: 6,
       mcurrentPage: 1,
-      loadAll:false
+      loadAll: false,
     };
   },
-  watch:{
-    mpageSize(){
-      this.getMessage()
-    }
+  watch: {
+    mpageSize() {
+      this.getMessage();
+    },
   },
-  mounted(){
-    this.getMessage()
+  async mounted() {
+    // 每次进页面判断有没有直接显示的权限
+    let res = await webMesCheck();
+    this.mesTrue=res.data
+
+    this.getMessage();
   },
-  methods:{
-    tologin(){
-      window.scrollTo(0,0)
-      this.$bus.$emit('showLogin',true)
+  methods: {
+    tologin() {
+      window.scrollTo(0, 0);
+      this.$bus.$emit("showLogin", true);
     },
-    loadmore(){
-      this.mpageSize += this.mpageSize
+    loadmore() {
+      this.mpageSize += this.mpageSize;
     },
-    async leaveMsg(item='',i=''){
-      let tmp = (item ? item.comment : this.msg).trim()
+    async leaveMsg(item = "", i = "") {
+      let tmp = (item ? item.comment : this.msg).trim();
       if (!tmp) {
-        return alert('留言不能为空')
+        return alert("留言不能为空");
       }
-      saveMsg('comment',{
-        content: tmp,
-        parentId: item.id||'',
-        isRealName: Number(this.select == 'realName')
-      },res=>{
-        if (res.code==0) {
-          this.msg = ''
-          alert('留言成功')
-          item && this.showComment(item,i)
-          this.getMessage()
+      saveMsg(
+        "comment",
+        {
+          content: tmp,
+          parentId: item.id || "",
+          isRealName: Number(this.select == "realName"),
+        },
+        (res) => {
+          if (res.code == 0) {
+            this.msg = "";
+            alert("留言成功");
+            item && this.showComment(item, i);
+            this.getMessage();
+          }
         }
-      })
-     
+      );
     },
-    showComment(item,i){
-      item.showComment = !item.showComment
-      item.comment = ''
-      this.$set(this.message,i,item)
+    showComment(item, i) {
+      item.showComment = !item.showComment;
+      item.comment = "";
+      this.$set(this.message, i, item);
     },
-    async getMessage(){
-      if (this.loadAll) return
-      getMsg({
-        pageNum: this.mcurrentPage,
-        pageSize: this.mpageSize,
-      },result=>{
-        result.data.list.forEach(item=>{
-          item.showComment = false
-          item.comment = ''
-        })
-        if (result.data.list.length==this.message.length) {
-          this.loadAll = true
+    async getMessage() {
+      if (this.loadAll) return;
+      getMsg(
+        {
+          pageNum: this.mcurrentPage,
+          pageSize: this.mpageSize,
+        },
+        (result) => {
+          result.data.list.forEach((item) => {
+            item.showComment = false;
+            item.comment = "";
+          });
+          if (result.data.list.length == this.message.length) {
+            this.loadAll = true;
+          }
+          this.message = result.data.list;
+          this.mtotal = result.data.total;
         }
-        this.message = result.data.list
-        this.mtotal= result.data.total
-      })
-      
-    }
-  }
+      );
+    },
+  },
 };
 </script>
 
@@ -154,19 +211,19 @@ export default {
   margin: 0 auto;
   position: relative;
   z-index: 99;
-  .message{
-    .con{
+  .message {
+    .con {
       width: 100%;
       padding: 30px 100px;
-      .form{
+      .form {
         text-align: left;
         width: 100%;
-        >li{
+        > li {
           margin-bottom: 30px;
           display: flex;
           width: 100%;
           align-items: flex-start;
-          > span{
+          > span {
             display: inline-block;
             width: 100px;
             flex-shrink: 0;
@@ -174,27 +231,27 @@ export default {
             margin-right: 10px;
             text-align: right;
           }
-          .name{
-            .radio{
-               &::before{
+          .name {
+            .radio {
+              &::before {
                 border: 1px solid #707070;
-                content: '';
+                content: "";
               }
               margin-right: 50px;
             }
           }
-          .input{
+          .input {
             flex: auto;
             width: 100%;
             position: relative;
             font-size: 0;
-            >textarea{
+            > textarea {
               width: 100%;
               line-height: 2;
               color: #2d2d2d;
               font-size: 16px;
             }
-            >span{
+            > span {
               display: inline-block;
               color: rgba(153, 153, 153, 1);
               position: absolute;
@@ -202,7 +259,7 @@ export default {
               bottom: 5px;
               right: 14px;
             }
-            .loginwarn{
+            .loginwarn {
               left: 50%;
               right: auto;
               transform: translateX(-50%);
@@ -213,7 +270,7 @@ export default {
               bottom: 10px;
               padding: 4px;
               border-radius: 2px;
-              >img{
+              > img {
                 width: 20px;
                 margin-right: 4px;
               }
@@ -221,18 +278,18 @@ export default {
           }
         }
       }
-      >div{
+      > div {
         display: flex;
         justify-content: center;
         align-items: center;
-        
-        .button{
+
+        .button {
           position: relative;
           width: 150px;
-          &:first-of-type{
+          &:first-of-type {
             margin-right: 50px;
           }
-          >span{
+          > span {
             position: absolute;
             left: -220px;
             top: 50%;
@@ -240,7 +297,7 @@ export default {
             color: rgba(153, 153, 153, 1);
             display: flex;
             align-items: center;
-            >img{
+            > img {
               width: 24px;
               height: 24px;
               margin-right: 8px;
@@ -249,53 +306,53 @@ export default {
         }
       }
     }
-    .leaving{
+    .leaving {
       margin-top: 40px;
-      .title{
+      .title {
         text-align: left;
         font-size: 30px;
         border-bottom: 1px solid rgba(153, 153, 153, 1);
         padding-bottom: 10px;
         position: relative;
         margin-bottom: 20px;
-        span{
+        span {
           display: inline-block;
           min-width: 118px;
           font-size: 30px;
           position: relative;
-          .btmLine{
+          .btmLine {
             bottom: -13px;
           }
         }
       }
-      .content{
+      .content {
         text-align: left;
-        >li{
+        > li {
           margin-bottom: 10px;
-          .info{
-            >span{
+          .info {
+            > span {
               display: inline-block;
               font-size: 20px;
               margin-right: 10px;
-              &:not(:first-of-type){
+              &:not(:first-of-type) {
                 color: rgba(153, 153, 153, 1);
                 font-size: 14px;
               }
             }
           }
-          .body{
+          .body {
             margin: 10px 0;
             display: flex;
             justify-content: space-between;
-            >span{
+            > span {
               width: 90%;
               word-break: break-all;
               display: inline-block;
               color: rgba(112, 112, 112, 1);
             }
-            .txtSameHover{
+            .txtSameHover {
               color: rgba(153, 153, 153, 1);
-              img{
+              img {
                 margin-right: 10px;
                 width: 16px;
                 position: relative;
@@ -303,16 +360,16 @@ export default {
               }
             }
           }
-          .response{
+          .response {
             margin-top: 10px;
             border: 1px rgba(153, 153, 153, 1) solid;
             width: 100%;
             position: relative;
             font-size: 0;
-            >textarea{
+            > textarea {
               line-height: 2;
             }
-            >span{
+            > span {
               display: inline-block;
               color: #909399;
               position: absolute;
@@ -321,14 +378,14 @@ export default {
               right: 14px;
             }
           }
-          .response-text{
+          .response-text {
             border: 1px rgba(153, 153, 153, 1) solid;
-            background-color: #F3F3F3;
+            background-color: #f3f3f3;
             padding: 10px 13px;
             color: rgba(153, 153, 153, 1);
-            >li{
-              >div{
-                &:last-of-type{
+            > li {
+              > div {
+                &:last-of-type {
                   font-size: 14px;
                   text-align: right;
                   margin-top: 20px;
@@ -336,7 +393,7 @@ export default {
               }
             }
           }
-          .subbutton{
+          .subbutton {
             display: inline-block;
             text-align: center;
             margin-top: 20px;
@@ -344,9 +401,9 @@ export default {
         }
       }
     }
-    .loadmore{
+    .loadmore {
       margin-top: 40px;
-      .borderThemeStyle{
+      .borderThemeStyle {
         display: inline-block;
         padding: 10px 50px;
       }

+ 10 - 5
web/src/views/scene/components/comment/Message.vue

@@ -13,7 +13,7 @@
             <li>
               <span>留言内容:</span>
               <div class="input">
-                <textarea placeholder="请留下你的留言" maxlength='250' v-model="msg" rows="3" cols="80">
+                <textarea :placeholder="mesTrue?'请输入您的留言,您的留言将直接显示':'请输入您的留言'" maxlength='250' v-model="msg" rows="3" cols="80">
                 </textarea>
                 <span>{{msg.length}}/250</span>
                 <span class="loginwarn" v-if="!token" @click.stop="tologin"><img :src="require('@/assets/images/warn.png')" alt="">
@@ -56,7 +56,7 @@
                   <textarea v-model="item.comment" rows="3" maxlength='250' cols="80" placeholder="请写下您的评论"></textarea>
                   <span>{{item.comment.length}}/250</span>
                 </div>
-                <div class="subbutton button primarybtn" @click="leaveMsg(item,i)">提交</div>
+                <div class="subbutton button primarybtn lightborderThemeStyle" @click="leaveMsg(item,i)">提交</div>
               </template>
             </li>
           </ul>
@@ -67,11 +67,12 @@
 </template>
 
 <script>
-import { getMsg,saveMsg } from "@/config/api";
+import { getMsg,saveMsg,webMesCheck } from "@/config/api";
 
 export default {
   data() {
     return {
+      mesTrue:'',
       msg:'',
       message:[],
       select: "nickName",
@@ -86,7 +87,12 @@ export default {
       this.getMessage()
     }
   },
-  mounted(){
+ async mounted(){
+    // 每次进页面判断有没有直接显示的权限
+    let res = await webMesCheck();
+    this.mesTrue=res.data
+
+
     this.getMessage()
   },
   methods:{
@@ -114,7 +120,6 @@ export default {
           this.getMessage()
         }
       })
-     
     },
     showComment(item,i){
       item.showComment = !item.showComment