sunlupeng 1 tahun lalu
induk
melakukan
8d2f99c381
4 mengubah file dengan 45 tambahan dan 6 penghapusan
  1. 8 0
      src/api/allApi.js
  2. 7 1
      src/assets/css/global.css
  3. 19 3
      src/permission.js
  4. 11 2
      src/views/HomeView/Index.vue

+ 8 - 0
src/api/allApi.js

@@ -1,4 +1,12 @@
 import request from '@/utils/request'
+// 初始化积分领取
+export function unlock(query) {
+  return request({
+    url: '/mall-user/unlock',
+    method: 'post',
+    params:query
+  })
+}
 // 节日活动
 export function actList(data) {
   return request({

+ 7 - 1
src/assets/css/global.css

@@ -64,4 +64,10 @@ a {
 }
 .wrapper .link {
     color: #1e80ff;
-}
+}
+
+/* .el-message-box__wrapper {
+    top: 100px;
+    bottom: unset;
+   
+} */

+ 19 - 3
src/permission.js

@@ -1,7 +1,7 @@
 import router from './router'
-
+import { MessageBox } from 'element-ui';
 import { getToken, setToken } from '@/utils/auth' // getToken from cookie
-
+import { useInfo,unlock } from "@/api/allApi";
 //路由跳转之前
 router.beforeEach((to, _from, next) => {
   const path = to.path;
@@ -13,7 +13,23 @@ router.beforeEach((to, _from, next) => {
   }else{
     const token = getToken();
     if( token && token != 'undefined' ){
-      next();
+      useInfo().then(response=>{
+        let lockStatus = response.data.data.lockStatus;
+          if(lockStatus==0){
+            MessageBox.alert('欢迎来到DGT积分商城系统,以为您发放工龄年限积分,请前往个人中心查看。', '积分发放通知', {
+              confirmButtonText: '确定',
+              showClose:false,
+              callback: action => {
+                unlock().then(response=>{
+                  next();
+              })
+              }
+            });
+          }else{
+            next();
+          }
+      })
+      
     }else{
       
       const prodHref = 'http://dgtcloud.dgtis.com/oneportal/login';//发布地址

+ 11 - 2
src/views/HomeView/Index.vue

@@ -46,7 +46,7 @@
     </div>
 </template>
 <script scoped>
-import { msgList } from "@/api/allApi";
+import { msgList,useInfo } from "@/api/allApi";
 import SiderInfo from '@/components/SiderInfo.vue';
 import { debounce } from '@/utils/index';
 export default{
@@ -55,6 +55,7 @@ export default{
   },
   data() {
     return {
+        dataInfo:'',
         bannerList: [
             {
                 url: require('@/assets/image/banner.png')
@@ -68,8 +69,16 @@ export default{
         pages:1,
     };
   },
-  created(){
+ created(){
     this.getDataList();
+    // useInfo().then(response=>{
+    //     let lockStatus = response.data.data.lockStatus;
+    //     if(lockStatus==0){
+
+    //     }else{
+    //         this.getDataList();
+    //     }
+    // })
   },
   methods:{
     handleClickMag(id) {