修改 离线插件
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
|
||||
#调用后台地址
|
||||
# VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
||||
VITE_APP_BASE_URL = 'https://app-test.718yousheng.com'
|
||||
# 公司
|
||||
VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
||||
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
|
||||
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
|
||||
|
||||
# 友晟外网
|
||||
# VITE_APP_BASE_URL = 'https://app-test.718yousheng.com'
|
||||
# 友晟内网
|
||||
# VITE_APP_BASE_URL = 'https://appi-test.718yousheng.com'
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
|
||||
#调用后台地址
|
||||
VITE_APP_BASE_URL = 'https://app-test.718yousheng.com'
|
||||
# 公司
|
||||
# VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
||||
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
|
||||
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
|
||||
|
||||
# 友晟外网
|
||||
VITE_APP_BASE_URL = 'https://app-test.718yousheng.com'
|
||||
# 友晟内网
|
||||
# VITE_APP_BASE_URL = 'https://appi-test.718yousheng.com'
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@ pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.hbuilderx
|
||||
.DS_Store
|
||||
dist
|
||||
*.local
|
||||
|
||||
@@ -4,6 +4,16 @@
|
||||
{
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"app" : {
|
||||
"launchtype" : "remote"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"provider" : "aliyun",
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
33
src/App.vue
33
src/App.vue
@@ -4,16 +4,39 @@
|
||||
|
||||
|
||||
<script setup>
|
||||
// import { onLaunch } from '@dcloudio/uni-app';
|
||||
// onLaunch((opt) => {
|
||||
// console.log("onLaunch")
|
||||
|
||||
import {showAlert} from '@/utils/message.js'
|
||||
import { onLaunch } from '@dcloudio/uni-app';
|
||||
onLaunch((opt) => {
|
||||
// uni.preloadPage({ url: "/pages/login/login" });
|
||||
// uni.preloadPage({ url: "/pages/home/home" });
|
||||
// uni.preloadPage({ url: "/pages/business/business" });
|
||||
// uni.preloadPage({ url: "/pages/notice/notice" });
|
||||
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
|
||||
// })
|
||||
console.log("APP onLaunch")
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
let push_clientid = res.cid
|
||||
console.log('客户端推送标识:', push_clientid);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
|
||||
uni.onPushMessage(res => {
|
||||
console.log("收到推送消息:", res) //监听推送消息
|
||||
showAlert(JSON.stringify(res))
|
||||
uni.createPushMessage({
|
||||
title: res.data.title,
|
||||
content: res.data.content,
|
||||
payload: res.data.payload
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
"modules" : {
|
||||
"Push" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
@@ -41,17 +43,31 @@
|
||||
"<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\"/>"
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.INTERNET\" />",
|
||||
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
|
||||
"<uses-permission android:name=\"android.permission.GET_TASKS\" />",
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
|
||||
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_ADDED\" />",
|
||||
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_CHANGED\" />",
|
||||
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_INSTALL\" />",
|
||||
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_REPLACED\" />",
|
||||
"<uses-permission android:name=\"android.permission.RESTART_PACKAGES\" />",
|
||||
"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />"
|
||||
],
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
|
||||
"minSdkVersion" : 26,
|
||||
"targetSdkVersion" : 35,
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "static/icons/72x72.png",
|
||||
"xhdpi" : "static/icons/96x96.png",
|
||||
"xxhdpi" : "static/icons/144x144.png",
|
||||
"xxxhdpi" : "static/icons/192x192.png"
|
||||
"hdpi" : "/static/images/icon.png",
|
||||
"xhdpi" : "/static/images/icon.png",
|
||||
"xxhdpi" : "/static/images/icon.png",
|
||||
"xxxhdpi" : "/static/images/icon.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -60,7 +76,23 @@
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
"sdkConfigs" : {
|
||||
"push" : {
|
||||
"unipush" : {
|
||||
"version" : "2",
|
||||
"offline" : true,
|
||||
"icons" : {
|
||||
"small" : {
|
||||
"ldpi" : "/static/images/icon.png",
|
||||
"mdpi" : "/static/images/icon.png",
|
||||
"hdpi" : "/static/images/icon.png",
|
||||
"xhdpi" : "/static/images/icon.png",
|
||||
"xxhdpi" : "/static/images/icon.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"Tm-TmSafeSaveFileModule" : {
|
||||
|
||||
@@ -134,6 +134,7 @@ const selectDeviceId = async()=>{
|
||||
// 查询本地缓存的设备状态是否绑定过
|
||||
// let deviceId = uni.getStorageSync('app_device_id');// 本地设备ID
|
||||
try {
|
||||
// showAlert("safeSave=>"+safeSave)
|
||||
safeSave.getSafeFile({ "key": "app_device_id" }, res2 => {
|
||||
// showAlert(JSON.stringify(res2));
|
||||
if (res2.code == 1) {
|
||||
@@ -177,7 +178,7 @@ const selectDeviceId = async()=>{
|
||||
})
|
||||
} catch (error) {
|
||||
console.log("getSafeFile=>",error)
|
||||
showAlert(error)
|
||||
// showAlert("getSafeFile=>"+error)
|
||||
}
|
||||
}
|
||||
// 下载最新版本
|
||||
|
||||
@@ -264,9 +264,9 @@ const submitForm = () => {
|
||||
|
||||
// #ifdef H5
|
||||
//h5测试用 内网-sn123456
|
||||
//公司外网 '9516053c-b441-465b-9781-06e7b8031811'
|
||||
//公司外网 'd5aa6eaf-fff7-4009-bf7e-60e4b3dc4f40'
|
||||
//友晟外网 'b97527c8-2ad4-493c-a01c-5f9d0aabaff2'
|
||||
param.uniqCode = 'b97527c8-2ad4-493c-a01c-5f9d0aabaff2';
|
||||
param.uniqCode = 'd5aa6eaf-fff7-4009-bf7e-60e4b3dc4f40';
|
||||
let res = await login(param);
|
||||
userStore.login(res);
|
||||
uni.switchTab({ url: '/pages/home/home' })
|
||||
@@ -278,7 +278,7 @@ const submitForm = () => {
|
||||
// 读取设备ID
|
||||
safeSave.getSafeFile({ "key": "app_device_id" }, res3 => {
|
||||
if (res3.code == 1) {
|
||||
let deviceId = res3.data;//'b97527c8-2ad4-493c-a01c-5f9d0aabaff2' //
|
||||
let deviceId = res3.data;
|
||||
// showAlert("读取成功=>"+deviceId);
|
||||
param.uniqCode = deviceId;
|
||||
console.log("param=>",param)
|
||||
|
||||
@@ -60,7 +60,10 @@ const requestHooks = {
|
||||
return Promise.reject();
|
||||
|
||||
default:
|
||||
if(msg)
|
||||
message.alert(msg)
|
||||
else
|
||||
message.alert("网络连接失败,请稍后再试!")
|
||||
// return data;
|
||||
return Promise.reject(msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user