在官方工程基础上加入环境变量文件
commit
4d2fd4bacd
@ -0,0 +1,31 @@
|
||||
###
|
||||
# 全局环境变量
|
||||
# .env 需要本地全局环境变量请创建:.env.local
|
||||
# 自定义环境变量必须是以VITE_开始
|
||||
# @Author : J.L.Zhou
|
||||
# @EMail : 12020042@qq.com
|
||||
# @Tel : 151 1104 7708
|
||||
# @CreateTime : 2023-05-16 10:02:21
|
||||
# @LastEditos : J.L.Zhou
|
||||
# @LastEditTime : 2023-05-16 10:02:21
|
||||
# @Version : 1.0
|
||||
# Copyright 2023 jlzhou.top Inc. All rights reserved.
|
||||
# Warning: this content is only for internal circulation of the company.
|
||||
# It is forbidden to divulge it or use it for other commercial purposes.
|
||||
###
|
||||
|
||||
# 项目标题,建议全局配置
|
||||
VITE_TITLE=示例项目
|
||||
|
||||
# 请求后端api的基础地址
|
||||
# 小程序需加入白名单,并设置跨域
|
||||
VITE_BASE_API=http://127.0.0.1:8080/
|
||||
|
||||
# 外部资源的基础地址
|
||||
# 小程序需加入白名单,并设置跨域
|
||||
VITE_BASE_RESOURCES=http://127.0.0.1:8080/
|
||||
|
||||
# WebSocket的基础地址
|
||||
VITE_BASE_WS=ws://127.0.0.1:8080/
|
||||
|
||||
VITE_TEST1=全局测试变量
|
||||
@ -0,0 +1,30 @@
|
||||
###
|
||||
# 开发环境变量
|
||||
# .env.development 需要本地开发环境变量请创建:.env.development.local
|
||||
# 自定义环境变量必须是以VITE_开始
|
||||
# @Author : J.L.Zhou
|
||||
# @EMail : 12020042@qq.com
|
||||
# @Tel : 151 1104 7708
|
||||
# @CreateTime : 2023-05-16 10:02:21
|
||||
# @LastEditos : J.L.Zhou
|
||||
# @LastEditTime : 2023-05-16 10:02:21
|
||||
# @Version : 1.0
|
||||
# Copyright 2023 jlzhou.top Inc. All rights reserved.
|
||||
# Warning: this content is only for internal circulation of the company.
|
||||
# It is forbidden to divulge it or use it for other commercial purposes.
|
||||
###
|
||||
|
||||
|
||||
|
||||
# 请求后端api的基础地址
|
||||
# 小程序需加入白名单,并设置跨域
|
||||
VITE_BASE_API=http://127.0.0.1:8080/
|
||||
|
||||
# 外部资源的基础地址
|
||||
# 小程序需加入白名单,并设置跨域
|
||||
VITE_BASE_RESOURCES=http://127.0.0.1:8080/
|
||||
|
||||
# WebSocket的基础地址
|
||||
VITE_BASE_WS=ws://127.0.0.1:8080/
|
||||
|
||||
VITE_TEST2=测试开发环境变量
|
||||
@ -0,0 +1,30 @@
|
||||
###
|
||||
# 生产环境变量
|
||||
# .env.development 需要本地生产环境变量请创建:.env.development.local
|
||||
# 自定义环境变量必须是以VITE_开始
|
||||
# @Author : J.L.Zhou
|
||||
# @EMail : 12020042@qq.com
|
||||
# @Tel : 151 1104 7708
|
||||
# @CreateTime : 2023-05-16 10:02:21
|
||||
# @LastEditos : J.L.Zhou
|
||||
# @LastEditTime : 2023-05-16 10:02:21
|
||||
# @Version : 1.0
|
||||
# Copyright 2023 jlzhou.top Inc. All rights reserved.
|
||||
# Warning: this content is only for internal circulation of the company.
|
||||
# It is forbidden to divulge it or use it for other commercial purposes.
|
||||
###
|
||||
|
||||
|
||||
|
||||
# 请求后端api的基础地址
|
||||
# 小程序需加入白名单,并设置跨域
|
||||
VITE_BASE_API=http://127.0.0.1:8080/
|
||||
|
||||
# 外部资源的基础地址
|
||||
# 小程序需加入白名单,并设置跨域
|
||||
VITE_BASE_RESOURCES=http://127.0.0.1:8080/
|
||||
|
||||
# WebSocket的基础地址
|
||||
VITE_BASE_WS=ws://127.0.0.1:8080/
|
||||
|
||||
VITE_TEST3=测试生产环境变量
|
||||
@ -0,0 +1,21 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"types": [
|
||||
"@dcloudio/types",
|
||||
"miniprogram-api-typings",
|
||||
"mini-types"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "uni-preset-vue",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev:app": "uni -p app",
|
||||
"dev:app-android": "uni -p app-android",
|
||||
"dev:app-ios": "uni -p app-ios",
|
||||
"dev:custom": "uni -p",
|
||||
"dev:h5": "uni",
|
||||
"dev:h5:ssr": "uni --ssr",
|
||||
"dev:mp-alipay": "uni -p mp-alipay",
|
||||
"dev:mp-baidu": "uni -p mp-baidu",
|
||||
"dev:mp-jd": "uni -p mp-jd",
|
||||
"dev:mp-kuaishou": "uni -p mp-kuaishou",
|
||||
"dev:mp-lark": "uni -p mp-lark",
|
||||
"dev:mp-qq": "uni -p mp-qq",
|
||||
"dev:mp-toutiao": "uni -p mp-toutiao",
|
||||
"dev:mp-weixin": "uni -p mp-weixin",
|
||||
"dev:quickapp-webview": "uni -p quickapp-webview",
|
||||
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
||||
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
|
||||
"build:app": "uni build -p app",
|
||||
"build:app-android": "uni build -p app-android",
|
||||
"build:app-ios": "uni build -p app-ios",
|
||||
"build:custom": "uni build -p",
|
||||
"build:h5": "uni build",
|
||||
"build:h5:ssr": "uni build --ssr",
|
||||
"build:mp-alipay": "uni build -p mp-alipay",
|
||||
"build:mp-baidu": "uni build -p mp-baidu",
|
||||
"build:mp-jd": "uni build -p mp-jd",
|
||||
"build:mp-kuaishou": "uni build -p mp-kuaishou",
|
||||
"build:mp-lark": "uni build -p mp-lark",
|
||||
"build:mp-qq": "uni build -p mp-qq",
|
||||
"build:mp-toutiao": "uni build -p mp-toutiao",
|
||||
"build:mp-weixin": "uni build -p mp-weixin",
|
||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-components": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-h5": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-alipay": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-baidu": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-jd": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-lark": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-qq": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-toutiao": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-3071120230427001",
|
||||
"vue": "^3.2.45",
|
||||
"vue-i18n": "^9.1.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dcloudio/types": "^3.3.2",
|
||||
"@dcloudio/uni-automator": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-3071120230427001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-3071120230427001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-3071120230427001",
|
||||
"vite": "4.1.4"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,17 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide')
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
</style>
|
||||
@ -0,0 +1,14 @@
|
||||
import {
|
||||
createSSRApp
|
||||
} from "vue";
|
||||
import App from "./App.vue";
|
||||
|
||||
console.debug(import.meta.env);
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
return {
|
||||
app,
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
{
|
||||
"name" : "",
|
||||
"appid" : "",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"vueVersion" : "3"
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<image class="logo" src="/static/logo.png"></image>
|
||||
<view class="text-area">
|
||||
<text class="title">{{ title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: 'Hello',
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 200rpx;
|
||||
width: 200rpx;
|
||||
margin-top: 200rpx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.text-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
color: #8f8f94;
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,8 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import uni from '@dcloudio/vite-plugin-uni'
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
uni(),
|
||||
],
|
||||
})
|
||||
Loading…
Reference in New Issue