diff --git a/main.js b/main.js
index 9d0e354..105595c 100644
--- a/main.js
+++ b/main.js
@@ -1,16 +1,4 @@
import App from './App'
-// // #ifndef VUE3
-// import Vue from 'vue'
-// import './uni.promisify.adaptor'
-// Vue.config.productionTip = false
-// App.mpType = 'app'
-// const app = new Vue({
-// ...App
-// })
-// app.$mount()
-// // #endif
-
-// // #ifdef VUE3
import { createSSRApp } from 'vue'
import pinia from './store'
export function createApp() {
@@ -19,5 +7,4 @@ export function createApp() {
return {
app
}
-}
-// #endif
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index b8b4eff..e06d58f 100644
--- a/package.json
+++ b/package.json
@@ -3,5 +3,8 @@
"pinia": "^3.0.4",
"pinia-plugin-persistedstate": "^4.7.1",
"wot-design-uni": "^1.13.0"
+ },
+ "devDependencies": {
+ "vue": "^3.5.26"
}
}
diff --git a/pages.json b/pages.json
index 7aeddbd..fe3fd9e 100644
--- a/pages.json
+++ b/pages.json
@@ -7,17 +7,17 @@
},
"pages": [
- {
- "path": "pages/patient/patient",
- "style": {
- "navigationBarTitleText": "患者列表"
- }
- },
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "个人中心"
}
+ },
+ {
+ "path": "pages/patient/patient",
+ "style": {
+ "navigationBarTitleText": "患者列表"
+ }
}
],
"globalStyle": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index fb6e625..56ddfdc 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,6 +1,10 @@
-
-
-
-
-
-
-
-
- 南方医科大学珠江医院
- 李玉华
-
+
+
+
+
+
+
+
+ 南方医科大学珠江医院
+ 李玉华
+
+
+
+
+
+
+
+ 立即登录
+
+
+
+
+
+ 暂不登录
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a31e7bb..bd9f7a7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -17,6 +17,10 @@ importers:
wot-design-uni:
specifier: ^1.13.0
version: 1.13.0(vue@3.5.26)
+ devDependencies:
+ vue:
+ specifier: ^3.5.26
+ version: 3.5.26
packages:
diff --git a/store/index.js b/store/index.js
index 537d55d..e30bfae 100644
--- a/store/index.js
+++ b/store/index.js
@@ -6,5 +6,5 @@ const pinia = createPinia()
// 使用持久化存储插件
pinia.use(piniaPersist)
-// 默认导出,给 main.ts 使用
-export default pinia
\ No newline at end of file
+export default pinia
+export * from './modules/user'
\ No newline at end of file
diff --git a/store/modules/user.js b/store/modules/user.js
new file mode 100644
index 0000000..97ff471
--- /dev/null
+++ b/store/modules/user.js
@@ -0,0 +1,34 @@
+import { defineStore } from "pinia";
+import { ref, computed} from "vue";
+export const useUserStore = defineStore(
+ "user",
+ () => {
+ const isLogin = computed(() => Boolean(userInfo.value));
+ let userInfo = ref(null);
+ const setUserInfo = (newPhone) => {
+ userInfo.value = newPhone;
+ };
+ const logOut = () => {
+ userInfo.value = null;
+ }
+ return {
+ isLogin,
+ userInfo,
+ setUserInfo,
+ logOut
+ };
+ },
+ {
+ // 小程序端配置持久化
+ persist: {
+ storage: {
+ getItem(key) {
+ return uni.getStorageSync(key);
+ },
+ setItem(key, value) {
+ uni.setStorageSync(key, value);
+ },
+ },
+ },
+ }
+);