mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-06 17:36:46 +08:00
--fix bug
This commit is contained in:
@@ -3,6 +3,7 @@ import {reactive, ref, toRefs, watch} from "vue";
|
||||
import axios from 'axios';
|
||||
import {getCookie} from "@/api/utils";
|
||||
import JSONBigInt from 'json-bigint';
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const JSONBigIntStr = JSONBigInt({storeAsString: true});
|
||||
|
||||
@@ -97,15 +98,13 @@ export async function request(_url, params) {
|
||||
...method !== 'get' ? {data: JSON.stringify(body)} : {}
|
||||
}).then(resp => resp.data).then(response => {
|
||||
if (response.code !== 200 && response.code !== 0) {
|
||||
if (response.code === 1000) {
|
||||
(import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL, '_top')
|
||||
}
|
||||
if (response.code === 2001) {
|
||||
router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}})
|
||||
}
|
||||
if (response.code === 2002) {
|
||||
router.push({path: '/FaceTeachNoCommon', query: {courseId: router.currentRoute.value.query.courseId,type:3}})
|
||||
}
|
||||
if (response.code === 1000) (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL, '_top')
|
||||
|
||||
else if (response.code === 2001) router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}})
|
||||
|
||||
else if (response.code === 2002) router.push({path: '/FaceTeachNoCommon', query: {courseId: router.currentRoute.value.query.courseId,type:3}})
|
||||
else if (response.code === 9000) ElMessage.warning("该数据已经被删除或停用,请联系管理员");
|
||||
|
||||
// if (import.meta.env.DEV && response.code === 1000) {
|
||||
// router.push({path: '/login'})
|
||||
// } else {
|
||||
|
||||
Reference in New Issue
Block a user