feat:修改编码

This commit is contained in:
lixg
2023-03-08 14:16:00 +08:00
parent d6112b0907
commit e864536e86
4 changed files with 7 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ import { GET_USER_INFO } from "@/api/ThirdApi";
import { getCookie } from "@/api/utils"; import { getCookie } from "@/api/utils";
import { USER_INFO } from "@/api/api"; import { USER_INFO } from "@/api/api";
console.log("版本2.1.5------------"); console.log("版本2.1.6------------");
const store = useStore(); const store = useStore();
const router = useRouter(); const router = useRouter();

View File

@@ -100,7 +100,7 @@ export async function request(_url, params) {
console.log('window.location.', window, router) console.log('window.location.', window, router)
if (response.code === 1000) { if (response.code === 1000) {
delCookie() delCookie()
(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 + encodeURI(window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + router.currentRoute.value.fullPath), '_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 + encodeURIComponent(window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + router.currentRoute.value.fullPath), '_top')
} }
if (response.code === 2001) { if (response.code === 2001) {
router.push({ path: '/FaceTeachSignUp', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } }) 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 * @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-02-08 09:50:10 * @Date: 2023-02-08 09:50:10
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-07 21:52:35 * @LastEditTime: 2023-03-08 13:40:18
* @FilePath: /stu_h5/src/router/index.js * @FilePath: /stu_h5/src/router/index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@@ -24,11 +24,13 @@ const router = createRouter({
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log('toooooooo', to) console.log('toooooooo', to)
console.log('encodeURI', encodeURI(to.fullPath),)
console.log('encodeURIComponent', encodeURIComponent(window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + to.fullPath))
if (!getCookie('token')) { if (!getCookie('token')) {
if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") { if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") {
to.path.includes('/login') ? next() : next({ path: '/login', query: { returnUrl: to.fullPath } }) to.path.includes('/login') ? next() : next({ path: '/login', query: { returnUrl: to.fullPath } })
} else { } else {
window.location.href = window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL + encodeURI(window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + to.fullPath) window.location.href = window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL + encodeURIComponent(window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + to.fullPath)
} }
} }
next() next()

View File

@@ -42,7 +42,7 @@
<div style="display: flex"> <div style="display: flex">
<botton <botton
class="titlebtn" class="titlebtn"
v-if="data?.hasTask || data.planDto?.applyFlag" v-if="data.planDto?.applyFlag"
@click="onLineSignUp" @click="onLineSignUp"
:style="{ :style="{
background: isAllowSign background: isAllowSign
@@ -51,7 +51,6 @@
: 'rgb(57, 146, 249)' : 'rgb(57, 146, 249)'
: '#999', : '#999',
}" }"
,
>{{ >{{
data.isRefused data.isRefused
? "审核拒绝" ? "审核拒绝"