浏览代码

Merge branch 'master' of https://code.dashoo.cn/dashoo/labsop_h5

LYK 2 周之前
父节点
当前提交
a46c708b1c

+ 2 - 1
src/api/login/index.ts

@@ -23,7 +23,8 @@ export function useLoginApi() {
       return request.postRequest(basePath, 'System', 'Logout', query)
     },
     WeChatUnBindOpenId: (query?: object) => {
-      return request.postRequest(basePath, 'System', 'WeChatUnBindOpenId', query)
+      return request.postRequestWithClientInfo(basePath, 'System', 'UnbindWeChatUnIdOpenIdByUser', query)
+      // return request.postRequest(basePath, 'System', 'WeChatUnBindOpenId', query)
     },
     getCaptchaImg: (query?: object) => {
       return request.postRequest(basePath, 'System', 'GetCaptchaImg', query)

+ 3 - 0
src/stores/userInfo.ts

@@ -139,9 +139,11 @@ export const useUserInfo = defineStore('userInfo', {
       })
     },
     async setOpenId(code: string) {
+      
       if(this.openIdFlag || this.openId) return
       const openId = localStorage.getItem('openId')
       const unionId = localStorage.getItem('unionId')
+  
       if(openId && unionId) {
         this.openId = openId
         this.unionId = unionId
@@ -155,6 +157,7 @@ export const useUserInfo = defineStore('userInfo', {
       }
       this.openId = res?.data?.openid || ''
       this.unionId = res?.data?.unionid || ''
+
       localStorage.setItem('openId', this.openId)
       localStorage.setItem('unionId', this.unionId)
       this.openIdFlag = false

+ 3 - 1
src/view/animal/application/components/Detail.vue

@@ -291,7 +291,9 @@ const levelName = computed(() => {
       ethicsCheckFile: res?.data?.ethicsCheckFile ? JSON.parse(res?.data?.ethicsCheckFile) : [],
       ethicsAdviceFile: res?.data?.ethicsAdviceFile ? JSON.parse(res?.data?.ethicsAdviceFile) : [],
       geneIdentificationFile: res?.data?.geneIdentificationFile ? JSON.parse(res?.data?.geneIdentificationFile) : [],
-      totalNumber: res?.data?.maleNumber + res?.data?.famaleNumber
+      totalNumber: res?.data?.maleNumber + res?.data?.famaleNumber,
+      startDate: dayjs(res?.data?.createdTime).format('YYYY-MM-DD'),
+      comeTime: dayjs(res?.data?.comeTime).format('YYYY-MM-DD'),
     }
 
   }

+ 5 - 4
src/view/todo/component/plat_cage_applications.vue

@@ -59,10 +59,11 @@
         title="饲养总天数"
         :value="state.form.feedingDay"
       />
-      <van-cell
-        title="动物到达时间"
-        :value="state.form.comeTime"
-      />
+      <van-cell title="动物到达时间">
+        <template #value>
+          <span>{{ dayjs(state.form.comeTime).format('YYYY-MM-DD') }}</span>
+        </template>
+      </van-cell>
       <van-cell
         title="是否有特殊饲养要求"
         :value="checkSpecialFeedingRequirements"

+ 17 - 8
src/view/user/index.vue

@@ -114,7 +114,7 @@
 import { ref, onMounted } from 'vue'
 import { storeToRefs } from 'pinia'
 import to from 'await-to-js'
-import { showConfirmDialog, showToast } from 'vant'
+import { showConfirmDialog, showDialog, showToast } from 'vant'
 import { useRouter } from 'vue-router'
 
 import { useUserInfo } from '/@/stores/userInfo'
@@ -176,24 +176,33 @@ const signOut = () => {
   showConfirmDialog({
     message: '确认切换账号?',
   }).then(async () => {
-    // 如果有 openId,先解绑微信
-    // if (openId.value) {
-    //   await to(loginApi.WeChatUnBindOpenId({ openId: openId.value }))
-    // }
+    // 先解绑微信
+    const [unbindErr]: ToResponse = await to(
+      loginApi.WeChatUnBindOpenId()
+    )
+    // 解绑失败则终止流程
+    if (unbindErr) {
+      showToast('解绑失败,请重试')
+      return
+    }
 
     // 调用退出登录接口
     const [err]: ToResponse = await to(loginApi.signOut())
-    if (err) return
+    if (err) {
+      showToast('退出登录失败,请重试')
+      return
+    }
 
     // 清理所有本地缓存
     Local.clear()
     Session.clear()
+
     // 重置用户信息
     storesUseUserInfo.resetUserInfo()
     // 关闭窗口
-    // wx.closeWindow()
+    wx.closeWindow()
     // 跳转登录重新走授权
-    router.replace('/login')
+    // router.replace('/login')
   })
 }
 const handleSubscribe = (errMsg: any, subscribeDetails: any) => {