# Query: tenant
# ContextLines: 1

121 个结果 - 20 文件

.env:
  10  # 租户开关
  11: VITE_APP_TENANT_ENABLE=false
  12  

  22  # 默认账户密码
  23: VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码
  24  VITE_APP_DEFAULT_LOGIN_USERNAME = admin

src\api\login\index.ts:
  25  // 使用租户名，获得租户编号
  26: export const getTenantIdByName = (name: string) => {
  27:   return request.get({ url: '/system/tenant/get-id-by-name?name=' + name })
  28  }

  30  // 使用租户域名，获得租户信息
  31: export const getTenantByWebsite = (website: string) => {
  32:   return request.get({ url: '/system/tenant/get-by-website?website=' + website })
  33  }

src\components\bpmnProcessDesigner\package\designer\plugins\descriptor\activitiDescriptor.json:
  368          {
  369:           "name": "calledElementTenantId",
  370            "isAttr": true,

  389          {
  390:           "name": "caseTenantId",
  391            "isAttr": true,

  463          {
  464:           "name": "decisionRefTenantId",
  465            "isAttr": true,

src\components\bpmnProcessDesigner\package\designer\plugins\descriptor\camundaDescriptor.json:
  355          {
  356:           "name": "calledElementTenantId",
  357            "isAttr": true,

  376          {
  377:           "name": "caseTenantId",
  378            "isAttr": true,

  450          {
  451:           "name": "decisionRefTenantId",
  452            "isAttr": true,

src\components\bpmnProcessDesigner\package\designer\plugins\descriptor\flowableDescriptor.json:
  374          {
  375:           "name": "calledElementTenantId",
  376            "isAttr": true,

  395          {
  396:           "name": "caseTenantId",
  397            "isAttr": true,

  469          {
  470:           "name": "decisionRefTenantId",
  471            "isAttr": true,

src\components\Editor\src\Editor.vue:
    8  import { useLocaleStore } from '@/store/modules/locale'
    9: import { getAccessToken, getTenantId } from '@/utils/auth'
   10  

  107              Authorization: 'Bearer ' + getAccessToken(),
  108:             'tenant-id': getTenantId()
  109            },

src\config\axios\service.ts:
   11  import { config } from '@/config/axios/config'
   12: import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } from '@/utils/auth'
   13  import errorCode from './errorCode'

   17  
   18: const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE
   19  const { result_code, base_url, request_timeout } = config

   57      // 设置租户
   58:     if (tenantEnable && tenantEnable === 'true') {
   59:       const tenantId = getTenantId()
   60:       if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
   61      }

  201  const refreshToken = async () => {
  202:   axios.defaults.headers.common['tenant-id'] = getTenantId()
  203    return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken())

src\hooks\web\useCache.ts:
  20    LoginForm: 'loginForm',
  21:   TenantId: 'tenantId'
  22  }

src\locales\en.ts:
  117      message: '',//改为空
  118:     tenantname: 'TenantName',
  119      username: 'Username',

  129      forgetPassword: 'Forget password?',
  130:     tenantNamePlaceholder: 'Please Enter Tenant Name',
  131      usernamePlaceholder: 'Please Enter Username',

src\locales\zh-CN.ts:
  117      message: '',//改为空
  118:     tenantname: '租户名称',
  119      username: '用户名',

  129      forgetPassword: '忘记密码?',
  130:     tenantNamePlaceholder: '请输入租户名称',
  131      usernamePlaceholder: '请输入用户名',

src\utils\auth.ts:
  39  export type LoginFormType = {
  40:   tenantName: string
  41    username: string

  64  
  65: export const getTenantId = () => {
  66:   return wsCache.get(CACHE_KEY.TenantId)
  67  }
  68  
  69: export const setTenantId = (username: string) => {
  70:   wsCache.set(CACHE_KEY.TenantId, username)
  71  }

src\views\bpm\model\ModelImportForm.vue:
  52  <script lang="ts" setup>
  53: import { getAccessToken, getTenantId } from '@/utils/auth'
  54  

  95      Authorization: 'Bearer ' + getAccessToken(),
  96:     'tenant-id': getTenantId()
  97    }

src\views\Login\SocialLogin.vue:
   66                  <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
   67:                   <el-form-item v-if="loginData.tenantEnable" prop="tenantName">
   68                      <el-input
   69:                       v-model="loginData.loginForm.tenantName"
   70:                       :placeholder="t('login.tenantNamePlaceholder')"
   71                        :prefix-icon="iconHouse"

  174  const LoginRules = {
  175:   tenantName: [required],
  176    username: [required],

  181    captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE !== 'false',
  182:   tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
  183    loginForm: {
  184:     tenantName: '芋道源码',
  185      username: 'admin',

  203  //获取租户ID
  204: const getTenantId = async () => {
  205:   if (loginData.tenantEnable) {
  206:     const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
  207:     authUtil.setTenantId(res)
  208    }

  218        rememberMe: loginForm.rememberMe ? true : false,
  219:       tenantName: loginForm.tenantName ? loginForm.tenantName : loginData.loginForm.tenantName
  220      }

  249    try {
  250:     await getTenantId()
  251      const data = await validForm()

src\views\Login\components\LoginForm.vue:
   18        <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
   19:         <el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
   20            <el-input
   21:             v-model="loginData.loginForm.tenantName"
   22:             :placeholder="t('login.tenantNamePlaceholder')"
   23              :prefix-icon="iconHouse"

  103  const LoginRules = {
  104:   tenantName: [required],
  105    username: [required],

  110    captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
  111:   tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
  112    loginForm: {
  113:     tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '',
  114      username: import.meta.env.VITE_APP_DEFAULT_LOGIN_USERNAME || '',

  139  // 获取租户 ID
  140: const getTenantId = async () => {
  141:   if (loginData.tenantEnable === 'true') {
  142:     const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
  143:     authUtil.setTenantId(res)
  144    }

  154        rememberMe: loginForm.rememberMe,
  155:       tenantName: loginForm.tenantName ? loginForm.tenantName : loginData.loginForm.tenantName
  156      }

  159  // 根据域名，获得租户信息
  160: const getTenantByWebsite = async () => {
  161    const website = location.host
  162:   const res = await LoginApi.getTenantByWebsite(website)
  163    if (res) {
  164:     loginData.loginForm.tenantName = res.name
  165:     authUtil.setTenantId(res.id)
  166    }

  172    try {
  173:     await getTenantId()
  174      const data = await validForm()

  214      loginLoading.value = true
  215:     if (loginData.tenantEnable === 'true') {
  216:       // 尝试先通过 tenantName 获取租户
  217:       await getTenantId()
  218        // 如果获取不到，则需要弹出提示，进行处理
  219:       if (!authUtil.getTenantId()) {
  220          try {

  222            if (data?.action !== 'confirm') throw 'cancel'
  223:           const res = await LoginApi.getTenantIdByName(data.value)
  224:           authUtil.setTenantId(res)
  225          } catch (error) {

  255    getLoginFormCache()
  256:   getTenantByWebsite()
  257  })

src\views\Login\components\MobileForm.vue:
   19        <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
   20:         <el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
   21            <el-input
   22:             v-model="loginData.loginForm.tenantName"
   23:             :placeholder="t('login.tenantNamePlaceholder')"
   24              :prefix-icon="iconHouse"

   99  
  100: import { setTenantId, setToken } from '@/utils/auth'
  101  import { usePermissionStore } from '@/store/modules/permission'
  102: import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login'
  103  import LoginFormTitle from './LoginFormTitle.vue'

  122  const rules = {
  123:   tenantName: [required],
  124    mobileNumber: [required],

  128    codeImg: '',
  129:   tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
  130    token: '',

  135      uuid: '',
  136:     tenantName: '芋道源码',
  137      mobileNumber: '',

  153  const getSmsCode = async () => {
  154:   await getTenantId()
  155    smsVO.smsCode.mobile = loginData.loginForm.mobileNumber

  177  // 获取租户 ID
  178: const getTenantId = async () => {
  179:   if (loginData.tenantEnable === 'true') {
  180:     const res = await getTenantIdByName(loginData.loginForm.tenantName)
  181:     setTenantId(res)
  182    }

  185  const signIn = async () => {
  186:   await getTenantId()
  187    const data = await validForm()

src\views\mp\draft\editor-config.ts:
   1  import { IEditorConfig } from '@wangeditor/editor'
   2: import { getAccessToken, getTenantId } from '@/utils/auth'
   3  

  34            Authorization: 'Bearer ' + getAccessToken(),
  35:           'tenant-id': getTenantId()
  36          },

src\views\pay\order\index.vue:
   99            :loading="exportLoading"
  100:           v-hasPermi="['system:tenant:export']"
  101          >

src\views\pay\refund\index.vue:
  107            :loading="exportLoading"
  108:           v-hasPermi="['system:tenant:export']"
  109          >

src\views\system\user\UserImportForm.vue:
  44  import * as UserApi from '@/api/system/user'
  45: import { getAccessToken, getTenantId } from '@/utils/auth'
  46  import download from '@/utils/download'

  78      Authorization: 'Bearer ' + getAccessToken(),
  79:     'tenant-id': getTenantId()
  80    }

types\env.d.ts:
  15    readonly VITE_APP_CAPTCHA_ENABLE: string
  16:   readonly VITE_APP_TENANT_ENABLE: string
  17:   readonly VITE_APP_DEFAULT_LOGIN_TENANT: string
  18    readonly VITE_APP_DEFAULT_LOGIN_USERNAME: string
