diff --git a/f/web-kboss/src/permission.js b/f/web-kboss/src/permission.js index 7420a79..c22e94e 100644 --- a/f/web-kboss/src/permission.js +++ b/f/web-kboss/src/permission.js @@ -11,7 +11,7 @@ import {getHomePath} from "@/views/setting/tools"; NProgress.configure({showSpinner: false}); // NProgress Configuration -const whiteList = ["product","/login", "/homePage", "/registrationPage", "/shoppingCart", "/homePageImage","/h5HomePage",'/H5about','/modelProductDetail','/ncmatchHome']; // no redirect whitelist +const whiteList = ["product", "/tokenMarket", "/modelDetail", "/modelApiDocument", "/login", "/homePage", "/registrationPage", "/shoppingCart", "/homePageImage","/h5HomePage",'/H5about','/modelProductDetail','/ncmatchHome']; // no redirect whitelist // 获取用户代理字符串 const userAgent = window.navigator.userAgent; diff --git a/f/web-kboss/src/router/index.js b/f/web-kboss/src/router/index.js index 55b152d..e877b3b 100644 --- a/f/web-kboss/src/router/index.js +++ b/f/web-kboss/src/router/index.js @@ -62,6 +62,16 @@ export const constantRoutes = [ component: () => import('@/views/modelProductDetail/index.vue'), }, + { + path: "/tokenMarket", + name: "PublicTokenMarket", + component: () => import('@/views/product/allProduct/index.vue'), + hidden: true, + meta: { + title: "TOKEN市集", + noCache: true + } + }, { path: '/h5HomePage', name: 'H5HomePage', @@ -392,6 +402,28 @@ export const constantRoutes = [ meta: { title: "立即支付页面" }, }, { path: "/auth-redirect", component: () => import("@/views/login/auth-redirect"), hidden: true, + }, + { + path: "/modelDetail", + component: () => import('@/views/modelManagement/ModelDetail.vue'), + hidden: true, + name: 'modelDetail', + meta: { + title: "模型详情", + fullPath: "/modelDetail", + noCache: true + }, + }, + { + path: "/modelApiDocument", + component: () => import('@/views/modelManagement/ApiDocument.vue'), + hidden: true, + name: 'modelApiDocument', + meta: { + title: "API文档", + fullPath: "/modelApiDocument", + noCache: true + }, }, { path: "/404", component: () => import("@/views/error-page/404"), hidden: true, }, { @@ -480,6 +512,30 @@ export const asyncRoutes = [ }, ] }, + // Token用量 - 一级菜单(所有登录用户都能看到) + { + path: "/tokenUsage", + component: Layout, + meta: { + title: "Token用量", + fullPath: "/tokenUsage", + noCache: true, + icon: "el-icon-data-line" + }, + children: [ + { + path: "", + component: () => import('@/views/tokenUsage/index.vue'), + name: 'TokenUsage', + meta: { + title: "Token用量", + fullPath: "/tokenUsage", + noCache: true, + icon: "el-icon-data-line" + } + }, + ] + }, // 模型体验 { path: "/modelExperience", @@ -492,30 +548,6 @@ export const asyncRoutes = [ noCache: true }, }, - // 模型详情 - { - path: "/modelDetail", - component: () => import('@/views/modelManagement/ModelDetail.vue'), - hidden: true, - name: 'modelDetail', - meta: { - title: "模型详情", - fullPath: "/modelDetail", - noCache: true - }, - }, - // API文档 - { - path: "/modelApiDocument", - component: () => import('@/views/modelManagement/ApiDocument.vue'), - hidden: true, - name: 'modelApiDocument', - meta: { - title: "API文档", - fullPath: "/modelApiDocument", - noCache: true - }, - }, { path: "/overview", component: Layout, @@ -1056,24 +1088,24 @@ export const asyncRoutes = [ ] }, // 信息完善 - 变为一级菜单 - { - path: "/informationPerfect", - component: Layout, - meta: { - title: "信息完善", - icon: "el-icon-edit-outline", - noCache: true, - fullPath: "/informationPerfect" - }, - children: [ - { - path: "index", - component: () => import('@/views/customer/ncApprove/index.vue'), - name: "InformationPerfect", - meta: { title: "信息完善", fullPath: "/informationPerfect/index" }, - } - ] - }, + // { + // path: "/informationPerfect", + // component: Layout, + // meta: { + // title: "信息完善", + // icon: "el-icon-edit-outline", + // noCache: true, + // fullPath: "/informationPerfect" + // }, + // children: [ + // { + // path: "index", + // component: () => import('@/views/customer/ncApprove/index.vue'), + // name: "InformationPerfect", + // meta: { title: "信息完善", fullPath: "/informationPerfect/index" }, + // } + // ] + // }, // 充值管理 - 变为一级菜单 { path: "/rechargeManagement", diff --git a/f/web-kboss/src/store/modules/permission.js b/f/web-kboss/src/store/modules/permission.js index b59a9f4..6becf7a 100644 --- a/f/web-kboss/src/store/modules/permission.js +++ b/f/web-kboss/src/store/modules/permission.js @@ -14,7 +14,7 @@ const SPECIAL_ORDER_USER = 'ZhipuHZ'; const SUPER_ADMIN_ROUTE_PATH = '/superAdministrator'; // 所有登录用户都能访问的公共路由,不依赖后端 auths 和角色。hidden 路由不会显示在菜单里。 -const COMMON_ROUTE_PATHS = ['/product', '/tokenManagement', '/modelExperience', '/modelDetail', '/modelApiDocument']; +const COMMON_ROUTE_PATHS = ['/product', '/tokenManagement', '/tokenUsage', '/modelExperience', '/modelDetail', '/modelApiDocument']; // 运营角色需要额外补出来的菜单。 const OPERATION_EXTRA_ROUTE_PATHS = ['/modelManagement', '/operationReport']; 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 4de7b51..f1aaac3 100644 --- a/f/web-kboss/src/views/homePage/components/topBox/index.vue +++ b/f/web-kboss/src/views/homePage/components/topBox/index.vue @@ -22,7 +22,7 @@

基础云

- +

@@ -367,6 +367,11 @@ export default Vue.extend({ return this.$route.path.includes('/homePage/index'); } }, + isActiveTokenMarket() { + const category = this.$route.query.category || this.$route.query.tab || '' + return this.$route.path === '/tokenMarket' || + (this.$route.path === '/product' && ['TOKEN市集', 'Token市集', 'token市集'].includes(category)) + }, aiPanelStyle() { if (this.aiPanelPosition.left === null || this.aiPanelPosition.top === null) { return {} @@ -381,19 +386,30 @@ export default Vue.extend({ } }, methods: { - // 点击模型广场前校验登录状态 + // 点击 TOKEN 市集:未登录也允许进入,但按单页面模式展示。 handleModelSquareClick() { if (!this.loginState) { - this.$message.warning('请先登录哦~') + this.$router.push({ + path: '/tokenMarket', + query: { + category: 'TOKEN市集', + single: '1' + } + }) return } - this.$router.push('/product') + this.$router.push({ + path: '/product', + query: { + category: 'TOKEN市集' + } + }) }, // 跳转元境 async goYuanjing() { if (!this.loginState) { - this.$message.warning('请先登录哦~') + window.open('https://ai.opencomputing.cn/', '_blank') return } @@ -1143,6 +1159,11 @@ export default Vue.extend({ } } + &.nav-hover.active { + color: #1E6FFF; + font-weight: bold; + } + a { text-decoration: none; font-size: 18px !important; diff --git a/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue b/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue index 4892952..8eea68f 100644 --- a/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue +++ b/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue @@ -23,7 +23,7 @@

好用还省钱,Token 就上开元云

-

石景山OPC公共服务平台

+

数智开物OPC公共服务平台

OPC 而生,极致性价比一站式模型平台

@@ -220,7 +220,14 @@ export default Vue.extend({ methods: { goTokenMarket() { if (!this.loginState) { - this.$message.warning('请先登录哦~') + this.$router.push({ + path: '/tokenMarket', + query: { + category: 'TOKEN市集', + from: 'home', + single: '1' + } + }) return } this.$router.push({ @@ -264,7 +271,7 @@ export default Vue.extend({ }, async goCreativeWorkshop() { if (!this.loginState) { - this.$message.warning('请先登录哦~') + window.open('https://ai.opencomputing.cn/', '_blank') return } diff --git a/f/web-kboss/src/views/login/indexNew.vue b/f/web-kboss/src/views/login/indexNew.vue index 0dad6ee..4137ea6 100644 --- a/f/web-kboss/src/views/login/indexNew.vue +++ b/f/web-kboss/src/views/login/indexNew.vue @@ -43,10 +43,27 @@
-
+ + - +
@@ -56,7 +73,7 @@
- @@ -66,7 +83,7 @@ + @blur="capsTooltip = false" @keyup.enter.native="handleLogin('loginForm')" /> @@ -75,7 +92,7 @@ - +
@@ -85,7 +102,7 @@
-
+
@@ -201,6 +218,7 @@ export default { // 对话框和加载状态 loading: false, // 登录按钮加载状态 forgotPasswordVisible: false, // 忘记密码弹窗显示状态 + loginMode: 'password', // 登录模式:password-账号密码,mobile-手机号验证码 // 登录表单数据 loginForm: { @@ -247,6 +265,19 @@ export default { // 检查当前域名是否为ncmatch.cn isNcmatchDomain() { return window.location.hostname.includes('ncmatch.cn'); + }, + activeRules() { + if (this.loginMode === 'mobile') { + return { + mobile: this.rules.mobile, + vcode: this.rules.vcode + } + } + + return { + username: this.rules.username, + password: this.rules.password + } } }, @@ -693,6 +724,16 @@ export default { console.log(tab, event); }, + // 切换登录方式,并清理上一种登录方式的校验提示。 + switchLoginMode(mode) { + if (this.loginMode === mode) return; + this.loginMode = mode; + this.capsTooltip = false; + this.$nextTick(() => { + this.$refs.loginForm && this.$refs.loginForm.clearValidate(); + }); + }, + // 检查大写锁定状态 checkCapslock(e) { const { key } = e; @@ -703,15 +744,7 @@ export default { handleLogin(formName) { this.$refs[formName].validate((valid) => { if (valid) { - const loginParams = { - username: this.loginForm.username, - domain_name: this.photosUrl?.domain_name ? this.photosUrl.domain_name : '', - password: this.passwordEncryption(this.loginForm.password), - mobile: this.loginForm.mobile, - vcode: this.loginForm.vcode, - codeid: this.loginForm.codeid, - wechat_openid: this.wechat_openid - } + const loginParams = this.buildLoginParams() logintypeAPI(loginParams).then(res => { if (res.status == true) { @@ -803,16 +836,38 @@ export default { }) } else { this.$message({ - message: res.msg, + message: "请完善登录信息", type: "error", }); - this.$refs.loginForm.resetFields(); return false; } }); }, + // 根据当前登录模式生成提交参数,避免把另一种模式的空字段带给后端。 + buildLoginParams() { + const commonParams = { + domain_name: this.photosUrl?.domain_name ? this.photosUrl.domain_name : '', + wechat_openid: this.wechat_openid + }; + + if (this.loginMode === 'mobile') { + return { + ...commonParams, + mobile: this.loginForm.mobile, + vcode: this.loginForm.vcode, + codeid: this.loginForm.codeid + }; + } + + return { + ...commonParams, + username: this.loginForm.username, + password: this.passwordEncryption(this.loginForm.password) + }; + }, + // 显示/隐藏密码 showPwd() { if (this.passwordType === "password") { @@ -838,7 +893,9 @@ export default { $cursor: black; $light_gray: #eee; $dark_gray: #889aa4; - +.el-form{ + padding:20px 0; +} .main-box { background: url('/static/img/banner.0798e703.png') no-repeat center center; background-size: cover; @@ -886,24 +943,60 @@ $dark_gray: #889aa4; /* 统一登录表单容器 */ .login-form { - padding: 40px 50px; + width: 420px; + padding: 24px 60px 22px; mix-blend-mode: normal; background-color: white; border-radius: 24px; box-sizing: border-box; + box-shadow: 0 18px 46px rgba(34, 47, 96, 0.08); } /* 登录标题统一间距 */ .login-text { display: block; text-align: center; - margin-bottom: 30px; + margin-bottom: 12px; font-family: PingFang SC; font-size: 24px; font-weight: 500; color: #333; } +.login-mode-tabs { + display: flex; + width: 300px; + padding: 0; + margin: 16px 0; + background: transparent; + border: 1px solid #d8e6ff; + border-radius: 999px; + + button { + position: relative; + flex: 1; + height: 36px; + color: #64748b; + font-size: 14px; + cursor: pointer; + background: transparent; + border: none; + border-radius: 999px; + transition: all 0.22s ease; + + &:hover { + color: #1e6fff; + } + + &.active { + color: #ffffff; + font-weight: 600; + background: linear-gradient(135deg, #1e6fff, #4aa3ff); + box-shadow: 0 8px 18px rgba(30, 111, 255, 0.28); + } + } +} + /* 统一输入框容器样式 */ .user-input { display: flex; @@ -925,7 +1018,7 @@ $dark_gray: #889aa4; /* 统一表单项目样式 + 边距 */ ::v-deep .el-form-item { - margin-bottom: 24px !important; + margin-bottom: 15px !important; /* 给错误提示预留空间 */ } @@ -1010,8 +1103,8 @@ $dark_gray: #889aa4; height: 42px; line-height: 42px; font-size: 16px; - margin-top: 10px !important; - margin-bottom: 20px !important; + margin-top: 0 !important; + margin-bottom: 12px !important; } /* 底部按钮区域统一 */ @@ -1024,7 +1117,7 @@ $dark_gray: #889aa4; } .forgot-password { - margin-bottom: 30px; + margin-bottom: 12px; color: #409eff; cursor: pointer; font-size: 14px; diff --git a/f/web-kboss/src/views/modelManagement/ApiDocument.vue b/f/web-kboss/src/views/modelManagement/ApiDocument.vue index 85a394e..94d87fa 100644 --- a/f/web-kboss/src/views/modelManagement/ApiDocument.vue +++ b/f/web-kboss/src/views/modelManagement/ApiDocument.vue @@ -182,6 +182,10 @@ print(response.json())` }, goBack() { if (this.$route.query.from === 'tokenMarket') { + if (this.$route.query.single === '1') { + this.$router.push({ path: '/tokenMarket', query: { category: 'TOKEN市集', single: '1' } }) + return + } this.$router.push({ path: '/product', query: { category: 'TOKEN市集' } }) return } diff --git a/f/web-kboss/src/views/modelManagement/ModelDetail.vue b/f/web-kboss/src/views/modelManagement/ModelDetail.vue index 717148f..ba24d6c 100644 --- a/f/web-kboss/src/views/modelManagement/ModelDetail.vue +++ b/f/web-kboss/src/views/modelManagement/ModelDetail.vue @@ -272,6 +272,10 @@ export default { return value !== undefined && value !== null && value !== '' && value !== '-' }, goTokenMarket() { + if (this.$route.query.single === '1') { + this.$router.push({ path: '/tokenMarket', query: { category: 'TOKEN市集', single: '1' } }) + return + } this.$router.push({ path: '/product', query: { category: 'TOKEN市集' } }) }, goBack() { @@ -286,7 +290,8 @@ export default { id: this.$route.query.id, model_id: this.$route.query.model_id || this.$route.query.id, from: 'tokenMarket', - category: 'TOKEN市集' + category: 'TOKEN市集', + single: this.$route.query.single } }, goApiDocument() { diff --git a/f/web-kboss/src/views/product/allProduct/index.vue b/f/web-kboss/src/views/product/allProduct/index.vue index ecdfd0a..d7c76fe 100644 --- a/f/web-kboss/src/views/product/allProduct/index.vue +++ b/f/web-kboss/src/views/product/allProduct/index.vue @@ -1,8 +1,9 @@