浏览代码

Merge remote-tracking branch 'origin/master'

yuhongqi 4 天之前
父节点
当前提交
cf57396084

+ 25 - 0
.env.prod-cfryt

@@ -0,0 +1,25 @@
+# 页面标题
+VUE_APP_TITLE =赤峰润元堂SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =云联融智互联网医院有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =渝ICP备2024031984号-1
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/kyt.jpg
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=kyt
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 25 - 0
.env.prod-hsyy

@@ -0,0 +1,25 @@
+# 页面标题
+VUE_APP_TITLE =河山医院SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =云联融智互联网医院有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =渝ICP备2024031984号-1
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/kyt.jpg
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=kyt
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 2 - 0
package.json

@@ -8,6 +8,8 @@
     "dev": "vue-cli-service serve",
     "build:prod": "vue-cli-service build",
     "build:prod-ylrz": "vue-cli-service build --mode prod-ylrz",
+    "build:prod-cfryt": "vue-cli-service build --mode prod-cfryt",
+    "build:prod-hsyy": "vue-cli-service build --mode prod-hsyy",
     "build:stage": "vue-cli-service build --mode staging",
     "build:prod-jz": "vue-cli-service build --mode prod-jz",
     "build:prod-hzyy": "vue-cli-service build --mode prod-hzyy",

+ 31 - 0
src/api/login.js

@@ -45,3 +45,34 @@ export function getFirstLogin() {
     method: 'get'
   })
 }
+
+export function getWechatQrCode(data) {
+  return request({
+    url: '/getWechatQrCode',
+    method: 'post',
+    data: data
+  })
+}
+
+export function checkWechatScan(ticket) {
+  return request({
+    url: '/checkWechatScan',
+    method: 'get',
+    params: { ticket }
+  })
+}
+
+//检查是否需要验证码验证
+export function checkIsNeedCheck(username, password, code, uuid) {
+  const data = {
+    username,
+    password,
+    code,
+    uuid
+  }
+  return request({
+    url: '/checkIsNeedCheck',
+    method: 'post',
+    data: data
+  })
+}

+ 17 - 8
src/store/modules/user.js

@@ -1,4 +1,4 @@
-import { login, logout, getInfo } from '@/api/login'
+import { login, logout, getInfo,checkIsNeedCheck } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
 
 const user = {
@@ -40,13 +40,22 @@ const user = {
       const code = userInfo.code
       const uuid = userInfo.uuid
       return new Promise((resolve, reject) => {
-        login(username, password, code, uuid).then(res => {
-          setToken(res.token)
-          commit('SET_TOKEN', res.token)
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
+        checkIsNeedCheck(username, password, code, uuid).then(resp => {
+          console.log("检查是否需要验证", resp)
+          if (!resp) {
+            // 不需要短信验证,直接登录
+            login(username, password, code, uuid).then(res => {
+              setToken(res.token)
+              commit('SET_TOKEN', res.token)
+              resolve({needSms: false})
+            }).catch(error => {
+              reject(error)
+            })
+          } else {
+            // 需要短信,交给页面去弹窗
+            resolve({ needSms: true })
+          }
+        }).catch(error => reject(error))
       })
     },
 

+ 1 - 0
src/utils/auth.js

@@ -13,3 +13,4 @@ export function setToken(token) {
 export function removeToken() {
   return Cookies.remove(TokenKey)
 }
+

+ 84 - 0
src/views/WechatLoginDialog.vue

@@ -0,0 +1,84 @@
+<!--<template>-->
+<!--  <el-dialog title="微信扫码验证" :visible.sync="visible" width="300px">-->
+<!--    <div class="flex flex-col items-center justify-center">-->
+<!--      &lt;!&ndash; 直接用 qrcode-vue 生成二维码 &ndash;&gt;-->
+<!--      <qrcode-vue :value="qrUrl" :size="200" v-if="qrUrl" />-->
+<!--      <p v-if="status==='waiting'">请使用微信扫码确认</p>-->
+<!--      <p v-if="status==='success'">验证成功,正在跳转...</p>-->
+<!--    </div>-->
+<!--  </el-dialog>-->
+<!--</template>-->
+
+<script>
+import { getWechatQrCode, checkWechatScan } from "@/api/login";
+import QrcodeVue from "qrcode.vue";
+
+export default {
+  name: "WechatLoginDialog",
+  components: { QrcodeVue },
+  props: {
+    visible: Boolean,
+    username: String,
+    redirect: String
+  },
+  data() {
+    return {
+      qrUrl: "",     // 微信扫码登录URL(用来生成二维码内容)
+      ticket: "",
+      status: "waiting",
+      timer: null,
+      errorShown: false
+    };
+  },
+  watch: {
+    visible(newVal) {
+      if (newVal && this.username) this.open(this.username);
+    }
+  },
+  methods: {
+    open(username) {
+      getWechatQrCode({ username }).then(res => {
+        this.ticket = res.data.state;
+        const win = window.open(res.data.url); // 新开窗口扫码
+        this.startPolling(win); // 传入窗口对象
+      });
+    },
+    startPolling(win) {
+      this.timer = setInterval(() => {
+        checkWechatScan(this.ticket)
+          .then(res => {
+            if (res.code === 200 && res.data) {
+              this.status = "success";
+              clearInterval(this.timer);
+              console.log("扫码成功,准备 emit 事件", res.data);
+
+              this.$emit("update:visible", false);
+              this.$emit("loginSuccess", res.data);
+
+              if (win && !win.closed) {
+                win.close(); // 扫码完成后自动关闭窗口
+              }
+            }
+          })
+          .catch(err => {
+            clearInterval(this.timer);
+            this.$emit("update:visible", false);
+
+            if (!this.errorShown) {
+              this.errorShown = true;
+              this.$message.error(err.response?.data?.msg );
+            }
+
+            if (win && !win.closed) {
+              win.close(); // 异常也关闭窗口
+            }
+          });
+      }, 800);
+    }
+
+  },
+  beforeDestroy() {
+    if (this.timer) clearInterval(this.timer);
+  }
+};
+</script>

+ 3 - 3
src/views/company/companyUser/profile/index.vue

@@ -7,9 +7,9 @@
             <span>个人信息</span>
           </div>
           <div>
-<!--            <div class="text-center">-->
-<!--              <userAvatar :user="user" />-->
-<!--            </div>-->
+            <div class="text-center">
+              <userAvatar :user="user" />
+            </div>
             <ul class="list-group list-group-striped">
               <li class="list-group-item">
                 <svg-icon icon-class="user" />用户名称

+ 37 - 5
src/views/login.vue

@@ -71,6 +71,15 @@
       <span>{{companyName}}</span>
       <a :href="icpUrl" target="_bank">{{icpRecord}}</a>
     </div>
+
+    <!-- 微信扫码弹框 -->
+    <WechatLoginDialog
+      ref="wechatDialog"
+      :ticket="loginForm.username"
+      :visible.sync="wechatDialogVisible"
+      @loginSuccess="handleWechatLoginSuccess"
+      :redirect="redirect"
+    />
   </div>
 </template>
 
@@ -79,9 +88,12 @@ import { getCodeImg } from "@/api/login";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from '@/utils/jsencrypt'
 import { getFirstLogin } from "@/api/login";
+import WechatLoginDialog from "@/views/WechatLoginDialog.vue";
+import { setToken } from "@/utils/auth";
 
 export default {
   name: "Login",
+  components: { WechatLoginDialog },
   data() {
     return {
       codeUrl: "",
@@ -90,6 +102,7 @@ export default {
       icpRecord: process.env.VUE_APP_ICP_RECORD,
       icpUrl: process.env.VUE_APP_ICP_URL,
       cookiePassword: "",
+      wechatDialogVisible: false,
       loginForm: {
         username: "",
         password: "",
@@ -180,10 +193,21 @@ export default {
           }
           this.$store
             .dispatch("Login", this.loginForm)
-            .then(() => {
-              // 登录成功后检查是否是首次登录
-              this.checkFirstLogin();
-              //this.$router.push({ path: this.redirect || "/" });
+            .then(res => {
+              if (res.needSms){
+                console.log("打开弹窗")
+                this.wechatDialogVisible = true;
+                // 等 visible 更新后,直接调用弹窗 open()
+                this.$nextTick(() => {
+                  if (this.$refs.wechatDialog) {
+                    this.$refs.wechatDialog.open(this.loginForm.username);
+                  }
+                });
+              } else {
+                // 登录成功后检查是否是首次登录
+                this.checkFirstLogin();
+                //this.$router.push({ path: this.redirect || "/" });
+              }
             })
             .catch(() => {
               this.loading = false;
@@ -199,7 +223,15 @@ export default {
       }else{
         this.passwordtype="text"
       }
-    }
+    },
+    // 微信扫码成功回调
+    handleWechatLoginSuccess(token) {
+      this.loading = false
+      console.log("父组件收到 loginSuccess:", token);
+      this.$store.commit("SET_TOKEN", token);
+      setToken(token);
+      this.$router.push({ path: this.redirect || "/" });
+    },
   }
 };
 </script>

+ 14 - 2
src/views/qw/externalContact/index.vue

@@ -134,7 +134,15 @@
       </el-form-item>
       <el-form-item label="状态" prop="status">
 
-        <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
+<!--        <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">-->
+<!--          <el-option-->
+<!--            v-for="dict in statusOptions"-->
+<!--            :key="dict.dictValue"-->
+<!--            :label="dict.dictLabel"-->
+<!--            :value="dict.dictValue"-->
+<!--          />-->
+<!--        </el-select>-->
+        <el-select v-model="statusMulti" placeholder="状态" clearable size="small" multiple collapse-tags>
           <el-option
             v-for="dict in statusOptions"
             :key="dict.dictValue"
@@ -1126,7 +1134,7 @@ export default {
       },
 
       tagTotal:0,
-
+      statusMulti: [], //状态数组,多选
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1150,6 +1158,7 @@ export default {
         corpId: null,
         companyId: null,
         status:null,
+        statuses: null, // 多选的状态,id拼接,用于传到后端
         transferStatus:null,
         isBind:null,
         isBindMini:null,
@@ -1837,6 +1846,7 @@ export default {
       }
 
       this.queryParams.pageNum = 1;
+      this.queryParams.statuses =this.statusMulti.join(",");
       this.getList();
     },
     handleSearchTags(name){
@@ -1940,6 +1950,8 @@ export default {
 	   this.createTime=null;
 	  this.queryParams.sTime=null;
 	  this.queryParams.eTime=null;
+      this.queryParams.statuses=null;
+      this.statusMulti = [];
       this.handleQuery();
     },
     // 多选框选中数据

+ 3 - 2
src/views/qw/user/cuDeptIdIndex.vue

@@ -843,8 +843,9 @@ export default {
 	handleDelQwIpad(val){
 	  delQwIpad({qwUserId: val.id}).then(res => {
 	    this.$message.success("解绑主机成功");
-		this.getList()
-	  })
+	  }).finally(res => {
+      this.getList();
+    })
 	},
     //传验证码
     handleLoginQwCodeMsg(){

+ 6 - 1
src/views/qw/user/index.vue

@@ -865,6 +865,10 @@ export default {
             this.$message.success('账号企业不一致请重新扫码登录');
             this.clearDl();
           }
+          if (res.msg == 23) {
+            this.$message.success('账号不匹配,请同步信息后重新扫码登录');
+            this.clearDl();
+          }
           if (res.msg == 104001) {
             this.$message.success('登录成功');
             this.clearDl()
@@ -954,7 +958,8 @@ export default {
     handleDelQwIpad(val) {
       delQwIpad({qwUserId: val.id}).then(res => {
         this.$message.success("解绑主机成功");
-        this.getList()
+      }).finally(res => {
+        this.getList();
       })
     },
 

+ 3 - 1
src/views/qw/user/myIndex.vue

@@ -927,9 +927,11 @@ export default {
       });
     },
     handleDelQwIpad(val) {
+
       delQwIpad({qwUserId: val.id}).then(res => {
         this.$message.success("解绑主机成功");
-        this.getList()
+      }).finally(res => {
+        this.getList();
       })
     },