diff --git a/App.vue b/App.vue
index 858e485..ddad388 100644
--- a/App.vue
+++ b/App.vue
@@ -4,7 +4,7 @@ onLaunch(() => {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
- console.log(res.hasUpdate)
+ // console.log(res.hasUpdate)
})
updateManager.onUpdateReady(function () {
diff --git a/pages.json b/pages.json
index 41cf878..5ccf7f1 100644
--- a/pages.json
+++ b/pages.json
@@ -19,8 +19,9 @@
"navigationBarTitleText": "个人中心"
}
},
+
{
- "path": "pages/patient/addTask.vue",
+ "path": "pages/patient/addTask",
"style": {
"navigationBarTitleText": "新增任务"
}
diff --git a/pages/patient/addTask.vue b/pages/patient/addTask.vue
index 940c476..149e150 100644
--- a/pages/patient/addTask.vue
+++ b/pages/patient/addTask.vue
@@ -1,5 +1,7 @@
-
+
+ 新增任务
+
\ No newline at end of file
diff --git a/services/doctoc.js b/services/doctoc.js
new file mode 100644
index 0000000..e69de29
diff --git a/services/patient.js b/services/patient.js
new file mode 100644
index 0000000..068cf21
--- /dev/null
+++ b/services/patient.js
@@ -0,0 +1,8 @@
+import {http} from "@/utils/http.js"
+
+// 获取患者列表
+export const getPatientList = () => {
+ http({
+ url: "/patient"
+ })
+}
\ No newline at end of file
diff --git a/utils/http.js b/utils/http.js
new file mode 100644
index 0000000..23526b3
--- /dev/null
+++ b/utils/http.js
@@ -0,0 +1,65 @@
+import {} from "@/store"
+
+const baseURL = "http://192.168.0.180:3000"
+import { useUserStore } from '@/store';
+
+// 请求拦截器配置
+const httpInterceptor = {
+ invoke(options) {
+ // 拼接请求地址
+ options.url = baseURL + options.url
+ console.log(111, options);
+ // 请求超时
+ options.timeout = 5000
+
+ // 添加 token 请求头标识
+ // const useUser = useUserStore()
+ // const token = useUser
+ // if (token) {
+ // options.header.Authorization = token
+ // }
+ },
+}
+
+// 拦截 request 请求
+uni.addInterceptor("request", httpInterceptor)
+
+/*
+ 请求函数
+*/
+export const http = (options) => {
+ return new Promise((resolve, reject) => {
+ uni.request({
+ ...options,
+ // 响应成功
+ success(res) {
+ // 请求成功
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ //提取数据
+ resolve(res.data)
+ } else if (res.statusCode === 401) {
+ // 401错误,清理用户信息,跳转到登录页
+ const memberStore = useMemberStore()
+ memberStore.clearProfile()
+ uni.navigateTo({ url: '/pages/login/login' })
+ reject(res)
+ } else {
+ // 其他错误,根据后端错误信息轻提示
+ uni.showToast({
+ icon: 'none',
+ title: (res.data).msg || '请求错误',
+ })
+ reject(res)
+ }
+ },
+ // 响应失败
+ fail(err) {
+ uni.showToast({
+ icon: 'none',
+ title: '网络错误',
+ })
+ reject(err)
+ },
+ })
+ })
+}
\ No newline at end of file