case-data/main.js
zoujiandong bbc99ec0dd 6.16
2025-06-16 19:01:04 +08:00

73 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import App from './App'
import navTo from './utils/navTo'
// #ifdef h5
import api from './api/api'
import cookie from './utils/cookie'
// #endif
import uviewPlus, { setConfig } from 'uview-plus'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
app.use(uviewPlus, async() => {
// if(process.env.UNI_PLATFORM =="h5"){
// let token = '';
// if(window.location.href.indexOf('//casedata.igandan.com')>-1){
// token = uni.getStorageSync('AUTH_TOKEN_CASEDATA');
// }else{
// token = uni.getStorageSync('DEV_AUTH_TOKEN_CASEDATA');
// }
// if(!token){
// let video_token = cookie.readCookie('video_token');
// alert(video_token)
// const res = await api.h5Login({
// token: video_token
// });
// let result = res.data;
// if (window.location.href.indexOf('//casedata.igandan.com')>-1) {
// uni.setStorageSync("AUTH_TOKEN_CASEDATA",result.token);
// } else {
// uni.setStorageSync("DEV_AUTH_TOKEN_CASEDATA",result.token);
// };
// uni.setStorageSync("userInfo",{
// avatar:result.avatar,
// user_id:result.user_id,
// status:result.status,
// user_name:result.user_name,
// doctor_id:result.doctor_id,
// });
// }
// }
return {
options: {
// 修改$u.config对象的属性
config: {
// 修改默认单位为rpx相当于执行 uni.$u.config.unit = 'rpx'
unit: 'rpx'
}
}
}
})
//app.config.globalProperties.$navTo = navTo
return {
app
}
}
// #endif