From c84cf055ef60a5afa18522264390564093f42a44 Mon Sep 17 00:00:00 2001 From: hrx <18603305412@163.com> Date: Fri, 24 Apr 2026 11:22:01 +0800 Subject: [PATCH 1/7] updata --- f/web-kboss/src/views/login/indexNew.vue | 555 +++++++++-------------- 1 file changed, 206 insertions(+), 349 deletions(-) diff --git a/f/web-kboss/src/views/login/indexNew.vue b/f/web-kboss/src/views/login/indexNew.vue index 0686721..7bb2e5d 100644 --- a/f/web-kboss/src/views/login/indexNew.vue +++ b/f/web-kboss/src/views/login/indexNew.vue @@ -42,103 +42,83 @@
- -
- 账号登录 - 手机号登录 -
+ - - - -
@@ -178,12 +180,12 @@ import { getCodeAPI, // 获取验证码API getLogoAPI, // 获取Logo信息API - getPasswordCodeAPI, // 重置密码API + // getPasswordCodeAPI, // 重置密码API logintypeAPI, // 登录类型API loginUserAPI, // 用户登录API reqGetAppidAPI, // 获取微信AppID API reqGetCodeAPI, // 获取微信授权码API - retrieveCodeAPI, // 获取重置密码验证码API, + // retrieveCodeAPI, // 获取重置密码验证码API, } from "@/api/login"; import store from "@/store"; @@ -222,22 +224,15 @@ export default { // 验证码相关 SendCode_text: "获取验证码", // 手机登录验证码按钮文本 - SendCode_text1: "获取验证码", // 重置密码验证码按钮文本 isDisabled: false, // 手机登录验证码按钮是否禁用 - isDisabled1: false, // 重置密码验证码按钮是否禁用 time_count: 60, // 手机登录验证码倒计时 - time_count1: 60, // 重置密码验证码倒计时 timer: null, // 手机登录验证码定时器 - timer1: null, // 重置密码验证码定时器 // 防抖相关 isGettingCode: false, // 是否正在获取验证码 - isGettingCode1: false, // 是否正在获取重置密码验证码 debounceTimer: null, // 防抖定时器 - debounceTimer1: null, // 重置密码防抖定时器 // 对话框和加载状态 - dialogVisible: false, // 重置密码对话框是否可见 loading: false, // 登录按钮加载状态 // 登录表单数据 @@ -266,21 +261,20 @@ export default { capsTooltip: false, passwordType: "password", // 密码输入框类型:password或text - // 重置密码表单数据 - form: { - username: "", // 用户名 - vcode: "", // 验证码 - password: "", // 新密码 - id: "", // 用户ID - codeid: "", // 验证码ID - }, + // 重置密码相关暂时注释 + // form: { + // username: "", // 用户名 + // vcode: "", // 验证码 + // password: "", // 新密码 + // id: "", // 用户ID + // codeid: "", // 验证码ID + // }, - // 重置密码表单验证规则 - forms: { - username: [{ required: true, message: "请输入姓名", trigger: "blur" }], - password: [{ required: true, message: "请输入密码", trigger: "blur" }], - vcode: [{ required: true, message: "请输入验证码", trigger: "blur" }], - }, + // forms: { + // username: [{ required: true, message: "请输入姓名", trigger: "blur" }], + // password: [{ required: true, message: "请输入密码", trigger: "blur" }], + // vcode: [{ required: true, message: "请输入验证码", trigger: "blur" }], + // }, // Logo显示控制 isLogo: false, @@ -331,7 +325,6 @@ export default { beforeDestroy() { // 组件销毁前清理定时器和事件监听 clearInterval(this.timer) - clearInterval(this.timer1) clearInterval(this.getCodeTimer) window.removeEventListener('keydown', this.handleEnter); @@ -384,21 +377,19 @@ export default { }, 300); }, - // 防抖后的获取重置密码验证码方法 - debouncedGetCode1: function () { - if (this.isDisabled1 || this.isGettingCode1) return; - - this.isGettingCode1 = true; - - // 清除之前的定时器 - clearTimeout(this.debounceTimer1); - - // 设置新的定时器,300ms后执行 - this.debounceTimer1 = setTimeout(() => { - this.getCode1(); - this.isGettingCode1 = false; - }, 300); - }, + // 重置密码相关方法暂时注释 + // debouncedGetCode1: function () { + // if (this.isDisabled1 || this.isGettingCode1) return; + // + // this.isGettingCode1 = true; + // + // clearTimeout(this.debounceTimer1); + // + // this.debounceTimer1 = setTimeout(() => { + // this.getCode1(); + // this.isGettingCode1 = false; + // }, 300); + // }, // 跳转到百度产品页面 goBaidu(listUrl, url) { @@ -753,56 +744,53 @@ export default { }); }, - // 获取重置密码验证码 - getCode1() { - // 验证手机号格式 - if (!this.form.username || !/^1[3-9]\d{9}$/.test(this.form.username)) { - this.$message.error('请输入正确的手机号'); - return; - } - - // 使用新的API参数:mobile和action_type - retrieveCodeAPI({ - mobile: this.form.username, - action_type: 'login' - }).then((res) => { - if (res.status == true) { - this.form.id = res.userid; - this.form.codeid = res.codeid; - let that = this; - this.time_count1 = 59; - this.isDisabled1 = true; - this.SendCode_text1 = "重新发送" + this.time_count1 + "s"; - - if (!that.timer1) { - that.timer1 = setInterval(() => { - if (that.time_count1 > 0) { - that.time_count1--; - that.SendCode_text1 = "重新发送" + that.time_count1 + "s"; - } else { - that.SendCode_text1 = "获取验证码"; - clearInterval(that.timer1); - that.timer1 = null; - this.isDisabled1 = false; - that.time_count1 = 60; - } - }, 1000); - } - this.$message({ - message: "验证码已发送,请注意查收。", - type: "success", - }); - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }).catch(error => { - this.isGettingCode1 = false; - this.$message.error('验证码获取失败'); - }); - }, + // getCode1() { + // if (!this.form.username || !/^1[3-9]\d{9}$/.test(this.form.username)) { + // this.$message.error('请输入正确的手机号'); + // return; + // } + // + // retrieveCodeAPI({ + // mobile: this.form.username, + // action_type: 'login' + // }).then((res) => { + // if (res.status == true) { + // this.form.id = res.userid; + // this.form.codeid = res.codeid; + // let that = this; + // this.time_count1 = 59; + // this.isDisabled1 = true; + // this.SendCode_text1 = "重新发送" + this.time_count1 + "s"; + // + // if (!that.timer1) { + // that.timer1 = setInterval(() => { + // if (that.time_count1 > 0) { + // that.time_count1--; + // that.SendCode_text1 = "重新发送" + that.time_count1 + "s"; + // } else { + // that.SendCode_text1 = "获取验证码"; + // clearInterval(that.timer1); + // that.timer1 = null; + // this.isDisabled1 = false; + // that.time_count1 = 60; + // } + // }, 1000); + // } + // this.$message({ + // message: "验证码已发送,请注意查收。", + // type: "success", + // }); + // } else { + // this.$message({ + // message: res.msg, + // type: "error", + // }); + // } + // }).catch(error => { + // this.isGettingCode1 = false; + // this.$message.error('验证码获取失败'); + // }); + // }, // 标签页点击事件 handleClick(tab, event) { @@ -939,11 +927,10 @@ export default { }); }, - // 打开重置密码对话框 - resetPassword() { - this.dialogVisible = true; - this.$refs.loginForm.resetFields(); - }, + // resetPassword() { + // this.dialogVisible = true; + // this.$refs.loginForm.resetFields(); + // }, // 跳转到注册页面 handleRegister() { @@ -951,41 +938,39 @@ export default { this.$router.push({ name: "registrationPage" }); }, - // 取消重置密码 - cancelReset() { - this.dialogVisible = false; - this.$refs.form.resetFields(); - }, + // cancelReset() { + // this.dialogVisible = false; + // this.$refs.form.resetFields(); + // }, - // 提交重置密码 - handleSubmit() { - let parmas = { - id: this.form.id, - password: this.form.password, - codeid: this.form.codeid, - vcode: this.form.vcode, - }; - getPasswordCodeAPI(parmas).then((res) => { - if (res.status == true) { - this.$message({ - message: "密码重置成功", - type: "success", - }); - this.isDisabled1 = false; - this.dialogVisible = false; - this.SendCode_text1 = "获取验证码"; - clearInterval(this.timer1); - this.timer1 = null; - this.time_count1 = 60; - this.$refs.form.resetFields(); - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }); - }, + // handleSubmit() { + // let parmas = { + // id: this.form.id, + // password: this.form.password, + // codeid: this.form.codeid, + // vcode: this.form.vcode, + // }; + // getPasswordCodeAPI(parmas).then((res) => { + // if (res.status == true) { + // this.$message({ + // message: "密码重置成功", + // type: "success", + // }); + // this.isDisabled1 = false; + // this.dialogVisible = false; + // this.SendCode_text1 = "获取验证码"; + // clearInterval(this.timer1); + // this.timer1 = null; + // this.time_count1 = 60; + // this.$refs.form.resetFields(); + // } else { + // this.$message({ + // message: res.msg, + // type: "error", + // }); + // } + // }); + // }, } } -- 2.34.1 From 22204bedec29466a447bec47e64af2f98e09c0d4 Mon Sep 17 00:00:00 2001 From: hrx <18603305412@163.com> Date: Mon, 27 Apr 2026 10:27:48 +0800 Subject: [PATCH 5/7] updata --- .../homePage/components/topBox/index.vue | 103 +++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/f/web-kboss/src/views/homePage/components/topBox/index.vue b/f/web-kboss/src/views/homePage/components/topBox/index.vue index ee7f21a..0ab83fb 100644 --- a/f/web-kboss/src/views/homePage/components/topBox/index.vue +++ b/f/web-kboss/src/views/homePage/components/topBox/index.vue @@ -160,8 +160,13 @@ -
-
+
+
有问题,找开元 @@ -260,6 +265,15 @@ export default Vue.extend({ aiInput: '', aiLoading: false, aiMessages: [], + aiPanelPosition: { + left: null, + top: null + }, + aiPanelDragging: false, + aiPanelDragOffset: { + x: 0, + y: 0 + }, aiQuickQuestions: [ '推荐适合训练大模型的 GPU 服务器', '4090 和 A100 怎么选', @@ -308,6 +322,9 @@ export default Vue.extend({ } }); }, + beforeDestroy() { + this.stopAIPanelDrag() + }, computed: { ...mapGetters(["sidebar", "avatar", "device"]), ...mapState({ @@ -342,6 +359,18 @@ export default Vue.extend({ } else { return this.$route.path.includes('/homePage/index'); } + }, + aiPanelStyle() { + if (this.aiPanelPosition.left === null || this.aiPanelPosition.top === null) { + return {} + } + + return { + left: `${this.aiPanelPosition.left}px`, + top: `${this.aiPanelPosition.top}px`, + right: 'auto', + bottom: 'auto' + } } }, methods: { @@ -350,12 +379,14 @@ export default Vue.extend({ handleAIClick() { this.aiDialogVisible = true this.$nextTick(() => { + this.initAIPanelPosition() this.scrollAIChatToBottom() }) }, closeAIPanel() { this.aiDialogVisible = false + this.stopAIPanelDrag() }, resetAIChat() { @@ -367,6 +398,73 @@ export default Vue.extend({ this.sendAIMessage(question) }, + initAIPanelPosition() { + if (this.aiPanelPosition.left !== null && this.aiPanelPosition.top !== null) { + return + } + + const panel = this.$refs.aiChatPanel + if (!panel) return + + const panelWidth = panel.offsetWidth || 380 + const panelHeight = panel.offsetHeight || 620 + + this.aiPanelPosition = { + left: Math.max(window.innerWidth - panelWidth - 24, 16), + top: Math.max(window.innerHeight - panelHeight - 24, 16) + } + }, + + startAIPanelDrag(event) { + if (event.button !== 0) return + if (event.target && event.target.closest('.ai-chat-panel__close')) { + return + } + + const panel = this.$refs.aiChatPanel + if (!panel) return + + const rect = panel.getBoundingClientRect() + this.aiPanelDragging = true + this.aiPanelDragOffset = { + x: event.clientX - rect.left, + y: event.clientY - rect.top + } + + window.addEventListener('mousemove', this.handleAIPanelDrag) + window.addEventListener('mouseup', this.stopAIPanelDrag) + document.body.style.userSelect = 'none' + }, + + handleAIPanelDrag(event) { + if (!this.aiPanelDragging) return + + const panel = this.$refs.aiChatPanel + if (!panel) return + + const panelWidth = panel.offsetWidth || 380 + const panelHeight = panel.offsetHeight || 620 + const minLeft = 0 + const minTop = 0 + const maxLeft = Math.max(window.innerWidth - panelWidth, 0) + const maxTop = Math.max(window.innerHeight - panelHeight, 0) + + const nextLeft = event.clientX - this.aiPanelDragOffset.x + const nextTop = event.clientY - this.aiPanelDragOffset.y + + this.aiPanelPosition = { + left: Math.min(Math.max(nextLeft, minLeft), maxLeft), + top: Math.min(Math.max(nextTop, minTop), maxTop) + } + }, + + stopAIPanelDrag() { + this.aiPanelDragging = false + window.removeEventListener('mousemove', this.handleAIPanelDrag) + window.removeEventListener('mouseup', this.stopAIPanelDrag) + document.body.style.userSelect = '' + }, + handleAIKeydown(event) { if (event.key === 'Enter' && !event.shiftKey) { event.preventDefault() @@ -1251,6 +1349,7 @@ export default Vue.extend({ justify-content: space-between; border-bottom: 1px solid #f0f0f0; background: #fff; + cursor: move; } &__title { -- 2.34.1 From 19ba9aac2681b740190d4b3edda287c51ba97347 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Mon, 27 Apr 2026 10:30:33 +0800 Subject: [PATCH 6/7] update logintype --- b/user/logintype.dspy | 126 ++++++++++++++++++++++++++++-------------- 1 file changed, 85 insertions(+), 41 deletions(-) diff --git a/b/user/logintype.dspy b/b/user/logintype.dspy index 097f1eb..d2f6aa4 100644 --- a/b/user/logintype.dspy +++ b/b/user/logintype.dspy @@ -43,57 +43,101 @@ async def logintype(ns): db = DBPools() async with db.sqlorContext('kboss') as sor: - type = 0 - if ns.get('codeid'): - type += 1 + + domain_name = ns.get('domain_name') + if domain_name in ['www.opencomputing.cn', 'dev.opencomputing.cn', 'localhost:9527'] and ns.get('username') != '开元云(北京)科技有限公司': + if not ns.get('mobile'): + return { + 'status': False, + 'msg': '请输入手机号' + } + real_mobile_li = await sor.R('users', {'username': ns['username']}) + if not real_mobile_li: + return { + 'status': False, + 'msg': '用户名有误' + } + real_mobile = real_mobile_li[0]['mobile'] if real_mobile_li else None + if not real_mobile: + return { + 'status': False, + 'msg': '未查询到匹配得手机号码' + } + + if real_mobile and ns['mobile'] != real_mobile: + return { + 'status': False, + 'msg': '您的手机号与用户名不匹配' + } + + if not ns.get('codeid'): + return { + 'status': False, + 'msg': 'codeid不存在, 请输入验证码' + } code = await sor.R('validatecode', {'id': ns.get('codeid'), 'vcode': ns.get('vcode')}) if len(code) < 1: return {'status': False, 'msg': '验证码不正确'} - if type == 1: - # 手机号登录 - users = await sor.R('users', {'mobile': ns.get('username')}) - else: + password = password_encode(ns['password']) users = await sor.R('users', {'username': ns.get('username'), 'password': password}) - if len(users) < 1: - return {"status": False,'msg':'用户名或密码错误'} - elif ns.get('username') == "admin": + if len(users) < 1: + return {"status": False,'msg':'用户名或密码错误'} + return {'status': True} + else: - reseller = await sor.R('reseller', {'domain_name': ns.get('domain_name')}) - # 查到用户的所在机构 - user_org = await sor.R('organization', {'id': users[0]['orgid']}) - #0代表用户为主 1代表用户为子 - user_type = 0 - # 子页面判断用户 - if len(reseller) >= 1: - if reseller[0]['orgid'] == user_org[0]['parentid']: - user_type += 1 - if reseller[0]['orgid'] == users[0]['orgid']: - user_type += 1 - # 主页面判断用户 + type = 0 + if ns.get('codeid'): + type += 1 + code = await sor.R('validatecode', {'id': ns.get('codeid'), 'vcode': ns.get('vcode')}) + if len(code) < 1: + return {'status': False, 'msg': '验证码不正确'} + if type == 1: + # 手机号登录 + users = await sor.R('users', {'mobile': ns.get('username')}) else: - resellers = await sor.R('reseller', {'orgid': user_org[0]['parentid']}) - if len(resellers) >= 1: - user_type += 1 - if users[0]['user_reseller'] == '1': - user_type += 1 - # 证明是主级页面 - if len(reseller) < 1: - # 用户为主 - if user_type == 0: - return {'status': True} + password = password_encode(ns['password']) + users = await sor.R('users', {'username': ns.get('username'), 'password': password}) + if len(users) < 1: + return {"status": False,'msg':'用户名或密码错误'} + elif ns.get('username') == "admin": + return {'status': True} + else: + reseller = await sor.R('reseller', {'domain_name': ns.get('domain_name')}) + # 查到用户的所在机构 + user_org = await sor.R('organization', {'id': users[0]['orgid']}) + #0代表用户为主 1代表用户为子 + user_type = 0 + # 子页面判断用户 + if len(reseller) >= 1: + if reseller[0]['orgid'] == user_org[0]['parentid']: + user_type += 1 + if reseller[0]['orgid'] == users[0]['orgid']: + user_type += 1 + # 主页面判断用户 else: + resellers = await sor.R('reseller', {'orgid': user_org[0]['parentid']}) + if len(resellers) >= 1: + user_type += 1 + if users[0]['user_reseller'] == '1': + user_type += 1 + # 证明是主级页面 + if len(reseller) < 1: + # 用户为主 + if user_type == 0: + return {'status': True} + else: + # 用户为子 + return {'status': False,'msg':'用户名或密码错误'} + # 子级页面 + else: + # 用户为主 + if user_type == 0: + return {'status': False,'msg':'用户名或密码错误'} # 用户为子 - return {'status': False,'msg':'用户名或密码错误'} - # 子级页面 - else: - # 用户为主 - if user_type == 0: - return {'status': False,'msg':'用户名或密码错误'} - # 用户为子 - else: - return {'status': True} + else: + return {'status': True} ret = await logintype(params_kw) return ret \ No newline at end of file -- 2.34.1 From c4e45597a414c45cd3cbf9046b562225e45bff57 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Mon, 27 Apr 2026 11:00:17 +0800 Subject: [PATCH 7/7] update loginUser --- b/user/loginUser.dspy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/b/user/loginUser.dspy b/b/user/loginUser.dspy index 485f114..f4a2f68 100644 --- a/b/user/loginUser.dspy +++ b/b/user/loginUser.dspy @@ -153,6 +153,10 @@ async def loginUser(ns): if type1 == 1: # 手机号验证码登录 userreacs = await sor.R('users', {'mobile': ns.get('username')}) + + if not userreacs: + userreacs = await sor.R('users', {'username': ns.get('username')}) + # 如果是微信扫码后绑定已有账号 if ns.get('wechat_openid'): if userreacs: -- 2.34.1