Browse Source

系统规则修改

sunlupeng 5 days ago
parent
commit
5d519970fc
3 changed files with 82 additions and 19 deletions
  1. 18 17
      src/permission.js
  2. 1 1
      src/utils/request.js
  3. 63 1
      src/views/HomeView.vue

+ 18 - 17
src/permission.js

@@ -4,7 +4,7 @@ import { getToken, setToken } from '@/utils/auth' // getToken from cookie
 import { lockStatus,unlock } from "@/api/allApi";
 //路由跳转之前
 router.beforeEach((to, _from, next) => {
-  // setToken('da0e2b8177b5b2448cc0ab9557a9eb7a');
+  setToken('26d6869a02d7d2e5c593226ca14d6601');
   const path = to.path;
   const Authorization = to.query.Authorization
   if (path.indexOf('auth') != -1 && Authorization) { 
@@ -14,22 +14,23 @@ router.beforeEach((to, _from, next) => {
   }else{
     const token = getToken();
     if( token && token != 'undefined' ){
-      lockStatus().then(response=>{
-        let lockStatus = response.data.data;
-          if(lockStatus==0){
-            MessageBox.alert('欢迎来到DGT誉商城系统,已为您发放工龄年限积分,请前往个人中心查看。', '积分发放通知', {
-              confirmButtonText: '确定',
-              showClose:false,
-              callback: action => {
-                unlock().then(response=>{
-                  next();
-              })
-              }
-            });
-          }else{
-            next();
-          }
-      })
+      next();
+      // lockStatus().then(response=>{
+      //   let lockStatus = response.data.data;
+      //     if(lockStatus==0){
+      //       MessageBox.alert('欢迎来到DGT誉商城系统,已为您发放工龄年限积分,请前往个人中心查看。', '积分发放通知', {
+      //         confirmButtonText: '确定',
+      //         showClose:false,
+      //         callback: action => {
+      //           unlock().then(response=>{
+      //             next();
+      //         })
+      //         }
+      //       });
+      //     }else{
+      //       next();
+      //     }
+      // })
       
     }else{
       

+ 1 - 1
src/utils/request.js

@@ -6,7 +6,7 @@ let prodBaseURL = 'https://xiaoyou.dgtis.com/admin';//正式地址
 
 // let prodBaseURL = 'https://malltest.dgtis.com/admin';//阿里云地址
 
-let devBaseURL = 'https://xiaoyou.dgtis.com/admin';//测试地址
+let devBaseURL = 'https://malltest.dgtis.com/admin';//测试地址
 
 // create an axios instance
 const service = axios.create({

+ 63 - 1
src/views/HomeView.vue

@@ -2,16 +2,53 @@
   <div class="main-container">
     <AppSidebar></AppSidebar>
     <router-view />
+    <el-dialog
+      title="系统规则"
+      :visible.sync="dialogVisible"
+      width="50%"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false">
+      <div v-html="htmlData"></div>
+      <span slot="footer" class="dialog-footer" style="display: flex;justify-content: center">
+        <el-button style="width:50%;font-size: 24px;" type="danger" @click="getUnlock">确认激活</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import AppSidebar from '@/components/AppSidebar.vue'
-
+import { lockStatus,unlock } from "@/api/allApi";
 export default {
   name: 'HomeView',
   components: {
     AppSidebar
+  },
+  data() {
+    return {
+      htmlData:'',
+      dialogVisible: false,
+    };
+  },
+  created() {
+    this.getHtmldata();
+  },
+  methods:{
+    getHtmldata(){
+      lockStatus().then(response=>{
+        let lockStatus = response.data.data;
+        if(lockStatus==0){
+          this.htmlData = response.data.errmsg; 
+          this.dialogVisible = true;
+        }
+      })
+    },
+    getUnlock(){
+      unlock().then(response=>{
+        this.dialogVisible = false;
+      })
+    }
   }
 }
 </script>
@@ -50,3 +87,28 @@ export default {
 
     background-color: #1e80ff;
 }</style>
+
+<style scoped>
+::v-deep .el-dialog {
+  left: 50%;
+  top: 5%;
+  transform: translate(-50%, -5%);
+  margin: 0px !important;
+  border-radius: 8px;
+}
+::v-deep .el-dialog__title,::v-deep .el-dialog__headerbtn{
+  font-size: 24px;
+}
+::v-deep .el-dialog__header {
+    -webkit-box-shadow: 0 1px 4px 0 rgba(31, 45, 61, .12);
+    box-shadow: 0 1px 4px 0 rgba(31, 45, 61, .12);
+}
+::v-deep .el-dialog__body{
+    overflow: auto;
+    overflow-x: hidden;
+    max-height: 70vh!important;
+}
+::v-deep .el-dialog__footer {
+    border-top: 1px solid #d7d9dc;
+}
+</style>