|
@@ -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';//发布地址
|