diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 0a68351..5801e6a 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -10,6 +10,13 @@ "app-plus" : { "launchtype" : "local" }, + "default" : { + "launchtype" : "local" + }, + "h5" : { + "launchtype" : "local" + }, + "provider" : "aliyun", "type" : "uniCloud" }, { diff --git a/App.vue b/App.vue index 71956e0..6331c5e 100644 --- a/App.vue +++ b/App.vue @@ -1,12 +1,15 @@ \ No newline at end of file diff --git a/components/ch-icon/ch-icon.scss b/components/ch-icon/ch-icon.scss new file mode 100644 index 0000000..e69de29 diff --git a/components/ch-icon/ch-icon.vue b/components/ch-icon/ch-icon.vue new file mode 100644 index 0000000..c2f491a --- /dev/null +++ b/components/ch-icon/ch-icon.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/components/components.js b/components/components.js index 1b6d000..cd05761 100644 --- a/components/components.js +++ b/components/components.js @@ -1,7 +1,10 @@ import ChNavBar from '@/components/ch-nav-bar/ch-nav-bar.vue' import ChNavBtn from '@/components/ch-nav-btn/ch-nav-btn.vue' +import ChIcon from '@/components/ch-icon/ch-icon.vue'; +import ChEmpty from '@/components/ch-empty/ch-empty.vue'; export default function registerComponents (app) { app.component(ChNavBar.name, ChNavBar); app.component(ChNavBtn.name, ChNavBtn); + app.component(ChIcon.name, ChIcon) } \ No newline at end of file diff --git a/pages/exam/exam.vue b/pages/exam/exam.vue index cfc0d6c..0f7fce4 100644 --- a/pages/exam/exam.vue +++ b/pages/exam/exam.vue @@ -15,6 +15,7 @@ + diff --git a/pages/questions/questions.vue b/pages/questions/questions.vue index 6e6ed41..26b83da 100644 --- a/pages/questions/questions.vue +++ b/pages/questions/questions.vue @@ -29,7 +29,8 @@ - + + diff --git a/pages/task/task.vue b/pages/task/task.vue index 3d47d87..ba9b3e2 100644 --- a/pages/task/task.vue +++ b/pages/task/task.vue @@ -15,6 +15,7 @@ + diff --git a/pages/taskDetails/taskDetails.vue b/pages/taskDetails/taskDetails.vue index b8fe6e7..3375219 100644 --- a/pages/taskDetails/taskDetails.vue +++ b/pages/taskDetails/taskDetails.vue @@ -52,7 +52,7 @@ const status = computed(() => { }) const uploadUrl = computed(() => { - return `${config.baseUrl}/api/user.ashx?act=studenthomeworkinfo&studentid=${userId}&homeworkid=${taskId.value}` + return `${config.baseUrl}/api/user.ashx?act=subhomeworkinfo&studentid=${userId}&homeworkid=${taskId.value}` }) onLoad((option) => { diff --git a/router/index.js b/router/index.js index 5d5b6b2..1ee8b1f 100644 --- a/router/index.js +++ b/router/index.js @@ -11,9 +11,9 @@ uniCrazyRouter.beforeEach(async (to, from ,next)=>{ console.log('beforEach router') const path = to.url; - const uId = uni.getStorageSync('uId') || null; + const uInfo = uni.getStorageSync('uInfo') || null; - if (whiteList.includes(path) || uId) { + if (whiteList.includes(path) || uInfo) { next() return; } diff --git a/store/system.js b/store/system.js index 3261409..80de8f3 100644 --- a/store/system.js +++ b/store/system.js @@ -15,8 +15,7 @@ export const useSystemStore = defineStore('system', () => { return new Promise((resolve, reject) => { login(params,).then(res => { userStore.setUserInfo(res); - userStore.setUserId(res.studentid); - uni.setStorageSync('uId', res.studentid); + uni.setStorageSync('uInfo', JSON.stringify(res)); resolve(res) }).catch(error => { console.log('登录失败:', error) diff --git a/store/user.js b/store/user.js index 56121d0..6984b01 100644 --- a/store/user.js +++ b/store/user.js @@ -7,11 +7,8 @@ export const useUserStore = defineStore('user', () => { function setUserInfo(info) { userInfo.value = info; + userId.value = info.studentid } - function setUserId(id) { - userId.value = id; - } - - return { userInfo, userId, setUserInfo, setUserId }; + return { userInfo, userId, setUserInfo }; })