huangxw 10 сар өмнө
parent
commit
5779b6de60

+ 4 - 4
README.md

@@ -1,10 +1,10 @@
 ## 平台简介
 
 - 本仓库为前端技术栈 [Vue3](https://v3.cn.vuejs.org) + [TS](https://www.typescriptlang.org/) + [Element Plus](https://element-plus.org/zh-CN) + [Vite](https://cn.vitejs.dev) 版本。
-- 成员项目: 基于 vben5(ant-design-vue) 的前端项目 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5)
+- 成员项目: 基于 vben5(ant-design-vue) 的前端项目 [yujin-plus-vben5](https://gitee.com/dapppp/yujin-plus-vben5)
 - 配套后端代码仓库地址
 - [数字云药 5.X(注意版本号)](https://gitee.com/dromara/数字云药)
-- [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus)
+- [yujin-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/yujin-Cloud-Plus)
 
 ## 前端运行
 
@@ -24,9 +24,9 @@ npm run build:prod
 # 前端访问地址 http://localhost:80
 ```
 
-## 本框架与RuoYi的业务差异
+## 本框架与yujin的业务差异
 
-| 业务         | 功能说明                                                      | 本框架 | RuoYi                         |
+| 业务         | 功能说明                                                      | 本框架 | yujin                         |
 | ------------ | ------------------------------------------------------------- | ------ | ----------------------------- |
 | 租户管理     | 系统内租户的管理 如:租户套餐、过期时间、用户数量、企业信息等  | 支持   | 无                            |
 | 租户套餐管理 | 系统内租户所能使用的套餐管理 如:套餐内所包含的菜单等          | 支持   | 无                            |

+ 1 - 1
src/assets/styles/ruoyi.scss

@@ -1,6 +1,6 @@
 /**
  * 通用css样式布局处理
- * Copyright (c) 2019 ruoyi
+ * Copyright (c) 2019 yujin
  */
 
 /** 基础通用 **/

+ 1 - 1
src/directive/common/copyText.ts

@@ -1,6 +1,6 @@
 /**
  * v-copyText 复制文本内容
- * Copyright (c) 2022 ruoyi
+ * Copyright (c) 2022 yujin
  */
 import { DirectiveBinding } from 'vue';
 

+ 154 - 205
src/views/login.vue

@@ -1,67 +1,56 @@
 <template>
-  <div class="login">
-    <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
-      <div class="title-box">
-        <h3 class="title">数字云药管理后台</h3>
-        <lang-select />
-      </div>
-      <el-form-item prop="username">
-        <el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" :placeholder="proxy.$t('login.username')">
-          <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
-        </el-input>
-      </el-form-item>
-      <el-form-item prop="password">
-        <el-input
-          v-model="loginForm.password"
-          type="password"
-          size="large"
-          auto-complete="off"
-          :placeholder="proxy.$t('login.password')"
-          @keyup.enter="handleLogin"
-        >
-          <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-if="captchaEnabled" prop="code">
-        <el-input
-          v-model="loginForm.code"
-          size="large"
-          auto-complete="off"
-          :placeholder="proxy.$t('login.code')"
-          style="width: 63%"
-          @keyup.enter="handleLogin"
-        >
-          <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
-        </el-input>
-        <div class="login-code">
-          <img :src="codeUrl" class="login-code-img" @click="getCode" />
+    <div class="login">
+        <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
+            <div class="title-box">
+                <h3 class="title">数字云药管理后台</h3>
+                <lang-select />
+            </div>
+            <el-form-item prop="username">
+                <el-input v-model="loginForm.username" type="text" size="large" auto-complete="off"
+                    :placeholder="proxy.$t('login.username')">
+                    <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
+                </el-input>
+            </el-form-item>
+            <el-form-item prop="password">
+                <el-input v-model="loginForm.password" type="password" size="large" auto-complete="off"
+                    :placeholder="proxy.$t('login.password')" @keyup.enter="handleLogin">
+                    <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
+                </el-input>
+            </el-form-item>
+            <el-form-item v-if="captchaEnabled" prop="code">
+                <el-input v-model="loginForm.code" size="large" auto-complete="off" :placeholder="proxy.$t('login.code')"
+                    style="width: 63%" @keyup.enter="handleLogin">
+                    <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
+                </el-input>
+                <div class="login-code">
+                    <img :src="codeUrl" class="login-code-img" @click="getCode" />
+                </div>
+            </el-form-item>
+            <el-checkbox v-model="loginForm.rememberMe" style="margin: 0 0 25px 0">{{ proxy.$t('login.rememberPassword')
+            }}</el-checkbox>
+            <el-form-item style="width: 100%">
+                <el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleLogin">
+                    <span v-if="!loading">{{ proxy.$t('login.login') }}</span>
+                    <span v-else>{{ proxy.$t('login.logging') }}</span>
+                </el-button>
+                <div v-if="register" style="float: right">
+                    <router-link class="link-type" :to="'/register'">{{ proxy.$t('login.switchRegisterPage')
+                    }}</router-link>
+                </div>
+            </el-form-item>
+        </el-form>
+        <!--  底部  -->
+        <div class="el-login-footer">
+            <span>Copyright © 2025-2026 钰津供应链科技 All Rights Reserved.</span>
         </div>
-      </el-form-item>
-      <el-checkbox v-model="loginForm.rememberMe" style="margin: 0 0 25px 0">{{ proxy.$t('login.rememberPassword') }}</el-checkbox>
-      <el-form-item style="width: 100%">
-        <el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleLogin">
-          <span v-if="!loading">{{ proxy.$t('login.login') }}</span>
-          <span v-else>{{ proxy.$t('login.logging') }}</span>
-        </el-button>
-        <div v-if="register" style="float: right">
-          <router-link class="link-type" :to="'/register'">{{ proxy.$t('login.switchRegisterPage') }}</router-link>
-        </div>
-      </el-form-item>
-    </el-form>
-    <!--  底部  -->
-    <div class="el-login-footer">
-      <span>Copyright © 2018-2024 疯狂的狮子Li All Rights Reserved.</span>
     </div>
-  </div>
 </template>
 
 <script setup lang="ts">
-import { getCodeImg, getTenantList } from '@/api/login';
-import { authBinding } from '@/api/system/social/auth';
+import { getCodeImg } from '@/api/login';
 import { useUserStore } from '@/store/modules/user';
 import { LoginData, TenantVO } from '@/api/types';
 import { to } from 'await-to-js';
-import { HttpStatus } from '@/enums/RespEnum';
 import { useI18n } from 'vue-i18n';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -71,20 +60,19 @@ const router = useRouter();
 const { t } = useI18n();
 
 const loginForm = ref<LoginData>({
-  // tenantId: '190040',
-   tenantId: '000000',
-  username: 'admin',
-  password: 'admin123',
-  rememberMe: false,
-  code: '',
-  uuid: ''
+    tenantId: '190040',
+    username: '',
+    password: '',
+    rememberMe: false,
+    code: '',
+    uuid: ''
 } as LoginData);
 
 const loginRules: ElFormRules = {
-  tenantId: [{ required: true, trigger: 'blur', message: t('login.rule.tenantId.required') }],
-  username: [{ required: true, trigger: 'blur', message: t('login.rule.username.required') }],
-  password: [{ required: true, trigger: 'blur', message: t('login.rule.password.required') }],
-  code: [{ required: true, trigger: 'change', message: t('login.rule.code.required') }]
+    tenantId: [{ required: true, trigger: 'blur', message: t('login.rule.tenantId.required') }],
+    username: [{ required: true, trigger: 'blur', message: t('login.rule.username.required') }],
+    password: [{ required: true, trigger: 'blur', message: t('login.rule.password.required') }],
+    code: [{ required: true, trigger: 'change', message: t('login.rule.code.required') }]
 };
 
 const codeUrl = ref('');
@@ -102,189 +90,150 @@ const loginRef = ref<ElFormInstance>();
 const tenantList = ref<TenantVO[]>([]);
 
 watch(
-  () => router.currentRoute.value,
-  (newRoute: any) => {
-    redirect.value = newRoute.query && newRoute.query.redirect && decodeURIComponent(newRoute.query.redirect);
-  },
-  { immediate: true }
+    () => router.currentRoute.value,
+    (newRoute: any) => {
+        redirect.value = newRoute.query && newRoute.query.redirect && decodeURIComponent(newRoute.query.redirect);
+    },
+    { immediate: true }
 );
 
 const handleLogin = () => {
-  loginRef.value?.validate(async (valid: boolean, fields: any) => {
-    if (valid) {
-      loading.value = true;
-      // 勾选了需要记住密码设置在 localStorage 中设置记住用户名和密码
-      if (loginForm.value.rememberMe) {
-        localStorage.setItem('tenantId', String(loginForm.value.tenantId));
-        localStorage.setItem('username', String(loginForm.value.username));
-        localStorage.setItem('password', String(loginForm.value.password));
-        localStorage.setItem('rememberMe', String(loginForm.value.rememberMe));
-      } else {
-        // 否则移除
-        localStorage.removeItem('tenantId');
-        localStorage.removeItem('username');
-        localStorage.removeItem('password');
-        localStorage.removeItem('rememberMe');
-      }
-      // 调用action的登录方法
-      const [err] = await to(userStore.login(loginForm.value));
-      if (!err) {
-        const redirectUrl = redirect.value || '/';
-        await router.push(redirectUrl);
-        loading.value = false;
-      } else {
-        loading.value = false;
-        // 重新获取验证码
-        if (captchaEnabled.value) {
-          await getCode();
+    loginRef.value?.validate(async (valid: boolean, fields: any) => {
+        if (valid) {
+            loading.value = true;
+            // 勾选了需要记住密码设置在 localStorage 中设置记住用户名和密码
+            if (loginForm.value.rememberMe) {
+                localStorage.setItem('username', String(loginForm.value.username));
+                localStorage.setItem('password', String(loginForm.value.password));
+                localStorage.setItem('rememberMe', String(loginForm.value.rememberMe));
+            } else {
+                // 否则移除
+                localStorage.removeItem('tenantId');
+                localStorage.removeItem('username');
+                localStorage.removeItem('password');
+                localStorage.removeItem('rememberMe');
+            }
+            // 调用action的登录方法
+            const [err] = await to(userStore.login(loginForm.value));
+            if (!err) {
+                const redirectUrl = redirect.value || '/';
+                await router.push(redirectUrl);
+                loading.value = false;
+            } else {
+                loading.value = false;
+                // 重新获取验证码
+                if (captchaEnabled.value) {
+                    await getCode();
+                }
+            }
+        } else {
+            console.log('error submit!', fields);
         }
-      }
-    } else {
-      console.log('error submit!', fields);
-    }
-  });
+    });
 };
 
 /**
  * 获取验证码
  */
 const getCode = async () => {
-  const res = await getCodeImg();
-  const { data } = res;
-  captchaEnabled.value = data.captchaEnabled === undefined ? true : data.captchaEnabled;
-  if (captchaEnabled.value) {
-    codeUrl.value = 'data:image/gif;base64,' + data.img;
-    loginForm.value.uuid = data.uuid;
-  }
-};
-
-const getLoginData = () => {
-  const tenantId = localStorage.getItem('tenantId');
-  const username = localStorage.getItem('username');
-  const password = localStorage.getItem('password');
-  const rememberMe = localStorage.getItem('rememberMe');
-  loginForm.value = {
-    tenantId: tenantId === null ? String(loginForm.value.tenantId) : tenantId,
-    username: username === null ? String(loginForm.value.username) : username,
-    password: password === null ? String(loginForm.value.password) : String(password),
-    rememberMe: rememberMe === null ? false : Boolean(rememberMe)
-  } as LoginData;
-};
-
-/**
- * 获取租户列表
- */
-const initTenantList = async () => {
-  const { data } = await getTenantList(false);
-  tenantEnabled.value = data.tenantEnabled === undefined ? true : data.tenantEnabled;
-  if (tenantEnabled.value) {
-    tenantList.value = data.voList;
-    if (tenantList.value != null && tenantList.value.length !== 0) {
-      loginForm.value.tenantId = tenantList.value[0].tenantId;
+    const res = await getCodeImg();
+    const { data } = res;
+    captchaEnabled.value = data.captchaEnabled === undefined ? true : data.captchaEnabled;
+    if (captchaEnabled.value) {
+        codeUrl.value = 'data:image/gif;base64,' + data.img;
+        loginForm.value.uuid = data.uuid;
     }
-  }
 };
 
-/**
- * 第三方登录
- * @param type
- */
-const doSocialLogin = (type: string) => {
-  authBinding(type, loginForm.value.tenantId).then((res: any) => {
-    if (res.code === HttpStatus.SUCCESS) {
-      // 获取授权地址跳转
-      window.location.href = res.data;
-    } else {
-      ElMessage.error(res.msg);
-    }
-  });
-};
 
 onMounted(() => {
-  getCode();
-  // initTenantList();
-  // getLoginData();
+    getCode();
+    // 获取路由地址参数tenantId
+    const tenantId = router.currentRoute.value.query.tenantId;
+    if (tenantId) {
+        loginForm.value.tenantId = tenantId as string;
+    }
 });
 </script>
 
 <style lang="scss" scoped>
 .login {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  height: 100%;
-  background-image: url('../assets/images/login-background.jpg');
-  background-size: cover;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 100%;
+    background-image: url('../assets/images/login-background.jpg');
+    background-size: cover;
 }
 
 .title-box {
-  display: flex;
+    display: flex;
 
-  .title {
-    margin: 0px auto 30px auto;
-    text-align: center;
-    color: #707070;
-  }
+    .title {
+        margin: 0px auto 30px auto;
+        text-align: center;
+        color: #707070;
+    }
 
-  :deep(.lang-select--style) {
-    line-height: 0;
-    color: #7483a3;
-  }
+    :deep(.lang-select--style) {
+        line-height: 0;
+        color: #7483a3;
+    }
 }
 
 .login-form {
-  border-radius: 6px;
-  background: #ffffff;
-  width: 400px;
-  padding: 25px 25px 5px 25px;
+    border-radius: 6px;
+    background: #ffffff;
+    width: 400px;
+    padding: 25px 25px 5px 25px;
 
-  .el-input {
-    height: 40px;
+    .el-input {
+        height: 40px;
 
-    input {
-      height: 40px;
+        input {
+            height: 40px;
+        }
     }
-  }
 
-  .input-icon {
-    height: 39px;
-    width: 14px;
-    margin-left: 0px;
-  }
+    .input-icon {
+        height: 39px;
+        width: 14px;
+        margin-left: 0px;
+    }
 }
 
 .login-tip {
-  font-size: 13px;
-  text-align: center;
-  color: #bfbfbf;
+    font-size: 13px;
+    text-align: center;
+    color: #bfbfbf;
 }
 
 .login-code {
-  width: 33%;
-  height: 40px;
-  float: right;
+    width: 33%;
+    height: 40px;
+    float: right;
 
-  img {
-    cursor: pointer;
-    vertical-align: middle;
-  }
+    img {
+        cursor: pointer;
+        vertical-align: middle;
+    }
 }
 
 .el-login-footer {
-  height: 40px;
-  line-height: 40px;
-  position: fixed;
-  bottom: 0;
-  width: 100%;
-  text-align: center;
-  color: #fff;
-  font-family: Arial, serif;
-  font-size: 12px;
-  letter-spacing: 1px;
+    height: 40px;
+    line-height: 40px;
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    text-align: center;
+    color: #fff;
+    font-family: Arial, serif;
+    font-size: 12px;
+    letter-spacing: 1px;
 }
 
 .login-code-img {
-  height: 40px;
-  padding-left: 12px;
+    height: 40px;
+    padding-left: 12px;
 }
 </style>

+ 1 - 1
src/views/register.vue

@@ -67,7 +67,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-register-footer">
-      <span>Copyright © 2018-2024 疯狂的狮子Li All Rights Reserved.</span>
+      <span>Copyright © 2018-2024 钰津供应链科技 All Rights Reserved.</span>
     </div>
   </div>
 </template>

+ 1 - 1
src/views/tool/gen/genInfoForm.vue

@@ -15,7 +15,7 @@
         <el-form-item prop="packageName">
           <template #label>
             生成包路径
-            <el-tooltip content="生成在哪个java包下,例如 com.ruoyi.system" placement="top">
+            <el-tooltip content="生成在哪个java包下,例如 com.yujin.system" placement="top">
               <el-icon><question-filled /></el-icon>
             </el-tooltip>
           </template>

+ 1 - 1
src/views/tool/gen/index.vue

@@ -185,7 +185,7 @@ const handleGenTable = async (row?: TableVO) => {
     await genCode(row.tableId);
     proxy?.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath);
   } else {
-    proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
+    proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'yujin.zip');
   }
 };
 /** 同步数据库操作 */

+ 1 - 1
vite.config.ts

@@ -8,7 +8,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
     return {
         // 部署生产环境和开发环境下的URL。
         // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
-        // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
+        // 例如 https://www.yujin.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.yujin.vip/admin/,则设置 baseUrl 为 /admin/。
         base: env.VITE_APP_CONTEXT_PATH,
         resolve: {
             alias: {

+ 1 - 1
vite/plugins/compression.ts

@@ -6,7 +6,7 @@ export default (env: any) => {
   if (VITE_BUILD_COMPRESS) {
     const compressList = VITE_BUILD_COMPRESS.split(',');
     if (compressList.includes('gzip')) {
-      // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
+      // http://doc.yujin.vip/yujin-vue/other/faq.html#使用gzip解压缩静态文件
       plugin.push(
         compression({
           ext: '.gz',