diff --git a/src/apps/AppMeetingNotice/components/addMeeting.vue b/src/apps/AppMeetingNotice/components/addMeeting.vue
index 40173fda..0e675ef1 100644
--- a/src/apps/AppMeetingNotice/components/addMeeting.vue
+++ b/src/apps/AppMeetingNotice/components/addMeeting.vue
@@ -9,13 +9,17 @@
- {{form.startTime.time}}
- {{form.startTime.year}}年{{form.startTime.month}}月{{form.startTime.day}}日 周{{form.startTime.weekday}}
+ {{ form.startTime.time }}
+ {{ form.startTime.year }}年{{ form.startTime.month }}月{{
+ form.startTime.day
+ }}日 周{{ form.startTime.weekday }}
- {{form.endTime.time}}
- {{form.endTime.year}}年{{form.endTime.month}}月{{form.endTime.day}}日 周{{form.endTime.weekday}}
+ {{ form.endTime.time }}
+ {{ form.endTime.year }}年{{ form.endTime.month }}月{{ form.endTime.day }}日 周{{
+ form.endTime.weekday
+ }}
@@ -34,14 +38,16 @@
-
+
请选择
- 已选择{{form.attendees.map(e=>e.name).slice(0,2).join("、")}}等{{form.attendees.length}}人
+ 已选择{{ form.attendees.map(e => e.name).slice(0, 2).join("、") }}等{{
+ form.attendees.length
+ }}人
@@ -52,7 +58,9 @@
- {{ form.noticeBefore !=null ? $dict.getDict('meetingNoticeBefore')[form.noticeBefore]["dictName"] : "请选择"}}
+ {{
+ form.noticeBefore != null ? $dict.getDict('meetingNoticeBefore')[form.noticeBefore]["dictName"] : "请选择"
+ }}
@@ -62,7 +70,9 @@
- {{form.noticeAfter !=null ? $dict.getDict('meetingNoticeAfter')[form.noticeAfter]["dictName"] : "请选择"}}
+ {{
+ form.noticeAfter != null ? $dict.getDict('meetingNoticeAfter')[form.noticeAfter]["dictName"] : "请选择"
+ }}
@@ -80,321 +90,328 @@
diff --git a/src/pages/loading.vue b/src/pages/loading.vue
index 87849e97..02daf34a 100644
--- a/src/pages/loading.vue
+++ b/src/pages/loading.vue
@@ -33,7 +33,7 @@ export default {
}
},
methods: {
- ...mapActions(['getToken', 'getAccount', 'agentSign', 'getUserInfo', 'getCode', 'closeAgent']),
+ ...mapActions(['agentSign']),
redirectTo(path) {
let {query, hash} = this.$route
delete query.app
@@ -60,6 +60,9 @@ export default {
})
}
},
+ onLoad() {
+ this.agentSign(this.$route.query)
+ },
onShow() {
this.getApps()
this.result = {
diff --git a/src/store/index.js b/src/store/index.js
index 2a52f0b4..87f9581a 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -5,7 +5,7 @@ import http from '../common/axios'
import CryptoJS from '../utils/crypto-js'
Vue.use(Vuex)
-let agentSignURL = "", apiList = [], agentConfig = {}
+let agentSignURL = "", apiList = []
const store = new Vuex.Store({
state: {
token: "",
@@ -30,7 +30,7 @@ const store = new Vuex.Store({
state.openUser = user
},
getConfig(state, params) {
- Object.keys(params).map(e => state[e] = params[e])
+ state.config = params
},
bindAccount(state, params) {
//具备解决二次登录,绑定手机,token等问题
@@ -61,7 +61,7 @@ const store = new Vuex.Store({
},
redirectCode(state, url = location.href) {
let REDIRECT_URI = encodeURIComponent(url),
- corpid = state.corpId || agentConfig?.corpid
+ corpid = state.corpId
const redirectTo = cid => {
location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base#wechat_redirect'
.replace(/CORPID/g, cid)
@@ -71,7 +71,7 @@ const store = new Vuex.Store({
redirectTo(corpid)
} else {
store.dispatch("agentSign").then(() => {
- corpid = state.corpId || agentConfig?.corpid
+ corpid = state.corpId
redirectTo(corpid)
})
}
@@ -198,7 +198,7 @@ const store = new Vuex.Store({
})
},
getCode(store, url) {
- if (agentConfig?.corpid) {
+ if (store.state.config?.corpid) {
store.commit('redirectCode', url)
} else {
store.dispatch('agentSign').then(() => {
@@ -232,17 +232,20 @@ const store = new Vuex.Store({
})
}
},
- agentSign(state) {
- let url = window.location.href
+ agentSign(state, params) {
+ let url = window.location.href,
+ {corpId, suiteId} = state.state.config
if (agentSignURL == url) {
return Promise.resolve()
} else {
agentSignURL = url
- return http.post("/app/wxcp/portal/agentSign", null, {
- params: {url}
+ params = params || {corpId, suiteId}
+ return http.post("/app/wxcptp/portal/agentSign", null, {
+ params: {...params, url}
}).then(res => {
if (res?.data) {
- let params = {
+ let config = {
+ ...params,
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
beta: true,// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
@@ -252,8 +255,8 @@ const store = new Vuex.Store({
signature: res.data.signature,// 必填,签名,见 附录-JS-SDK使用权限签名算法
...res.data,
}
- agentConfig = params
- state.commit("getConfig", {corpId: params.corpid})
+ state.commit("getConfig", config)
+ return config
}
}).catch(err => {
console.error(err)
@@ -261,11 +264,11 @@ const store = new Vuex.Store({
}
},
injectJWeixin(state, ops) {
- const inject = jsApiList => new Promise((resolve, reject) => {
+ const inject = (jsApiList, config = state.state.config) => new Promise((resolve, reject) => {
setTimeout(() => {
let sdk = wx?.agentConfig ? wx : jWeixin
sdk?.agentConfig({
- ...agentConfig, jsApiList,
+ ...config, jsApiList,
success: res => resolve(res),
fail: err => {
console.error(err)
@@ -275,7 +278,7 @@ const store = new Vuex.Store({
}, 500)
})
return new Promise((resolve, reject) => {
- state.dispatch("agentSign").then(() => {
+ state.dispatch("agentSign").then(config => {
if (typeof ops == "object") {
ops?.map(api => {
if (!apiList?.includes(api)) apiList.push(api)
@@ -283,7 +286,7 @@ const store = new Vuex.Store({
} else {
if (!apiList?.includes(ops)) apiList.push(ops)
}
- inject(apiList).then(r => resolve(r)).catch(err => reject(err))
+ inject(apiList, config).then(r => resolve(r)).catch(err => reject(err))
})
})
},
@@ -318,6 +321,27 @@ const store = new Vuex.Store({
}, 500)
})
},
+ selectEnterpriseContact(state) {
+ return new Promise(resolve => {
+ state.dispatch("injectJWeixin", "selectEnterpriseContact").then(() => {
+ setTimeout(() => {
+ let sdk = typeof wx?.invoke == 'function' ? wx : jWeixin
+ sdk?.invoke("selectEnterpriseContact", {
+ fromDepartmentId: -1,
+ mode: "multi",
+ type: ["user"]
+ }, res => {
+ if (res.err_msg == "selectEnterpriseContact:ok") {
+ if (typeof res.result == 'string') {
+ res.result = JSON.parse(res.result)
+ }
+ resolve(res.result)
+ }
+ })
+ }, 500)
+ })
+ })
+ },
},
getters: {
getDict: state => key => {