Merge branch 'minJeecg' into 'master'
1.修改app机制 See merge request cxcxt/jeecguniapp!15
This commit is contained in:
commit
8d831a5503
6
env/.env
vendored
6
env/.env
vendored
@ -1,7 +1,9 @@
|
||||
VITE_APP_TITLE = '数智产销'
|
||||
VITE_APP_PORT = 9000
|
||||
|
||||
VITE_UNI_APPID = '__UNI__9F097F0'
|
||||
#VITE_UNI_APPID = '__UNI__9F097F0'
|
||||
#测试APPID
|
||||
VITE_UNI_APPID = '__UNI__1B02D50'
|
||||
VITE_WX_APPID = 'wx8e287639924edb51'
|
||||
|
||||
#发布版本号
|
||||
@ -28,4 +30,4 @@ VITE_APP_PROXY= false
|
||||
VITE_APP_PROXY_PREFIX = '/api'
|
||||
|
||||
# 是否启用mock (1.仅支持h5 2.启用必须要开启代理,否则生效。)
|
||||
VITE_USE_MOCK = true
|
||||
VITE_USE_MOCK = true
|
9
env/.env.development
vendored
9
env/.env.development
vendored
@ -4,6 +4,11 @@ NODE_ENV = 'development'
|
||||
VITE_DELETE_CONSOLE = false
|
||||
# 是否开启sourcemap
|
||||
VITE_SHOW_SOURCEMAP = true
|
||||
VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
|
||||
# 是否启用读取配置文件 min
|
||||
#VITE_WEBAPP = 'D://opt//AppUpdateTest'
|
||||
VITE_WEBAPP = ''
|
||||
#VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/yjapi'
|
6
env/.env.production
vendored
6
env/.env.production
vendored
@ -4,4 +4,10 @@ NODE_ENV = 'development'
|
||||
VITE_DELETE_CONSOLE = true
|
||||
# 是否开启sourcemap
|
||||
VITE_SHOW_SOURCEMAP = false
|
||||
# 是否启用读取配置文件 min
|
||||
#VITE_WEBAPP = 'D://opt//AppUpdateTest'
|
||||
VITE_WEBAPP = ''
|
||||
VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/wwapi'
|
||||
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/yjapi'
|
||||
#VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
|
@ -17,7 +17,7 @@ export default defineManifestConfig({
|
||||
name: VITE_APP_TITLE,
|
||||
appid: VITE_UNI_APPID,
|
||||
description: '',
|
||||
versionName: '2.0.2',
|
||||
versionName: '2.0.0',
|
||||
versionCode: '20250616',
|
||||
transformPx: false,
|
||||
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
|
||||
|
@ -26,10 +26,13 @@ export function loginApi(config : LoginParams) {
|
||||
* @param
|
||||
* @returns
|
||||
*/
|
||||
export function upDateAppApi() {
|
||||
export function upDateAppApi(path : string) {
|
||||
return http({
|
||||
url: '/sys/common/upDateApp',
|
||||
method: 'GET'
|
||||
method: 'GET',
|
||||
data: {
|
||||
path
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
4
src/env.d.ts
vendored
4
src/env.d.ts
vendored
@ -14,7 +14,9 @@ interface ImportMetaEnv {
|
||||
/** 服务端口号 */
|
||||
readonly VITE_SERVER_PORT: string
|
||||
/** 后台接口地址 */
|
||||
readonly VITE_SERVER_BASEURL: string
|
||||
readonly VITE_WEBAPP: string
|
||||
/** 读取更新配置文件路径 by min */
|
||||
readonly WEBAPP: string
|
||||
/** H5是否需要代理 */
|
||||
readonly VITE_APP_PROXY: 'true' | 'false'
|
||||
/** H5是否需要代理,需要的话有个前缀 */
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "数智产销",
|
||||
"appid": "__UNI__9F097F0",
|
||||
"appid": "__UNI__1B02D50",
|
||||
"description": "",
|
||||
"versionName": "2.0.2",
|
||||
"versionName": "2.0.0",
|
||||
"versionCode": "20250616",
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
|
@ -105,9 +105,9 @@
|
||||
let pw = Base64.encode(encodeURIComponent(password.value))
|
||||
loading.value = true
|
||||
/*生产环境 begin */
|
||||
// loginApi({ username: un, password: pw })
|
||||
loginApi({ username: un, password: pw })
|
||||
/*开发环境 begin */
|
||||
loginApi({ username: userName.value, password: password.value, captcha: 'app' })
|
||||
// loginApi({ username: userName.value, password: password.value, captcha: 'app' })
|
||||
.then((res : any) => {
|
||||
if (res.success) {
|
||||
const { result } = res
|
||||
|
@ -4,6 +4,8 @@ import { isMpWeixin } from './platform'
|
||||
import { useAppStore } from '@/store'
|
||||
import { upDateAppApi } from '@/api/system'
|
||||
|
||||
|
||||
|
||||
const getLastPage = () => {
|
||||
// getCurrentPages() 至少有1个元素,所以不再额外判断
|
||||
// const lastPage = getCurrentPages().at(-1)
|
||||
@ -228,7 +230,14 @@ export const useUpdateApp = defineStore('updateApp', () => {
|
||||
*/
|
||||
function checkAppUpdate(to = false) {
|
||||
try {
|
||||
upDateAppApi().then(async (res : any) => {
|
||||
let path = ''
|
||||
let webApp = import.meta.env.VITE_WEBAPP
|
||||
console.log(webApp)
|
||||
if(webApp){//如果是测试环境 ,upDateAppApi 传递参数 by min
|
||||
path = webApp
|
||||
}
|
||||
console.log(path)
|
||||
upDateAppApi(path).then(async (res : any) => {
|
||||
let {
|
||||
result
|
||||
} = res
|
||||
|
@ -47,6 +47,7 @@ export default ({ command, mode }) => {
|
||||
VITE_APP_PROXY,
|
||||
VITE_APP_PROXY_PREFIX,
|
||||
VITE_USE_MOCK,
|
||||
WEBAPP
|
||||
} = env
|
||||
console.log('环境变量 env -> ', env)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user