| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- import App from './App'
- import DictTag from "@/components/DictTag/index.vue"
- /* 全局挂载请求库 */
- import GraceRequest from '@/Grace6/js/request.js'
- import graceJS from "@/Grace6/js/grace.js";
- import router from '@/router/router.js'
- import {
- CCPrintingAPI
- } from "@/unit/CCPrintingAPI.min.vue.js";
- import {
- baseURL
- } from '@/api/env.js'
- import {
- antiShake,
- hideBoard,
- parseTime
- } from "@/unit/default.js"
- import pinia from "@/stores/index.js"
- import {
- goHome,
- goBack
- } from "@/unit/navigate.js"
- import {
- permission
- } from "@/unit/rule.js"
- // http://192.168.1.94:48080
- // http://218.2.10.30:48080
- // http://113.105.183.190:8181/
- // uni.$baseUrl = "http://192.168.1.44:48080";
- // uni.$baseUrl = "http://192.168.1.69:48080";
- // uni.$baseUrl = "http://192.168.1.94:48080";
- // uni.$baseUrl = "http://192.168.1.97:48080";
- // uni.$baseUrl = "";
- // uni.$baseUrl = "http://218.2.10.30:48080";
- uni.$baseUrl = "http://192.168.1.94:48080"; // dev
- // uni.$baseUrl = "http://113.105.183.190:48064";
- // uni.$baseUrl = "http://113.105.183.190:48080";
- // uni.$baseUrl = "http://113.105.183.190:48163";
- // uni.$baseUrl = "http://113.105.183.190:48167";
- // uni.$baseUrl = "http://192.168.2.253:48080";
- // uni.$baseUrl = "http://47.107.70.17:48080";
- // uni.$useStore = useStore;
- uni.$debounce = antiShake;
- uni.gRequest = GraceRequest;
- uni.$grace = graceJS;
- uni.$isPda = false;
- uni.$isPhone = false;
- uni.$isPad = false;
- uni.$hideKeyBoard = hideBoard;
- // 自定义拦截器
- import {
- reqAll,
- reqGet,
- reqPut,
- reqPost,
- reqDelete
- } from '@/api/index.js'
- uni.CCPrintingAPI = CCPrintingAPI;
- uni.$reqAll = reqAll;
- uni.$reqGet = reqGet;
- uni.$reqPut = reqPut;
- uni.$reqPost = reqPost;
- uni.$reqDelete = reqDelete;
- uni.$goHome = goHome;
- uni.$goBack = goBack;
- // 判断是否是平板
- uni.getSystemInfo({
- success: (res) => {
- if (res.screenWidth > 620) {
- uni.$isPad = true;
- }
- if (res.screenWidth > 320 && res.screenWidth < 620) {
- uni.$isPhone = true;
- }
- if (res.screenWidth <= 320) {
- uni.$isPda = true;
- }
- }
- });
- // 解决 global is not defined 报错问题
- // if (typeof window.global === "undefined"){
- // window.global = window;
- // }
- // #ifndef VUE3
- import Vue from 'vue'
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- // app.use(Directives);
- app.$mount()
- // #endif
- // #ifdef VUE3
- import {
- createSSRApp
- } from 'vue'
- export function createApp() {
- const app = createSSRApp(App)
- app.component('DictTag', DictTag)
- app.use(router)
- app.use(pinia)
- // 挂载全局指令
- app.config.globalProperties.$permission = permission;
- app.config.globalProperties.$parseTime = parseTime;
- uni.getSystemInfo({
- success: (res) => {
- if (res.screenWidth > 620) {
- app.config.globalProperties.isPad = true;
- app.config.globalProperties.padWidth = res.screenWidth;
- app.config.globalProperties.padHeight = res.windowHeight;
- }
- if (res.screenWidth > 320 && res.screenWidth < 620) {
- app.config.globalProperties.isPhone = true;
- app.config.globalProperties.phoneWidth = res.screenWidth;
- app.config.globalProperties.phoneHeight = res.windowHeight;
- }
- if (res.screenWidth <= 320) {
- app.config.globalProperties.isPda = true;
- app.config.globalProperties.pdaWidth = res.screenWidth;
- app.config.globalProperties.pdaHeight = res.windowHeight;
- }
- }
- });
- return {
- app
- }
- }
- // #endif
|