Parcourir la source

fix: 修改登录

wuguojie il y a 1 an
Parent
commit
73604869f1
3 fichiers modifiés avec 12 ajouts et 6 suppressions
  1. 3 3
      .env.development
  2. 2 2
      src/store/modules/user.ts
  3. 7 1
      src/views/insurancePolicy/index.vue

+ 3 - 3
.env.development

@@ -4,10 +4,10 @@ VITE_APP_SETTING = true
 VITE_APP_TITLE = 租户平台
 # 接口请求地址,会设置到 axios 的 baseURL 参数上
 # VITE_APP_API_BASEURL = https://test.baoxianzhanggui.com/web-api #默认地址
-# VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
+VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
 # VITE_APP_API_BASEURL = http://192.168.0.55:8001  #董鑫
-VITE_APP_API_BASEURL = http://192.168.0.106:8001  #屈晨
-#VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
+# VITE_APP_API_BASEURL = http://192.168.0.106:8001  #屈晨
+# VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
 
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
 VITE_APP_DEBUG_TOOL =

+ 2 - 2
src/store/modules/user.ts

@@ -36,9 +36,9 @@ const useUserStore = defineStore(
       const res = await api.userApi.login(data)
 
       localStorage.setItem('userName', data.userName)
-      localStorage.setItem('token', res.data)
+      localStorage.setItem('token', res.data.token)
       userName.value = data.userName
-      token.value = res.data
+      token.value = res.data.token
       avatar.value = 'https://fantastic-admin.hurui.me/logo.png'
       const result = await api.userApi.getCurUserInfo()
       localStorage.setItem('userDeptId', result.data.deptId)

+ 7 - 1
src/views/insurancePolicy/index.vue

@@ -1141,7 +1141,7 @@
     </el-form>
     <div class="footer">
       <span>已选保司:{{ currentRow.length }}家</span>
-      <el-button type="primary" @click="handleSubmit(InsurancePolicyRefs)">确定</el-button>
+      <el-button type="primary" :loading="loading" @click="handleSubmit(InsurancePolicyRefs)">确定</el-button>
     </div>
     <el-dialog
       title="选择业务员"
@@ -1983,6 +1983,8 @@ const handleRecognition = () => {
   imageShow.value = true
 }
 
+// 提交
+let loading = ref(false)
 const handleSubmit = async (InsurancePolicyRefs: FormInstance | undefined) => {
   if(!InsurancePolicyRefs) {
     InsurancePolicyRefs?.resetFields()
@@ -1990,6 +1992,7 @@ const handleSubmit = async (InsurancePolicyRefs: FormInstance | undefined) => {
   }
   await InsurancePolicyRefs.validate((valid) => {
     if(valid) {
+      loading.value = true
       let arr = [], brr = []
       if(quoteData.value.length>0) {
         let obj = quoteData.value.find(a => a.id === insurancePolicyForm.value.order.insuranceCompanyCode)
@@ -2090,11 +2093,14 @@ const handleSubmit = async (InsurancePolicyRefs: FormInstance | undefined) => {
             message: res.msg,
             type: 'success'
           })
+          quoteData.value[drivingRow.value].quoteResult = res.data
+          loading.value = false
         } else {
           ElMessage({
             message: res.msg,
             type: 'warning'
           })
+          loading.value = false
         }
         // InsurancePolicyRefs.resetFields()
       })