feat:修改

This commit is contained in:
lixg
2023-03-07 15:53:44 +08:00
parent f1788b2fdf
commit 73528efff0
6 changed files with 13 additions and 7 deletions

4
.env
View File

@@ -29,4 +29,6 @@ VITE_FILE_PATH=/upload/
#h5的基本url
VITE_BOE_HOME=//u-pre.boe.com/mobile/pages/index/index
VITE_BOE_HOME=//u-pre.boe.com/mobile/pages/index/index
# 学习任务页
VITE_BOE_STUDY=https://u-pre.boe.com/mobile/pages/study/index

View File

@@ -18,4 +18,5 @@ VITE_BOE_BASE_URL=//u.boe.com
VITE_IMG=/manageApi
#h5的基本url
VITE_BOE_HOME=//u.boe.com/mobile/pages/index/index
VITE_BOE_HOME=//u.boe.com/mobile/pages/index/index
VITE_BOE_STUDY=https://u.boe.com/mobile/pages/study/index

View File

@@ -15,4 +15,5 @@ VITE_BOE_BASE_URL=//u.boe.com
VITE_IMG=/manageApi-release
#h5的基本url
VITE_BOE_HOME=//u.boe.com/mobile-release/pages/index/index
VITE_BOE_HOME=//u.boe.com/mobile-release/pages/index/index
VITE_BOE_STUDY=https://u.boe.com/mobile-release/pages/study/index

View File

@@ -97,8 +97,9 @@ 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) {
console.log('window.location.', window, router)
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')
(import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({ path: '/login', query: { returnUrl: router.currentRoute.value.fullPath } }) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL + window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + router.currentRoute.value.fullPath, '_top')
}
if (response.code === 2001) {
router.push({ path: '/FaceTeachSignUp', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } })

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-16 17:26:39
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-22 19:32:18
* @LastEditTime: 2023-03-07 15:17:43
* @FilePath: /stu_h5/src/components/ReturnHead.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -89,6 +89,7 @@ export default {
const router = useRouter();
const returnclick = () => {
router.back();
// VITE_BOE_STUDY
};
const publishClick = () => {
if (props.postAdd) {

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-02-08 09:50:10
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-07 12:53:34
* @LastEditTime: 2023-03-07 15:48:30
* @FilePath: /stu_h5/src/router/index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -26,7 +26,7 @@ router.beforeEach((to, from, next) => {
console.log('toooooooo', to)
if (!getCookie('token')) {
if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") {
to.path.includes('/login') ? next() : next({ path: '/login', query: { returnUrl: import.meta.env.VITE_BASE + to.fullPath } })
to.path.includes('/login') ? next() : next({ path: '/login', query: { returnUrl: to.fullPath } })
} else {
window.location.href = window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL + window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + to.fullPath
}