代码拉取完成,页面将自动刷新
<script>
const chatIM = require('./xilu/chat.js');
export default {
onLaunch: function() {
let app = this;
app.$core.onRequestComplete(function (ret, response) {
if(ret && ret.code===401) {
if(app.$core.getUserinfo()) {
app.$core.logout();
uni.navigateTo({url: '/pages/login/login'});
uni.showToast({title: '登录过期,请重新登录',icon:'none'});
}
}
});
setTimeout(function () {
// app初始化完成后再执行
let userinfo = app.$core.getUserinfo();
if (userinfo) {
app.globalData.userinfo = userinfo;
chatIM.connectSocket();
}
app.$core.get({url:'xilumarket.common/init_config',data:{},loading:false,success:(ret)=>{
app.globalData.config = ret.data.config;
app.globalData.chat_config.emoList = ret.data.emo
}})
//1.定位
app.$core.getLocation();
},1);
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
globalData: {
isIos: false,
platformStatus: 1,
statusBarHeight: 20,
//小程序配置的接口请求域名,为项目部署的服务器路径
appid: '',
//wsDomain: 'ws://xilumarket.com:8183',
wsDomain: 'wss://ershou.dayupintuan.com',
apiBaseUri: "https://ershou.dayupintuan.com/api",
////前端上传图片补全域名,如oss的https://xxxx.oss-cn-shanghai.aliyuncs.com,或https://your.site.com
storageBaseUri: "",
//阿里OSS的上传路径
uploadOssStatus: false,
alioss: {endpoint:''},
config:{
logo:''
},
userinfo:null,
chat_config: {
SocketTask: null,
Timer: null,
ErrorMsg: [],
MaxRetryCount: 30, // 最大重连次数
CurrentRetryCount: 0,
ortherdata: null, //其他通用数据
emoList:[], //表情
messageCount:0, //未读消息数
},
Event: {
CurrentCityChange: "currentCityChange",
CurrentCityChange2: "currentCityChange2"
},
defaultCity:{
id: 104,
name: '上海市'
},
},
}
</script>
<style>
/*每个页面公共css */
@import "@/static/style.css";
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。