Commit 6f688596 by xinla

聊天工具栏问题

1 parent 91fc2b93
...@@ -31,9 +31,7 @@ export default { ...@@ -31,9 +31,7 @@ export default {
// this.$toast('agentId:' + this.agentId) // this.$toast('agentId:' + this.agentId)
this.$router.onReady(() => { this.$router.onReady(() => {
const noAuth = this.$router.app.$route.meta const noAuth = this.$router.app.$route.meta ? this.$router.app.$route.meta.noAuth : false
? this.$router.app.$route.meta.noAuth
: false
if (!code && !noAuth) { if (!code && !noAuth) {
this.$toast('未获得授权') this.$toast('未获得授权')
...@@ -67,10 +65,7 @@ export default { ...@@ -67,10 +65,7 @@ export default {
async wxConfig() { async wxConfig() {
this.$store.state.agentConfigStatus = false this.$store.state.agentConfigStatus = false
try { try {
let { data } = await getAgentTicket( let { data } = await getAgentTicket(window.location.href.split('#')[0], this.agentId)
window.location.href.split('#')[0],
this.agentId
)
let { timestamp, nonceStr, signature } = data let { timestamp, nonceStr, signature } = data
wx.agentConfig({ wx.agentConfig({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题 beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
...@@ -90,7 +85,7 @@ export default { ...@@ -90,7 +85,7 @@ export default {
], //必填 ], //必填
success: (res) => { success: (res) => {
// 回调 // 回调
this.$toast('agentId成功:') // this.$toast('agentId成功:')
this.$store.state.agentConfigStatus = true this.$store.state.agentConfigStatus = true
}, },
fail: (res) => { fail: (res) => {
......
...@@ -15,7 +15,11 @@ export default { ...@@ -15,7 +15,11 @@ export default {
// userId: this.$store.state.userId, // userId: this.$store.state.userId,
} }
}, },
watch: {}, watch: {
userId() {
this.getList()
}
},
computed: { computed: {
userId() { userId() {
return this.$store.state.userId return this.$store.state.userId
...@@ -29,6 +33,7 @@ export default { ...@@ -29,6 +33,7 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
getList() { getList() {
this.list = []
getTypeList().then(({ rows, total }) => { getTypeList().then(({ rows, total }) => {
this.userId && this.userId &&
this.list.push({ this.list.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!