Commit 3f7fe7bc by xinla

移动聊天素材调试

1 parent e2780ca1
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"core-js": "^3.6.5", "core-js": "^3.6.5",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"vant": "^2.12.2", "vant": "^2.12.2",
"vconsole": "^3.4.0",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0" "vuex": "^3.4.0"
......
...@@ -29,7 +29,7 @@ export function getAppTicket(url) { ...@@ -29,7 +29,7 @@ export function getAppTicket(url) {
} }
/** /**
* 获取企业的jsapi_ticket * 获取登录用户id
* @param {*} url 页面url * @param {*} url 页面url
*/ */
export function getUserInfo(code) { export function getUserInfo(code) {
...@@ -37,6 +37,7 @@ export function getUserInfo(code) { ...@@ -37,6 +37,7 @@ export function getUserInfo(code) {
url: service + '/user/getUserInfo', url: service + '/user/getUserInfo',
params: { params: {
code, code,
agentId: '1000005',
}, },
}) })
} }
...@@ -16,6 +16,9 @@ import App from './App.vue' ...@@ -16,6 +16,9 @@ import App from './App.vue'
import router from './router' import router from './router'
import store from './store' import store from './store'
import VConsole from 'vconsole'
process.env.NODE_ENV === 'production' && new VConsole()
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
......
import axios from 'axios' import axios from 'axios'
import { Toast } from 'vant' import { Toast, Dialog } from 'vant'
function createAxios(baseURL) { function createAxios(baseURL) {
const instance = axios.create({ const instance = axios.create({
...@@ -45,7 +45,7 @@ function createAxios(baseURL) { ...@@ -45,7 +45,7 @@ function createAxios(baseURL) {
if (error.response) { if (error.response) {
addErrorLog(error.response) addErrorLog(error.response)
} else { } else {
Toast.fail('服务器未启动或连接超时') Dialog({ message: '服务器未启动或连接超时' })
console.error('服务器未启动或连接超时') console.error('服务器未启动或连接超时')
} }
return Promise.reject(error) return Promise.reject(error)
...@@ -69,7 +69,7 @@ function createAxios(baseURL) { ...@@ -69,7 +69,7 @@ function createAxios(baseURL) {
process.env.NODE_ENV === 'development' process.env.NODE_ENV === 'development'
? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`) ? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`)
: console.error(`${JSON.parse(responseText).message}`) : console.error(`${JSON.parse(responseText).message}`)
Toast.fail(`${responseText}`) Dialog({ message: responseText })
} }
return instance return instance
......
...@@ -15,8 +15,6 @@ export default { ...@@ -15,8 +15,6 @@ export default {
finished: false, finished: false,
show: false, show: false,
userId: '', userId: '',
auth_code: '',
auth_code1: '',
} }
}, },
watch: {}, watch: {},
...@@ -28,7 +26,6 @@ export default { ...@@ -28,7 +26,6 @@ export default {
// .slice(1) // .slice(1)
// .split('&')[0] // .split('&')[0]
// .split('=')[1] // .split('=')[1]
// this.auth_code1 = auth_code
// if (!auth_code) { // if (!auth_code) {
// this.$toast('未获得授权') // this.$toast('未获得授权')
// return // return
...@@ -47,7 +44,6 @@ export default { ...@@ -47,7 +44,6 @@ export default {
.slice(1) .slice(1)
.split('&')[0] .split('&')[0]
.split('=')[1] .split('=')[1]
this.auth_code1 = auth_code
if (!auth_code) { if (!auth_code) {
this.$toast('未获得授权') this.$toast('未获得授权')
return return
...@@ -58,10 +54,12 @@ export default { ...@@ -58,10 +54,12 @@ export default {
this.$toast('userId:' + this.userId) this.$toast('userId:' + this.userId)
}) })
.catch((err) => { .catch((err) => {
this.$toast('err:' + err) Dialog.confirm({
title: '标题',
message: err,
})
}) })
this.getList() this.getList()
this.auth_code = location
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -90,10 +88,6 @@ export default { ...@@ -90,10 +88,6 @@ export default {
<van-icon name="plus" @click="add" /> <van-icon name="plus" @click="add" />
</template> --> </template> -->
</van-search> </van-search>
<span>{{ auth_code }}</span>
<br />
<span>auth_code:{{ auth_code1 }}</span>
<van-tabs v-model="active"> <van-tabs v-model="active">
<van-tab v-if="!!userId" title="我的"> <van-tab v-if="!!userId" title="我的">
<List ref="list0" :userId="userId" :keyword="keyword"></List> <List ref="list0" :userId="userId" :keyword="keyword"></List>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!