Przeglądaj źródła

取消 跳转到登录界面

test
chenJinxu 10 miesięcy temu
rodzic
commit
a01dd34928
3 zmienionych plików z 9 dodań i 9 usunięć
  1. +2
    -2
      src/config/request.js
  2. +2
    -2
      src/config/request_java.js
  3. +5
    -5
      src/views/myself/news/news.vue

+ 2
- 2
src/config/request.js Wyświetl plik

@@ -7,7 +7,7 @@
* @FilePath: \ParentWeb\src\config\request.js * @FilePath: \ParentWeb\src\config\request.js
*/ */
import axios from 'axios'; import axios from 'axios';
import router from '@/router';
/* import router from '@/router'; */
import store from '@/store'; import store from '@/store';
import { baseApi } from '@/config'; import { baseApi } from '@/config';
import prefix from '@/store/prefix'; import prefix from '@/store/prefix';
@@ -77,7 +77,7 @@ service.interceptors.request.use(request => {
window.location.href.indexOf('verificationLogin') < 0 && window.location.href.indexOf('verificationLogin') < 0 &&
window.location.href.indexOf('changePassword') < 0 window.location.href.indexOf('changePassword') < 0
) { ) {
router.push({ name: 'login' });
/* router.push({ name: 'login' }); */
return request; return request;
} }
// 全局请求统一增加一个 sourcetype: 1的参数跟区分新旧接口 // 全局请求统一增加一个 sourcetype: 1的参数跟区分新旧接口


+ 2
- 2
src/config/request_java.js Wyświetl plik

@@ -7,7 +7,7 @@
* @FilePath: \ParentWeb\src\config\request.js * @FilePath: \ParentWeb\src\config\request.js
*/ */
import axios from 'axios'; import axios from 'axios';
import router from '@/router';
/* import router from '@/router'; */
import { javaAPI } from '@/config'; import { javaAPI } from '@/config';
import prefix from '@/store/prefix'; import prefix from '@/store/prefix';
const httpProxyPrefix = javaAPI; const httpProxyPrefix = javaAPI;
@@ -76,7 +76,7 @@ service.interceptors.request.use(request => {
window.location.href.indexOf('verificationLogin') < 0 && window.location.href.indexOf('verificationLogin') < 0 &&
window.location.href.indexOf('changePassword') < 0 window.location.href.indexOf('changePassword') < 0
) { ) {
router.push({ name: 'login' });
/* router.push({ name: 'login' }); */
return request; return request;
} }
// 全局请求统一增加一个 sourcetype: 1的参数跟区分新旧接口 // 全局请求统一增加一个 sourcetype: 1的参数跟区分新旧接口


+ 5
- 5
src/views/myself/news/news.vue Wyświetl plik

@@ -31,7 +31,7 @@
</template> </template>


<script> <script>
import DialogService from '@/services/dialog-service';
/* import DialogService from '@/services/dialog-service'; */
import ToastService from '@/services/toast-service'; import ToastService from '@/services/toast-service';
import APIUser from '@/api/user'; import APIUser from '@/api/user';
import NavBar from '@/components/NavBar'; import NavBar from '@/components/NavBar';
@@ -178,13 +178,13 @@ export default {
}, },
mounted() { mounted() {
this.getData(this.begNumber, this.pageNumber, true); this.getData(this.begNumber, this.pageNumber, true);
let url = window.location.search;
let id = url.split('user_id=')[1];
/* let url = window.location.search;
let id = url.split('user_id=')[1]; */
let alarmUrl = window.location.href.split('msgId=')[1]; let alarmUrl = window.location.href.split('msgId=')[1];
if (alarmUrl) { if (alarmUrl) {
this.$router.push({ name: 'alarmDetails', query: { msgId: alarmUrl } }); this.$router.push({ name: 'alarmDetails', query: { msgId: alarmUrl } });
} }
if (id) {
/* if (id) {
if (id != this.$store.getters.userId) { if (id != this.$store.getters.userId) {
DialogService.confirm({ DialogService.confirm({
title: '登录失效,请重新登录~' title: '登录失效,请重新登录~'
@@ -192,7 +192,7 @@ export default {
this.$router.push({ name: 'login' }); this.$router.push({ name: 'login' });
}); });
} }
}
} */
console.log(this.$store.getters.userId); console.log(this.$store.getters.userId);
} }
}; };


Ładowanie…
Anuluj
Zapisz