diff --git a/.env b/.env index 846233c6..b8afca1f 100644 --- a/.env +++ b/.env @@ -2,8 +2,10 @@ VUE_APP_BASE=/manage # api项目基础url VUE_APP_BASE_API=/manageApi -# 导出url -VUE_APP_PROXY_URL=http://111.231.196.214:30001/ +#文件路径 +VUE_APP_FILE_PATH=/file/ +# 代理url 本地调试,不可以用在其他地方 +VUE_APP_PROXY_URL=http://111.231.196.214/manageApi # 登录url VUE_APP_LOGIN_URL=https://u-pre.boe.com/web # boe域名 @@ -18,5 +20,6 @@ VUE_APP_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc/loading # 课程二维码 VUE_APP_COURSE_STUDY=https://u-pre.boe.com/pc/course/studyindex?id= -# 导入学员模板 -VUE_APP_TEMPLATE=https://u-pre.boe.com/upload/ +# 导入学员模板 +VUE_APP_UP_LOAD_HOMEWORK_TEMPLATE=导入作业成绩 模板-1673450632417.xlsx +VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673452888323.xlsx diff --git a/.env.alpine b/.env.alpine new file mode 100644 index 00000000..07a433c1 --- /dev/null +++ b/.env.alpine @@ -0,0 +1,2 @@ +NODE_ENV=alpine +VUE_APP_OUTPUT_DIR=./docker/dist diff --git a/.env.test b/.env.test index 9df71ee6..310c858d 100644 --- a/.env.test +++ b/.env.test @@ -1,6 +1,2 @@ NODE_ENV=test -VUE_APP_BASE=/manage -VUE_APP_BASE_API=/manageApi -VUE_APP_OUTPUT_DIR=./docker/dist - VUE_APP_BOE_API_URL=https://u-pre.boe.com \ No newline at end of file diff --git a/package.json b/package.json index 91c565dd..50050c3a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build:boe": "vue-cli-service build --mode boe", "build:release": "vue-cli-service build --mode release", "build:prod": "vue-cli-service build --mode prod", - "build:test": "vue-cli-service build --mode test" + "build:test": "vue-cli-service build --mode test", + "build:alpine": "vue-cli-service build --mode alpine" }, "dependencies": { "@wangeditor/editor": "^5.1.23", diff --git a/src/App.vue b/src/App.vue index e84908a9..ad2ec813 100644 --- a/src/App.vue +++ b/src/App.vue @@ -44,7 +44,7 @@ export default defineComponent({ const store = useStore(); const isLogin = ref(false); // console.log("router", router.getRoutes(), route); - console.log("版本2.0.4------------"); + console.log("版本2.0.5------------"); const routes = computed(() => { return router.getRoutes().filter((e) => e.meta?.isLink); }); diff --git a/src/api/config.js b/src/api/config.js index 8db32374..74e67963 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -6,7 +6,7 @@ * @FilePath: /fe-manage/src/api/config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ -import { message } from "ant-design-vue"; +import {message} from "ant-design-vue"; import axios from "axios"; import router from "@/router"; // import { getCookie } from '../api/method' @@ -21,7 +21,7 @@ const http = axios.create({ baseURL: process.env.VUE_APP_BASE_API, timeout: 1000 * 15, // headers: { "Content-Type": "multipart/form-data" }, - headers: { "Content-Type": "application/json" }, + headers: {"Content-Type": "application/json"}, }); http.interceptors.request.use( @@ -51,18 +51,19 @@ http.interceptors.response.use( (response) => { // console.log('response', response) const { - data: { code, msg }, + data: {code, msg, show}, } = response; - // console.log('code', code) + console.log('code', code) if (code === 0 || code === 200) { return response; - } else { - if (code === 1000) { - (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') ? router.push({ path: 'login' }) : (window.location.href = process.env.VUE_APP_LOGIN_URL) - } - console.log("api %o", msg); } - return response; + if (code === 1000) { + (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: 'login'}) : (window.location.href = process.env.VUE_APP_LOGIN_URL) + return Promise.reject(response); + } + show && message.error(msg); + console.log("api %o", msg); + return Promise.reject(response); }, function (error) { if (error.message == "timeout of 1ms exceeded") { diff --git a/src/components/Modals/ExportHomeWork.vue b/src/components/Modals/ExportHomeWork.vue index 88db9ff3..ee335405 100644 --- a/src/components/Modals/ExportHomeWork.vue +++ b/src/components/Modals/ExportHomeWork.vue @@ -27,7 +27,7 @@ style="width: 40px; height: 40px; margin-bottom: 16px" src="../../assets/images/leveladd/success.png" /> - 作业导出完成,请下载本地或去下载中心查看 + 作业导出完成,请下载到本地或去下载中心查看
@@ -66,7 +66,7 @@ export default { const downloadHomeWork = () => { // props.url if (props.downloadUrl) { - window.open(props.downloadUrl); + window.open(process.env.VUE_APP_FILE_PATH+props.downloadUrl); } }; console.log("props", props); diff --git a/src/components/TwoDimensionalCode.vue b/src/components/TwoDimensionalCode.vue index 85681b8e..83ee580a 100644 --- a/src/components/TwoDimensionalCode.vue +++ b/src/components/TwoDimensionalCode.vue @@ -47,10 +47,14 @@
复制链接