From a6245b29cd2d059cb31d9bcbe8d6eccb715abf3a Mon Sep 17 00:00:00 2001
From: liyuanchao <438964165@qq.com>
Date: Sun, 14 Sep 2025 17:43:16 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 103 ++++++++++++++++++++++++++++++++--
main.js | 2 +
manifest.json | 19 ++-----
pages/sys/login/login.vue | 43 +++++++-------
pages/sys/user/mine.vue | 5 +-
utils/notify.js | 15 +++++
utils/websocket.js | 115 ++++++++++++++++++++++++++++++++++++++
7 files changed, 260 insertions(+), 42 deletions(-)
create mode 100644 utils/notify.js
create mode 100644 utils/websocket.js
diff --git a/App.vue b/App.vue
index a42b0c1..7d3aa5f 100644
--- a/App.vue
+++ b/App.vue
@@ -1,4 +1,11 @@
diff --git a/main.js b/main.js
index 81f03c5..b2fd4f3 100644
--- a/main.js
+++ b/main.js
@@ -3,7 +3,9 @@
*/
import Vue from 'vue';
import App from './App';
+import ws from '@/utils/websocket.js'
+Vue.prototype.$ws = ws
Vue.config.productionTip = false;
App.mpType = 'app';
diff --git a/manifest.json b/manifest.json
index 06aa6ed..b6d7c15 100644
--- a/manifest.json
+++ b/manifest.json
@@ -28,8 +28,7 @@
"modules" : {
"Payment" : {},
"Camera" : {},
- "Barcode" : {},
- "Push" : {}
+ "Barcode" : {}
},
"distribute" : {
"android" : {
@@ -54,7 +53,8 @@
"",
"",
"",
- ""
+ "",
+ ""
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
},
@@ -74,18 +74,7 @@
},
"appleiap" : {}
},
- "push" : {
- "unipush" : {
- "version" : "2",
- "offline" : true,
- "honor" : {},
- "meizu" : {},
- "mi" : {},
- "vivo" : {},
- "oppo" : {},
- "hms" : {}
- }
- }
+ "push" : {}
},
"icons" : {
"android" : {
diff --git a/pages/sys/login/login.vue b/pages/sys/login/login.vue
index 9cf7ccd..2ebcb8d 100644
--- a/pages/sys/login/login.vue
+++ b/pages/sys/login/login.vue
@@ -14,7 +14,7 @@
-
+
@@ -57,9 +57,9 @@
activeColor: '#007aff',
checked: false
}
- },
- onLoad() {
- this.getUserInfo()
+ },
+ onLoad() {
+ this.getUserInfo()
},
methods: {
async submit() {
@@ -85,27 +85,30 @@
this.$store.commit('$uStore', {
name: 'vuex_token',
value: res.data.access_token
- });
+ });
this.getUserInfo()
// setTimeout(() => {
- // uni.reLaunch({
- // url: '/pages/sys/home/home'
- // });
+ // uni.reLaunch({
+ // url: '/pages/sys/home/home'
+ // });
// }, 500);
}
},
- getUserInfo(){
- this.$u.api.getUserInfo({loginCheck: true}).then(res => {
- if (res.code == '200'){
- this.$store.commit('$uStore', {
- name: 'vuex_user',
- value: res.data.user
- });
- uni.reLaunch({
- url: '/pages/sys/home/home'
- });
- }
- });
+ getUserInfo() {
+ this.$u.api.getUserInfo({
+ loginCheck: true
+ }).then(res => {
+ if (res.code == '200') {
+ this.$store.commit('$uStore', {
+ name: 'vuex_user',
+ value: res.data.user
+ });
+ uni.$emit("loginSuccess");
+ uni.reLaunch({
+ url: '/pages/sys/home/home'
+ });
+ }
+ });
},
handleCheckboxChange(e) {
this.checked = e.target.checked;
diff --git a/pages/sys/user/mine.vue b/pages/sys/user/mine.vue
index a3a6ab4..364bc01 100644
--- a/pages/sys/user/mine.vue
+++ b/pages/sys/user/mine.vue
@@ -31,7 +31,8 @@
-