Commit 1cba74e7 by xinla

移动聊天素材调试

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