Commit e2e9ddd7 authored by Damon's avatar Damon

perf: 机构ID存储

parent 2640416a
...@@ -4,11 +4,10 @@ export default { ...@@ -4,11 +4,10 @@ export default {
globalData: { globalData: {
// 开发环境 // 开发环境
uniEnv: process.uniEnv, uniEnv: process.uniEnv,
questionList: [], questionList: []
orgId: -1
}, },
onLaunch: function(options) { onLaunch: function(options) {
this.globalData.orgId = options?.query?.orgId || -1 this.$u.vuex('orgId', options?.query?.orgId || -1)
// 版本更新 // 版本更新
this.updateApp() this.updateApp()
}, },
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
}, },
computed: { computed: {
orgIdText() { orgIdText() {
return getApp().globalData.orgId return this.orgId
}, },
title() { title() {
return this.selected.title || '请选择题库' return this.selected.title || '请选择题库'
......
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
}, },
] ]
const data = { const data = {
instrtutionId: getApp().globalData.orgId, instrtutionId: this.orgId,
orders: JSON.stringify(lists), orders: JSON.stringify(lists),
openId: this.openId, openId: this.openId,
} }
......
...@@ -206,7 +206,7 @@ export default { ...@@ -206,7 +206,7 @@ export default {
}, },
] ]
const data = { const data = {
instrtutionId: getApp().globalData.orgId, instrtutionId: this.orgId,
orders: JSON.stringify(lists), orders: JSON.stringify(lists),
openId: this.openId, openId: this.openId,
} }
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
code: code, code: code,
avatar: userInfo.avatarUrl, avatar: userInfo.avatarUrl,
nickname: userInfo.nickName, nickname: userInfo.nickName,
orgId: getApp().globalData.orgId, orgId: this.orgId,
} }
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
......
...@@ -19,7 +19,8 @@ let saveStateKeys = [ ...@@ -19,7 +19,8 @@ let saveStateKeys = [
'tipStatus', 'tipStatus',
'questionWarehouseId', 'questionWarehouseId',
'relationId', // 绑卡用 'relationId', // 绑卡用
'answerCount' 'answerCount',
'orgId'
] ]
// 保存变量到本地存储中 // 保存变量到本地存储中
...@@ -51,6 +52,7 @@ const store = new Vuex.Store({ ...@@ -51,6 +52,7 @@ const store = new Vuex.Store({
questionWarehouseId: lifeData.questionWarehouseId questionWarehouseId: lifeData.questionWarehouseId
? lifeData.questionWarehouseId ? lifeData.questionWarehouseId
: '1414854649273384960', // 科目ID : '1414854649273384960', // 科目ID
orgId: lifeData.orgId ? lifeData.orgId : -1, // 机构ID
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式 // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version: '1.0.0', vuex_version: '1.0.0',
questionList: {}, // 练习列表 questionList: {}, // 练习列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment