zhengyiming
3 天以前 24e5e65a571e13404daf5642497322ef0f8a9c87
fix: 修改小程序框架
13个文件已添加
30个文件已修改
4250 ■■■■■ 已修改文件
apps/bMiniApp/.eslintrc-auto-import.json 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/auto-imports.d.ts 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/config/dev.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/config/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/project.config.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/project.private.config.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/constants/app.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/constants/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/stores/modules/user.ts 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/utils/request/index.ts 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/utils/storage/auth.ts 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/tsconfig.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/.eslintrc-auto-import.json 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/auto-imports.d.ts 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/config/dev.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/config/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/project.config.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/constants/app.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/constants/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/stores/modules/user.ts 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/utils/request/index.ts 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/utils/storage/auth.ts 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/tsconfig.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/openapi.json 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/constants/apiEnum.ts 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/constants/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/auth.ts 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/dictionary.ts 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/enterprise.ts 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/index.ts 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/menu.ts 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/resource.ts 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/role.ts 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/typings.d.ts 1101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/userInfo.ts 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/tsconfig.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/utils/common.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/utils/encrypt.ts 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/utils/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pnpm-lock.yaml 1908 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
types/api.d.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/.eslintrc-auto-import.json
@@ -86,6 +86,18 @@
    "onWatcherCleanup": true,
    "useId": true,
    "useModel": true,
    "useTemplateRef": true
    "useTemplateRef": true,
    "AppLocalConfig": true,
    "BackType": true,
    "OssAssets": true,
    "TabBarPageRouter": true,
    "myClient": true,
    "useAccessLogin": true,
    "useAuth": true,
    "useGoLogin": true,
    "useIsLogin": true,
    "useLoginedJump": true,
    "useSwitchTab": true,
    "useUser": true
  }
}
apps/bMiniApp/auto-imports.d.ts
@@ -5,8 +5,12 @@
// Generated by unplugin-auto-import
export {}
declare global {
  const AppLocalConfig: typeof import('./src/constants/app')['AppLocalConfig']
  const BackType: typeof import('./src/constants/enum')['BackType']
  const EffectScope: typeof import('vue')['EffectScope']
  const RouterPath: typeof import('@/constants')['RouterPath']
  const OssAssets: typeof import('./src/constants/img')['OssAssets']
  const RouterPath: typeof import('./src/constants/router')['RouterPath']
  const TabBarPageRouter: typeof import('./src/constants/tabBar')['TabBarPageRouter']
  const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
  const computed: typeof import('vue')['computed']
  const createApp: typeof import('vue')['createApp']
@@ -31,6 +35,7 @@
  const mapStores: typeof import('pinia')['mapStores']
  const mapWritableState: typeof import('pinia')['mapWritableState']
  const markRaw: typeof import('vue')['markRaw']
  const myClient: typeof import('./src/constants/query')['myClient']
  const nextTick: typeof import('vue')['nextTick']
  const onActivated: typeof import('vue')['onActivated']
  const onBeforeMount: typeof import('vue')['onBeforeMount']
@@ -65,18 +70,25 @@
  const toValue: typeof import('vue')['toValue']
  const triggerRef: typeof import('vue')['triggerRef']
  const unref: typeof import('vue')['unref']
  const useAccessLogin: typeof import('./src/hooks/access')['useAccessLogin']
  const useAttrs: typeof import('vue')['useAttrs']
  const useAuth: typeof import('./src/hooks/user')['useAuth']
  const useCssModule: typeof import('vue')['useCssModule']
  const useCssVars: typeof import('vue')['useCssVars']
  const useGoLogin: typeof import('./src/hooks/user')['useGoLogin']
  const useId: typeof import('vue')['useId']
  const useIsLogin: typeof import('./src/hooks/user')['useIsLogin']
  const useLink: typeof import('vue-router')['useLink']
  const useLoginedJump: typeof import('./src/hooks/login')['useLoginedJump']
  const useModel: typeof import('vue')['useModel']
  const useOmitProps: typeof import('@/hooks')['useOmitProps']
  const usePickProps: typeof import('@/hooks')['usePickProps']
  const useRoute: typeof import('vue-router')['useRoute']
  const useRouter: typeof import('vue-router')['useRouter']
  const useSlots: typeof import('vue')['useSlots']
  const useSwitchTab: typeof import('./src/hooks/router')['useSwitchTab']
  const useTemplateRef: typeof import('vue')['useTemplateRef']
  const useUser: typeof import('./src/hooks/user')['useUser']
  const watch: typeof import('vue')['watch']
  const watchEffect: typeof import('vue')['watchEffect']
  const watchPostEffect: typeof import('vue')['watchPostEffect']
@@ -87,4 +99,102 @@
  // @ts-ignore
  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
  import('vue')
  // @ts-ignore
  export type { BackType, BackType } from './src/constants/enum'
  import('./src/constants/enum')
  // @ts-ignore
  export type { RouterPath, RouterPath } from './src/constants/router'
  import('./src/constants/router')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
  interface ComponentCustomProperties {
    readonly AppLocalConfig: UnwrapRef<typeof import('./src/constants/app')['AppLocalConfig']>
    readonly BackType: UnwrapRef<typeof import('./src/constants/enum')['BackType']>
    readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
    readonly OssAssets: UnwrapRef<typeof import('./src/constants/img')['OssAssets']>
    readonly RouterPath: UnwrapRef<typeof import('./src/constants/router')['RouterPath']>
    readonly TabBarPageRouter: UnwrapRef<typeof import('./src/constants/tabBar')['TabBarPageRouter']>
    readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
    readonly computed: UnwrapRef<typeof import('vue')['computed']>
    readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
    readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
    readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
    readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
    readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
    readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
    readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
    readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
    readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
    readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
    readonly h: UnwrapRef<typeof import('vue')['h']>
    readonly inject: UnwrapRef<typeof import('vue')['inject']>
    readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
    readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
    readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
    readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
    readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
    readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
    readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
    readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
    readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
    readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
    readonly myClient: UnwrapRef<typeof import('./src/constants/query')['myClient']>
    readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
    readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
    readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
    readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
    readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
    readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
    readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
    readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
    readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
    readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
    readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
    readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
    readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
    readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
    readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
    readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
    readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
    readonly provide: UnwrapRef<typeof import('vue')['provide']>
    readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
    readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
    readonly ref: UnwrapRef<typeof import('vue')['ref']>
    readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
    readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
    readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
    readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
    readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
    readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
    readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
    readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
    readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
    readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
    readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
    readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
    readonly unref: UnwrapRef<typeof import('vue')['unref']>
    readonly useAccessLogin: UnwrapRef<typeof import('./src/hooks/access')['useAccessLogin']>
    readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
    readonly useAuth: UnwrapRef<typeof import('./src/hooks/user')['useAuth']>
    readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
    readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
    readonly useGoLogin: UnwrapRef<typeof import('./src/hooks/user')['useGoLogin']>
    readonly useId: UnwrapRef<typeof import('vue')['useId']>
    readonly useIsLogin: UnwrapRef<typeof import('./src/hooks/user')['useIsLogin']>
    readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
    readonly useLoginedJump: UnwrapRef<typeof import('./src/hooks/login')['useLoginedJump']>
    readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
    readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
    readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
    readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
    readonly useSwitchTab: UnwrapRef<typeof import('./src/hooks/router')['useSwitchTab']>
    readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
    readonly useUser: UnwrapRef<typeof import('./src/hooks/user')['useUser']>
    readonly watch: UnwrapRef<typeof import('vue')['watch']>
    readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
    readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
    readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
  }
}
apps/bMiniApp/config/dev.js
@@ -3,7 +3,7 @@
module.exports = {
  env: {
    NODE_ENV: '"development"',
    BASE_URL: '"http://localhost:58190"',
    BASE_URL: '"http://localhost:53780"',
    BASE_URL_JX: '"https://api.jx818.com"',
    OSS_URL: '"https://waterdroptest2.oss-cn-hangzhou.aliyuncs.com/"',
apps/bMiniApp/config/index.js
@@ -113,7 +113,13 @@
      chain.plugin('unplugin-auto-import').use(
        AutoImport({
          imports: ['vue', 'pinia', 'vue-router', { '@/constants': ['RouterPath'] }],
          dirs: ['./src/constants/**', './src/hooks/**'],
          // dirsScanOptions: {
          //   fileFilter: (file) => file.endsWith('.ts'), // Filter files
          //   types: true,
          // },
          vueTemplate: true,
          imports: ['vue', 'pinia', 'vue-router'],
          eslintrc: {
            enabled: true, // Default `false`
            filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
apps/bMiniApp/project.config.json
@@ -3,8 +3,8 @@
    "description": "",
    "setting": {
        "urlCheck": false,
        "es6": false,
        "enhance": false,
        "es6": true,
        "enhance": true,
        "postcss": false,
        "preloadBackgroundData": false,
        "minified": false,
apps/bMiniApp/project.private.config.json
@@ -9,6 +9,13 @@
        "miniprogram": {
            "list": [
                {
                    "name": "设置",
                    "pathName": "subpackages/mine/setting/setting",
                    "query": "",
                    "launchMode": "default",
                    "scene": null
                },
                {
                    "name": "安排任务",
                    "pathName": "subpackages/task/batchTaskList/batchTaskList",
                    "query": "id=57a8f533-2a46-7a88-e008-3a1775810dd2",
apps/bMiniApp/src/constants/app.ts
New file
@@ -0,0 +1,6 @@
import { EnumUserType, EnumClientType } from '@12333/constants';
export const AppLocalConfig = {
  userType: EnumUserType.Operation,
  clientType: EnumClientType.PcWeb,
};
apps/bMiniApp/src/constants/index.ts
@@ -2,3 +2,4 @@
export * from './tabBar';
export * from './router';
export * from './img';
export * from './app';
apps/bMiniApp/src/stores/modules/user.ts
@@ -8,9 +8,6 @@
  setUserDetail,
  getUserDetail,
  removeUserDetail,
  removeMatchMakingIdentity,
  getMatchMakingIdentity,
  setMatchMakingIdentity,
} from '@/utils/storage/auth';
import * as accountServices from '@12333/services/api/Account';
// import * as userServices from '@12333/services/api/User';
@@ -24,14 +21,17 @@
  setOSSLink,
  getUserCertificationFrontStatusAdapter,
  LocationUtils,
  md5Encrypt,
} from '@12333/utils';
import DefaultAvatar from '@/assets/components/icon-default-avatar.png';
import { WxMiniAppEnum } from '@12333/constants';
import { myClient } from '@/constants/query';
import { globalEventEmitter } from '@12333/hooks';
import * as authServices from '@12333/services/apiV2/auth';
import { AppLocalConfig } from '@/constants';
interface UserState {
  userInfo?: Nullable<API.IdentityModelTokenCacheItem>;
  userInfo?: Nullable<API.PasswordLoginCommandCallback>;
  token?: Nullable<string>;
  refreshToken?: Nullable<string>;
  userDetail?: Nullable<API.UserInfoV2>;
@@ -80,15 +80,6 @@
    };
  },
  getters: {
    cacheToken: (state) => {
      if (!state.token) {
        const storageToken = getCacheToken() as API.IdentityModelTokenCacheItem;
        state.token = storageToken.accessToken;
      }
      return state.token || null;
    },
    cacheRefreshToken: (state) => {
      return state.refreshToken;
    },
@@ -143,11 +134,13 @@
    },
    // 用户账号密码登入
    async loginByPassword(data: API.AccessRequestDto) {
      let res = await accountServices.passwordLogin(
    async loginByPassword(params: API.PasswordLoginCommand) {
      let res = await authServices.passwordLogin(
        {
          loginName: data.userName,
          password: data.userPassword,
          userName: params.userName,
          password: md5Encrypt(params.password),
          type: AppLocalConfig.userType,
          clientType: AppLocalConfig.clientType,
        },
        { showLoading: false }
      );
@@ -234,7 +227,6 @@
      this.userDetail = null;
      removeUserInfo();
      removeUserDetail();
      removeMatchMakingIdentity();
    },
    /**
@@ -268,23 +260,6 @@
        Taro.redirectTo({
          url: `/packageLogin/authLogin/index`,
        });
      }
    },
    async getTokenByRefreshToken(params: API.AccessRefreshToken) {
      try {
        const res = await accountServices.getTokenByRefreshToken(params, {
          showLoading: false,
        });
        if (res) {
          this.setTokenAction(res);
          this.setUserInfoAction(res);
          return res;
        } else {
          throw new Error('刷新token失败');
        }
      } catch (error) {
        throw new Error('error');
      }
    },
apps/bMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue
@@ -77,7 +77,7 @@
        form.loading = true;
        await userStore.loginByPassword({
          userName: form.userName,
          userPassword: form.userPassword,
          password: form.userPassword,
        });
        jump();
      }
apps/bMiniApp/src/utils/request/index.ts
@@ -4,7 +4,6 @@
import Taro from '@tarojs/taro';
import { getToken } from '@/utils';
import { tokenIsExpired, Message, SensitiveManage } from '@12333/utils';
import * as accountServices from '@12333/services/api/Account';
import { useUserStoreWithOut } from '@/stores/modules/user';
const RefreshTokenUrl = '/gettokenbyrefreshtoken';
@@ -51,9 +50,13 @@
  success: boolean;
  data: any;
  /**
   * http状态吗
   */
  code?: number;
  /**
   * 错误码
   */
  error?: number;
  errorCode?: string;
  /**
   * 错误信息
   */
@@ -150,7 +153,7 @@
    // 错误抛出
    errorThrower: (res) => {
      const { success, data, error: errorCode, msg, showType } = res;
      const { success, data, errorCode, msg, showType } = res;
      if (!success) {
        const error: any = new Error(msg);
        error.name = 'BizError';
@@ -190,34 +193,9 @@
        return new Promise((resolve, reject) => {
          if (userInfo && token && $config.withCredentials) {
            if (tokenIsExpired(userInfo)) {
              if (!Request.refreshTokenPending) {
                Request.refreshTokenPending = true;
                // token过期刷新
                useUserStoreWithOut()
                  .getTokenByRefreshToken({
                    refreshToken: userInfo.refreshToken,
                    clientId: userStore.accountInfo?.client_id,
                  })
                  .then((res) => {
                    $config.headers['Authorization'] = 'Bearer ' + res.accessToken;
                    Request.requests.forEach((cb) => cb(res.accessToken));
                    Request.requests = [];
                  })
                  .catch((err) => {
                    Request.requests.forEach((cb) => cb());
                    Request.requests = [];
                    reject(err);
                  })
                  .finally(() => {
                    Request.refreshTokenPending = false;
                  });
              }
              resolve(Request.retryOriginalRequest($config));
            } else {
              $config.headers['Authorization'] = 'Bearer ' + token;
              resolve($config);
            }
            $config.headers['Authorization'] = 'Bearer ' + userInfo.accessToken;
            $config.headers['X-Authorization'] = 'Bearer ' + userInfo.refreshToken;
            resolve($config);
          } else {
            resolve($config);
          }
@@ -236,11 +214,20 @@
        const { needNProcess, getResponse = false } = $config;
        const userStore = useUserStoreWithOut();
        if (response.headers['x-access-token']) {
          const tokenInfo: API.PasswordLoginCommandCallback = {
            accessToken: response.headers['access-token'],
            refreshToken: response.headers['x-access-token'],
          };
          userStore.setTokenAction(tokenInfo);
          userStore.setUserInfoAction(tokenInfo);
        }
        endLoading();
        return getResponse
          ? response
          : SensitiveManage.filterSensitiveWord((response.data as any).result);
        return getResponse ? response : SensitiveManage.filterSensitiveWord(response.data.data);
      },
      (error) => {
        endLoading();
apps/bMiniApp/src/utils/storage/auth.ts
@@ -1,6 +1,5 @@
import { storageLocal } from './storage';
import { useUserStoreWithOut } from '@/stores/modules/user';
import { MatchMakingIdentityEnum } from '@12333/constants';
const StorageKey = {
  USER_INFO_KEY: 'USER__INFO__',
@@ -18,10 +17,10 @@
}
export function getUserInfo() {
  return storageLocal.getItem<API.IdentityModelTokenCacheItem>(StorageKey.USER_INFO_KEY);
  return storageLocal.getItem<API.PasswordLoginCommandCallback>(StorageKey.USER_INFO_KEY);
}
export function setUserInfo(userInfo: API.IdentityModelTokenCacheItem) {
export function setUserInfo(userInfo: API.PasswordLoginCommandCallback) {
  return storageLocal.setItem(StorageKey.USER_INFO_KEY, userInfo);
}
@@ -39,18 +38,6 @@
export function removeUserDetail() {
  return storageLocal.removeItem(StorageKey.USER_DETAIL_KEY);
}
export function getMatchMakingIdentity() {
  return storageLocal.getItem<MatchMakingIdentityEnum>(StorageKey.MatchMakingIdentity_KEY);
}
export function setMatchMakingIdentity(matchMakingIdentity: MatchMakingIdentityEnum) {
  return storageLocal.setItem(StorageKey.MatchMakingIdentity_KEY, matchMakingIdentity);
}
export function removeMatchMakingIdentity() {
  return storageLocal.removeItem(StorageKey.MatchMakingIdentity_KEY);
}
type StorageLocation = {
apps/bMiniApp/tsconfig.json
@@ -11,6 +11,7 @@
    "types": [
      "node",
      "@12333/services/api/typings.d.ts",
      "@12333/services/apiV2/typings.d.ts",
      "@12333/services/types.d.ts",
      "@12333/services/globalType.d.ts",
      "@tarojs/components/vue3"
apps/cMiniApp/.eslintrc-auto-import.json
@@ -3,10 +3,19 @@
    "Component": true,
    "ComponentPublicInstance": true,
    "ComputedRef": true,
    "DirectiveBinding": true,
    "EffectScope": true,
    "ExtractDefaultPropTypes": true,
    "ExtractPropTypes": true,
    "ExtractPublicPropTypes": true,
    "InjectionKey": true,
    "MaybeRef": true,
    "MaybeRefOrGetter": true,
    "PropType": true,
    "Ref": true,
    "RouterPath": true,
    "Slot": true,
    "Slots": true,
    "VNode": true,
    "WritableComputedRef": true,
    "acceptHMRUpdate": true,
@@ -49,6 +58,7 @@
    "onServerPrefetch": true,
    "onUnmounted": true,
    "onUpdated": true,
    "onWatcherCleanup": true,
    "provide": true,
    "reactive": true,
    "readonly": true,
@@ -69,23 +79,35 @@
    "useAttrs": true,
    "useCssModule": true,
    "useCssVars": true,
    "useId": true,
    "useLink": true,
    "useModel": true,
    "useRoute": true,
    "useRouter": true,
    "useSlots": true,
    "useTemplateRef": true,
    "watch": true,
    "watchEffect": true,
    "watchPostEffect": true,
    "watchSyncEffect": true,
    "useOmitProps": true,
    "usePickProps": true,
    "RouterPath": true,
    "ExtractDefaultPropTypes": true,
    "ExtractPropTypes": true,
    "ExtractPublicPropTypes": true,
    "onWatcherCleanup": true,
    "useId": true,
    "useModel": true,
    "useTemplateRef": true
    "AppLocalConfig": true,
    "BackType": true,
    "HomeOrderType": true,
    "OssAssets": true,
    "TabBarPageRouter": true,
    "TaskStatus": true,
    "TaskStatusColor": true,
    "TaskStatusText": true,
    "myClient": true,
    "useAccessLogin": true,
    "useAccessPersonalInfo": true,
    "useAuth": true,
    "useGoLogin": true,
    "useIsLogin": true,
    "useLoginedJump": true,
    "useMyCertificationAuditInfo": true,
    "useSwitchTab": true,
    "useTaskList": true,
    "useUser": true
  }
}
apps/cMiniApp/auto-imports.d.ts
@@ -5,8 +5,16 @@
// Generated by unplugin-auto-import
export {}
declare global {
  const AppLocalConfig: typeof import('./src/constants/app')['AppLocalConfig']
  const BackType: typeof import('./src/constants/enum')['BackType']
  const EffectScope: typeof import('vue')['EffectScope']
  const RouterPath: typeof import('@/constants')['RouterPath']
  const HomeOrderType: typeof import('./src/hooks/task')['HomeOrderType']
  const OssAssets: typeof import('./src/constants/img')['OssAssets']
  const RouterPath: typeof import('./src/constants/router')['RouterPath']
  const TabBarPageRouter: typeof import('./src/constants/tabBar')['TabBarPageRouter']
  const TaskStatus: typeof import('./src/constants/task')['TaskStatus']
  const TaskStatusColor: typeof import('./src/constants/task')['TaskStatusColor']
  const TaskStatusText: typeof import('./src/constants/task')['TaskStatusText']
  const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
  const computed: typeof import('vue')['computed']
  const createApp: typeof import('vue')['createApp']
@@ -31,6 +39,7 @@
  const mapStores: typeof import('pinia')['mapStores']
  const mapWritableState: typeof import('pinia')['mapWritableState']
  const markRaw: typeof import('vue')['markRaw']
  const myClient: typeof import('./src/constants/query')['myClient']
  const nextTick: typeof import('vue')['nextTick']
  const onActivated: typeof import('vue')['onActivated']
  const onBeforeMount: typeof import('vue')['onBeforeMount']
@@ -65,18 +74,28 @@
  const toValue: typeof import('vue')['toValue']
  const triggerRef: typeof import('vue')['triggerRef']
  const unref: typeof import('vue')['unref']
  const useAccessLogin: typeof import('./src/hooks/access')['useAccessLogin']
  const useAccessPersonalInfo: typeof import('./src/hooks/access')['useAccessPersonalInfo']
  const useAttrs: typeof import('vue')['useAttrs']
  const useAuth: typeof import('./src/hooks/user')['useAuth']
  const useCssModule: typeof import('vue')['useCssModule']
  const useCssVars: typeof import('vue')['useCssVars']
  const useGoLogin: typeof import('./src/hooks/user')['useGoLogin']
  const useId: typeof import('vue')['useId']
  const useIsLogin: typeof import('./src/hooks/user')['useIsLogin']
  const useLink: typeof import('vue-router')['useLink']
  const useLoginedJump: typeof import('./src/hooks/login')['useLoginedJump']
  const useModel: typeof import('vue')['useModel']
  const useMyCertificationAuditInfo: typeof import('./src/hooks/authentication')['useMyCertificationAuditInfo']
  const useOmitProps: typeof import('@/hooks')['useOmitProps']
  const usePickProps: typeof import('@/hooks')['usePickProps']
  const useRoute: typeof import('vue-router')['useRoute']
  const useRouter: typeof import('vue-router')['useRouter']
  const useSlots: typeof import('vue')['useSlots']
  const useSwitchTab: typeof import('./src/hooks/router')['useSwitchTab']
  const useTaskList: typeof import('./src/hooks/task')['useTaskList']
  const useTemplateRef: typeof import('vue')['useTemplateRef']
  const useUser: typeof import('./src/hooks/user')['useUser']
  const watch: typeof import('vue')['watch']
  const watchEffect: typeof import('vue')['watchEffect']
  const watchPostEffect: typeof import('vue')['watchPostEffect']
@@ -87,4 +106,115 @@
  // @ts-ignore
  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
  import('vue')
  // @ts-ignore
  export type { BackType, BackType } from './src/constants/enum'
  import('./src/constants/enum')
  // @ts-ignore
  export type { RouterPath, RouterPath } from './src/constants/router'
  import('./src/constants/router')
  // @ts-ignore
  export type { TaskStatus, TaskStatus } from './src/constants/task'
  import('./src/constants/task')
  // @ts-ignore
  export type { HomeOrderType, HomeOrderType } from './src/hooks/task'
  import('./src/hooks/task')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
  interface ComponentCustomProperties {
    readonly AppLocalConfig: UnwrapRef<typeof import('./src/constants/app')['AppLocalConfig']>
    readonly BackType: UnwrapRef<typeof import('./src/constants/enum')['BackType']>
    readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
    readonly HomeOrderType: UnwrapRef<typeof import('./src/hooks/task')['HomeOrderType']>
    readonly OssAssets: UnwrapRef<typeof import('./src/constants/img')['OssAssets']>
    readonly RouterPath: UnwrapRef<typeof import('./src/constants/router')['RouterPath']>
    readonly TabBarPageRouter: UnwrapRef<typeof import('./src/constants/tabBar')['TabBarPageRouter']>
    readonly TaskStatus: UnwrapRef<typeof import('./src/constants/task')['TaskStatus']>
    readonly TaskStatusColor: UnwrapRef<typeof import('./src/constants/task')['TaskStatusColor']>
    readonly TaskStatusText: UnwrapRef<typeof import('./src/constants/task')['TaskStatusText']>
    readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
    readonly computed: UnwrapRef<typeof import('vue')['computed']>
    readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
    readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
    readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
    readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
    readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
    readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
    readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
    readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
    readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
    readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
    readonly h: UnwrapRef<typeof import('vue')['h']>
    readonly inject: UnwrapRef<typeof import('vue')['inject']>
    readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
    readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
    readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
    readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
    readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
    readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
    readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
    readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
    readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
    readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
    readonly myClient: UnwrapRef<typeof import('./src/constants/query')['myClient']>
    readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
    readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
    readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
    readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
    readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
    readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
    readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
    readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
    readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
    readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
    readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
    readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
    readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
    readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
    readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
    readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
    readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
    readonly provide: UnwrapRef<typeof import('vue')['provide']>
    readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
    readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
    readonly ref: UnwrapRef<typeof import('vue')['ref']>
    readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
    readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
    readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
    readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
    readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
    readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
    readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
    readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
    readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
    readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
    readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
    readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
    readonly unref: UnwrapRef<typeof import('vue')['unref']>
    readonly useAccessLogin: UnwrapRef<typeof import('./src/hooks/access')['useAccessLogin']>
    readonly useAccessPersonalInfo: UnwrapRef<typeof import('./src/hooks/access')['useAccessPersonalInfo']>
    readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
    readonly useAuth: UnwrapRef<typeof import('./src/hooks/user')['useAuth']>
    readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
    readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
    readonly useGoLogin: UnwrapRef<typeof import('./src/hooks/user')['useGoLogin']>
    readonly useId: UnwrapRef<typeof import('vue')['useId']>
    readonly useIsLogin: UnwrapRef<typeof import('./src/hooks/user')['useIsLogin']>
    readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
    readonly useLoginedJump: UnwrapRef<typeof import('./src/hooks/login')['useLoginedJump']>
    readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
    readonly useMyCertificationAuditInfo: UnwrapRef<typeof import('./src/hooks/authentication')['useMyCertificationAuditInfo']>
    readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
    readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
    readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
    readonly useSwitchTab: UnwrapRef<typeof import('./src/hooks/router')['useSwitchTab']>
    readonly useTaskList: UnwrapRef<typeof import('./src/hooks/task')['useTaskList']>
    readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
    readonly useUser: UnwrapRef<typeof import('./src/hooks/user')['useUser']>
    readonly watch: UnwrapRef<typeof import('vue')['watch']>
    readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
    readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
    readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
  }
}
apps/cMiniApp/config/dev.js
@@ -3,7 +3,7 @@
module.exports = {
  env: {
    NODE_ENV: '"development"',
    BASE_URL: '"http://localhost:58190"',
    BASE_URL: '"http://localhost:53780"',
    BASE_URL_JX: '"https://api.jx818.com"',
    OSS_URL: '"https://waterdroptest2.oss-cn-hangzhou.aliyuncs.com/"',
apps/cMiniApp/config/index.js
@@ -111,7 +111,13 @@
      chain.plugin('unplugin-auto-import').use(
        AutoImport({
          imports: ['vue', 'pinia', 'vue-router', { '@/constants': ['RouterPath'] }],
          dirs: ['./src/constants/**', './src/hooks/**'],
          // dirsScanOptions: {
          //   fileFilter: (file) => file.endsWith('.ts'), // Filter files
          //   types: true,
          // },
          vueTemplate: true,
          imports: ['vue', 'pinia', 'vue-router'],
          eslintrc: {
            enabled: true, // Default `false`
            filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
apps/cMiniApp/project.config.json
@@ -3,8 +3,8 @@
    "description": "",
    "setting": {
        "urlCheck": false,
        "es6": false,
        "enhance": false,
        "es6": true,
        "enhance": true,
        "postcss": false,
        "preloadBackgroundData": false,
        "minified": false,
apps/cMiniApp/src/constants/app.ts
New file
@@ -0,0 +1,6 @@
import { EnumUserType, EnumClientType } from '@12333/constants';
export const AppLocalConfig = {
  userType: EnumUserType.Operation,
  clientType: EnumClientType.PcWeb,
};
apps/cMiniApp/src/constants/index.ts
@@ -3,3 +3,4 @@
export * from './router';
export * from './img';
export * from './task';
export * from './app';
apps/cMiniApp/src/stores/modules/user.ts
@@ -8,9 +8,6 @@
  setUserDetail,
  getUserDetail,
  removeUserDetail,
  removeMatchMakingIdentity,
  getMatchMakingIdentity,
  setMatchMakingIdentity,
} from '@/utils/storage/auth';
import * as accountServices from '@12333/services/api/Account';
import * as userServices from '@12333/services/api/User';
@@ -24,14 +21,17 @@
  setOSSLink,
  getUserCertificationFrontStatusAdapter,
  LocationUtils,
  md5Encrypt,
} from '@12333/utils';
import DefaultAvatar from '@/assets/components/icon-default-avatar.png';
import { WxMiniAppEnum } from '@12333/constants';
import { myClient } from '@/constants/query';
import { globalEventEmitter } from '@12333/hooks';
import * as authServices from '@12333/services/apiV2/auth';
import { AppLocalConfig } from '@/constants';
interface UserState {
  userInfo?: Nullable<API.IdentityModelTokenCacheItem>;
  userInfo?: Nullable<API.PasswordLoginCommandCallback>;
  token?: Nullable<string>;
  refreshToken?: Nullable<string>;
  userDetail?: Nullable<API.UserInfoV2>;
@@ -80,15 +80,6 @@
    };
  },
  getters: {
    cacheToken: (state) => {
      if (!state.token) {
        const storageToken = getCacheToken() as API.IdentityModelTokenCacheItem;
        state.token = storageToken.accessToken;
      }
      return state.token || null;
    },
    cacheRefreshToken: (state) => {
      return state.refreshToken;
    },
@@ -96,10 +87,6 @@
    accountInfo(): Partial<AccountInfo> {
      return getAccountInfoFromAccessToken(this.userInfo?.accessToken);
    },
    // matchMakingIdentity(state): MatchMakingIdentityEnum {
    // },
  },
  actions: {
    // 手机号授权Code登录
@@ -143,11 +130,13 @@
    },
    // 用户账号密码登入
    async loginByPassword(data: API.AccessRequestDto) {
      let res = await accountServices.passwordLogin(
    async loginByPassword(params: API.PasswordLoginCommand) {
      let res = await authServices.passwordLogin(
        {
          loginName: data.userName,
          password: data.userPassword,
          userName: params.userName,
          password: md5Encrypt(params.password),
          type: AppLocalConfig.userType,
          clientType: AppLocalConfig.clientType,
        },
        { showLoading: false }
      );
@@ -157,7 +146,7 @@
      return res;
    },
    async loginSuccess(res: API.IdentityModelTokenCacheItem) {
    async loginSuccess(res: API.PasswordLoginCommandCallback) {
      try {
        this.setUserInfoAction(res);
        this.setTokenAction(res);
@@ -200,24 +189,24 @@
      try {
        let res = await userServices.getUserInfo({ showLoading: false });
        if (res) {
          res.frontStatus = getUserCertificationFrontStatusAdapter(
            res.userCertificationStatus,
            res.userCertificationAuditStatus
          );
          res.originalAvatarUrl = res.avatarUrl;
          res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
          this.setUserDetail(res);
          this.firstGetUserDetail = false;
          // res.frontStatus = getUserCertificationFrontStatusAdapter(
          //   res.userCertificationStatus,
          //   res.userCertificationAuditStatus
          // );
          // res.originalAvatarUrl = res.avatarUrl;
          // res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
          // this.setUserDetail(res);
          // this.firstGetUserDetail = false;
        }
      } catch (error) {}
    },
    setTokenAction(tokenInfo: API.IdentityModelTokenCacheItem) {
    setTokenAction(tokenInfo: API.PasswordLoginCommandCallback) {
      this.token = tokenInfo?.accessToken;
      this.refreshToken = tokenInfo.refreshToken ?? '';
    },
    setUserInfoAction(info: API.IdentityModelTokenCacheItem) {
    setUserInfoAction(info: API.PasswordLoginCommandCallback) {
      this.userInfo = info;
      setUserInfo(info);
    },
@@ -234,7 +223,6 @@
      this.userDetail = null;
      removeUserInfo();
      removeUserDetail();
      removeMatchMakingIdentity();
    },
    /**
@@ -268,23 +256,6 @@
        Taro.redirectTo({
          url: `/packageLogin/authLogin/index`,
        });
      }
    },
    async getTokenByRefreshToken(params: API.AccessRefreshToken) {
      try {
        const res = await accountServices.getTokenByRefreshToken(params, {
          showLoading: false,
        });
        if (res) {
          this.setTokenAction(res);
          this.setUserInfoAction(res);
          return res;
        } else {
          throw new Error('刷新token失败');
        }
      } catch (error) {
        throw new Error('error');
      }
    },
apps/cMiniApp/src/subpackages/login/loginByForm/accountLoginForm.vue
@@ -77,7 +77,7 @@
        form.loading = true;
        await userStore.loginByPassword({
          userName: form.userName,
          userPassword: form.userPassword,
          password: form.userPassword,
        });
        jump();
      }
apps/cMiniApp/src/utils/request/index.ts
@@ -4,7 +4,6 @@
import Taro from '@tarojs/taro';
import { getToken } from '@/utils';
import { tokenIsExpired, Message, SensitiveManage } from '@12333/utils';
import * as accountServices from '@12333/services/api/Account';
import { useUserStoreWithOut } from '@/stores/modules/user';
const RefreshTokenUrl = '/gettokenbyrefreshtoken';
@@ -51,9 +50,13 @@
  success: boolean;
  data: any;
  /**
   * http状态吗
   */
  code?: number;
  /**
   * 错误码
   */
  error?: number;
  errorCode?: string;
  /**
   * 错误信息
   */
@@ -150,7 +153,7 @@
    // 错误抛出
    errorThrower: (res) => {
      const { success, data, error: errorCode, msg, showType } = res;
      const { success, data, errorCode, msg, showType } = res;
      if (!success) {
        const error: any = new Error(msg);
        error.name = 'BizError';
@@ -190,34 +193,9 @@
        return new Promise((resolve, reject) => {
          if (userInfo && token && $config.withCredentials) {
            if (tokenIsExpired(userInfo)) {
              if (!Request.refreshTokenPending) {
                Request.refreshTokenPending = true;
                // token过期刷新
                useUserStoreWithOut()
                  .getTokenByRefreshToken({
                    refreshToken: userInfo.refreshToken,
                    clientId: userStore.accountInfo?.client_id,
                  })
                  .then((res) => {
                    $config.headers['Authorization'] = 'Bearer ' + res.accessToken;
                    Request.requests.forEach((cb) => cb(res.accessToken));
                    Request.requests = [];
                  })
                  .catch((err) => {
                    Request.requests.forEach((cb) => cb());
                    Request.requests = [];
                    reject(err);
                  })
                  .finally(() => {
                    Request.refreshTokenPending = false;
                  });
              }
              resolve(Request.retryOriginalRequest($config));
            } else {
              $config.headers['Authorization'] = 'Bearer ' + token;
              resolve($config);
            }
            $config.headers['Authorization'] = 'Bearer ' + userInfo.accessToken;
            $config.headers['X-Authorization'] = 'Bearer ' + userInfo.refreshToken;
            resolve($config);
          } else {
            resolve($config);
          }
@@ -236,11 +214,20 @@
        const { needNProcess, getResponse = false } = $config;
        const userStore = useUserStoreWithOut();
        if (response.headers['x-access-token']) {
          const tokenInfo: API.PasswordLoginCommandCallback = {
            accessToken: response.headers['access-token'],
            refreshToken: response.headers['x-access-token'],
          };
          userStore.setTokenAction(tokenInfo);
          userStore.setUserInfoAction(tokenInfo);
        }
        endLoading();
        return getResponse
          ? response
          : SensitiveManage.filterSensitiveWord((response.data as any).result);
        return getResponse ? response : SensitiveManage.filterSensitiveWord(response.data.data);
      },
      (error) => {
        endLoading();
apps/cMiniApp/src/utils/storage/auth.ts
@@ -1,6 +1,5 @@
import { storageLocal } from './storage';
import { useUserStoreWithOut } from '@/stores/modules/user';
import { MatchMakingIdentityEnum } from '@12333/constants';
const StorageKey = {
  USER_INFO_KEY: 'USER__INFO__',
@@ -18,10 +17,10 @@
}
export function getUserInfo() {
  return storageLocal.getItem<API.IdentityModelTokenCacheItem>(StorageKey.USER_INFO_KEY);
  return storageLocal.getItem<API.PasswordLoginCommandCallback>(StorageKey.USER_INFO_KEY);
}
export function setUserInfo(userInfo: API.IdentityModelTokenCacheItem) {
export function setUserInfo(userInfo: API.PasswordLoginCommandCallback) {
  return storageLocal.setItem(StorageKey.USER_INFO_KEY, userInfo);
}
@@ -39,18 +38,6 @@
export function removeUserDetail() {
  return storageLocal.removeItem(StorageKey.USER_DETAIL_KEY);
}
export function getMatchMakingIdentity() {
  return storageLocal.getItem<MatchMakingIdentityEnum>(StorageKey.MatchMakingIdentity_KEY);
}
export function setMatchMakingIdentity(matchMakingIdentity: MatchMakingIdentityEnum) {
  return storageLocal.setItem(StorageKey.MatchMakingIdentity_KEY, matchMakingIdentity);
}
export function removeMatchMakingIdentity() {
  return storageLocal.removeItem(StorageKey.MatchMakingIdentity_KEY);
}
type StorageLocation = {
apps/cMiniApp/tsconfig.json
@@ -11,6 +11,7 @@
    "types": [
      "node",
      "@12333/services/api/typings.d.ts",
      "@12333/services/apiV2/typings.d.ts",
      "@12333/services/types.d.ts",
      "@12333/services/globalType.d.ts",
      "@tarojs/components/vue3"
config/openapi.json
@@ -2,8 +2,11 @@
  "config": [
    {
      "requestLibPath": "import { request } from '@/utils/request'",
      "schemaPath": "http://localhost:58190/swagger/v1/swagger.json",
      "serversPath": "./packages/services"
      "schemaPath": "http://localhost:53780/swagger/Default/swagger.json",
      "serversPath": "./packages/services",
      "enumStyle": "enum",
      "projectName": "apiV2",
      "enumFilePath": "../../../packages/constants/apiEnum.ts"
    }
  ]
}
packages/constants/apiEnum.ts
New file
@@ -0,0 +1,106 @@
/* eslint-disable */
// @ts-ignore
/** 客户端类型 */
export enum EnumClientType {
  /**电脑网页 */
  PcWeb = 10,
  /**微信小程序 */
  Wxmp = 20,
}
/** 菜单类型 */
export enum EnumMenuType {
  /**菜单 */
  Menu = 10,
  /**页面 */
  Page = 20,
  /**模态框 */
  Modal = 30,
  /**按钮 */
  Button = 40,
  /**字段 */
  Field = 50,
}
/** 权限访问级别 */
export enum EnumMenuVisitLevel {
  /**所有人 */
  Everyone = 10,
  /**需要登录 */
  NeedLogin = 20,
  /**需要权限 */
  NeedPower = 30,
}
/** 分页列表排序 */
export enum EnumPagedListOrder {
  /**升序 */
  Asc = 0,
  /**降序 */
  Desc = 1,
}
/** 资源控制器 */
export enum EnumResourceController {
  /**数据字典 */
  Dictionary = 0,
  /**用户认证 */
  Auth = 1,
  /**用户菜单 */
  Menu = 2,
  /**用户资源 */
  Resource = 3,
  /**用户角色 */
  Role = 4,
  /**用户信息 */
  UserInfo = 5,
  /**企业信息 */
  Enterprise = 6,
}
/** 资源请求方式 */
export enum EnumResourceMethod {
  /**查询 */
  Get = 10,
  /**提交 */
  Post = 20,
  /**修改 */
  Put = 30,
  /**删除 */
  Delete = 40,
}
/** 角色接口数据权限 */
export enum EnumRoleWebApiDataPower {
  /**自定义 */
  Custom = 1,
  /**查询个人创建数据 */
  Creator = 10,
  /**查询当前部门数据 */
  CurrentDepartment = 20,
  /**查询当前及下级部门数据 */
  NestingDepartment = 21,
  /**查询当前企业所有数据 */
  CurrentEnterprise = 30,
  /**查询所有 */
  All = 999,
}
/** 用户信息状态 */
export enum EnumUserInfoStatus {
  /**正常 */
  Normal = 10,
  /**禁用 */
  Disabled = 100,
}
/** 用户类型 */
export enum EnumUserType {
  /**个人 */
  Personal = 10,
  /**企业 */
  Enterprise = 20,
  /**运营 */
  Operation = 100,
}
packages/constants/index.ts
@@ -12,3 +12,4 @@
export * from './authenticationV2';
export * from './parkOrHR';
export * from './task';
export * from './apiEnum';
packages/services/apiV2/auth.ts
New file
@@ -0,0 +1,49 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 获取阿里云OSS授权信息 GET /api/user/auth/getAliyunOSSAcs */
export async function getAliyunOSSAcs(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetAliyunOSSAcsParams,
  options?: API.RequestConfig
) {
  return request<API.GetAliyunOSSAcsQueryResult>('/api/user/auth/getAliyunOSSAcs', {
    method: 'GET',
    params: {
      ...params,
      request: undefined,
      ...params['request'],
    },
    ...(options || {}),
  });
}
/** 获取当前登录用户菜单 GET /api/user/auth/getCurrentLogierMenus */
export async function getCurrentLogierMenus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetCurrentLogierMenusParams,
  options?: API.RequestConfig
) {
  return request<API.GetMenusQueryResultItem[]>('/api/user/auth/getCurrentLogierMenus', {
    method: 'GET',
    params: {
      ...params,
      request: undefined,
      ...params['request'],
    },
    ...(options || {}),
  });
}
/** 密码登录 POST /api/user/auth/passwordLogin */
export async function passwordLogin(body: API.PasswordLoginCommand, options?: API.RequestConfig) {
  return request<API.PasswordLoginCommandCallback>('/api/user/auth/passwordLogin', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
packages/services/apiV2/dictionary.ts
New file
@@ -0,0 +1,99 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 删除字典类别 DELETE /api/main/dictionary/deleteDictionaryCategory */
export async function deleteDictionaryCategory(
  body: API.DeleteDictionaryCategoryCommand,
  options?: API.RequestConfig
) {
  return request<number>('/api/main/dictionary/deleteDictionaryCategory', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 查询字典类别分页列表数据 POST /api/main/dictionary/getDictionaryCategories */
export async function getDictionaryCategories(
  body: API.GetDictionaryCategoriesQuery,
  options?: API.RequestConfig
) {
  return request<API.PagedListQueryResultGetDictionaryCategoriesQueryResultItem>(
    '/api/main/dictionary/getDictionaryCategories',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 获取字典数据分页列表 POST /api/main/dictionary/getDictionaryDatas */
export async function getDictionaryDatas(
  body: API.GetDictionaryDatasQuery,
  options?: API.RequestConfig
) {
  return request<API.PagedListQueryResultGetDictionaryDatasQueryResultItem>(
    '/api/main/dictionary/getDictionaryDatas',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 保存字典类别 POST /api/main/dictionary/saveDictionaryCategory */
export async function saveDictionaryCategory(
  body: API.SaveDictionaryCategoryCommand,
  options?: API.RequestConfig
) {
  return request<string>('/api/main/dictionary/saveDictionaryCategory', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 保存字典数据 POST /api/main/dictionary/saveDictionaryData */
export async function saveDictionaryData(
  body: API.SaveDictionaryDataCommand,
  options?: API.RequestConfig
) {
  return request<string>('/api/main/dictionary/saveDictionaryData', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置字典数据是否禁用 PUT /api/main/dictionary/setDictionaryDataIsDisabled */
export async function setDictionaryDataIsDisabled(
  body: API.SetDictionaryDataIsDisabledCommand,
  options?: API.RequestConfig
) {
  return request<number>('/api/main/dictionary/setDictionaryDataIsDisabled', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
packages/services/apiV2/enterprise.ts
New file
@@ -0,0 +1,18 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 查询企业信息分页列表数据 POST /api/user/enterprise/getEnterprises */
export async function getEnterprises(body: API.GetEnterprisesQuery, options?: API.RequestConfig) {
  return request<API.PagedListQueryResultGetEnterprisesQueryResultItem>(
    '/api/user/enterprise/getEnterprises',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
packages/services/apiV2/index.ts
New file
@@ -0,0 +1,20 @@
// @ts-ignore
/* eslint-disable */
// API 更新时间:
// API 唯一标识:
import * as dictionary from './dictionary';
import * as auth from './auth';
import * as enterprise from './enterprise';
import * as menu from './menu';
import * as resource from './resource';
import * as role from './role';
import * as userInfo from './userInfo';
export default {
  dictionary,
  auth,
  enterprise,
  menu,
  resource,
  role,
  userInfo,
};
packages/services/apiV2/menu.ts
New file
@@ -0,0 +1,93 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 删除菜单 DELETE /api/user/menu/deleteMenu */
export async function deleteMenu(body: API.DeleteMenuCommand, options?: API.RequestConfig) {
  return request<number>('/api/user/menu/deleteMenu', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 查询菜单详情 GET /api/user/menu/getMenu */
export async function getMenu(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetMenuParams,
  options?: API.RequestConfig
) {
  return request<API.GetMenuQueryResult>('/api/user/menu/getMenu', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 查询菜单列表 GET /api/user/menu/getMenus */
export async function getMenus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetMenusParams,
  options?: API.RequestConfig
) {
  return request<API.GetMenusQueryResultItem[]>('/api/user/menu/getMenus', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 保存菜单 POST /api/user/menu/saveMenu */
export async function saveMenu(body: API.SaveMenuCommand, options?: API.RequestConfig) {
  return request<string>('/api/user/menu/saveMenu', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 保存菜单按钮 POST /api/user/menu/saveMenuButton */
export async function saveMenuButton(body: API.SaveMenuButtonCommand, options?: API.RequestConfig) {
  return request<string>('/api/user/menu/saveMenuButton', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 保存菜单字段 POST /api/user/menu/saveMenuField */
export async function saveMenuField(body: API.SaveMenuFieldCommand, options?: API.RequestConfig) {
  return request<string>('/api/user/menu/saveMenuField', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置菜单切换信息 PUT /api/user/menu/setMenuSwitch */
export async function setMenuSwitch(body: API.SetMenuSwitchCommand, options?: API.RequestConfig) {
  return request<number>('/api/user/menu/setMenuSwitch', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
packages/services/apiV2/resource.ts
New file
@@ -0,0 +1,33 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 获取资源字段 GET /api/user/resource/getResourceFields */
export async function getResourceFields(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetResourceFieldsParams,
  options?: API.RequestConfig
) {
  return request<API.GetResourceFieldsQueryResultItem[]>('/api/user/resource/getResourceFields', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取资源列表 GET /api/user/resource/getResources */
export async function getResources(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetResourcesParams,
  options?: API.RequestConfig
) {
  return request<API.GetResourcesQueryResultItem[]>('/api/user/resource/getResources', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
packages/services/apiV2/role.ts
New file
@@ -0,0 +1,99 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 删除角色 DELETE /api/user/role/deleteRole */
export async function deleteRole(body: API.DeleteRoleCommand, options?: API.RequestConfig) {
  return request<number>('/api/user/role/deleteRole', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 查询角色详情 GET /api/user/role/getRole */
export async function getRole(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetRoleParams,
  options?: API.RequestConfig
) {
  return request<API.GetRoleQueryResult>('/api/user/role/getRole', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 查询角色分页列表 POST /api/user/role/getRoles */
export async function getRoles(body: API.GetRolesQuery, options?: API.RequestConfig) {
  return request<API.PagedListQueryResultGetRolesQueryResultItem>('/api/user/role/getRoles', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 查询角色用户列表 GET /api/user/role/getRoleUserInfos */
export async function getRoleUserInfos(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetRoleUserInfosParams,
  options?: API.RequestConfig
) {
  return request<API.GetRoleUserInfosQueryResultItem[]>('/api/user/role/getRoleUserInfos', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 保存角色 POST /api/user/role/saveRole */
export async function saveRole(body: API.SaveRoleCommand, options?: API.RequestConfig) {
  return request<string>('/api/user/role/saveRole', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置角色是否禁用 PUT /api/user/role/setRoleIsDisabled */
export async function setRoleIsDisabled(
  body: API.SetRoleIsDisabledCommand,
  options?: API.RequestConfig
) {
  return request<number>('/api/user/role/setRoleIsDisabled', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置角色用户 PUT /api/user/role/setRoleUserInfos */
export async function setRoleUserInfos(
  body: API.SetRoleUserInfosCommand,
  options?: API.RequestConfig
) {
  return request<number>('/api/user/role/setRoleUserInfos', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
packages/services/apiV2/typings.d.ts
New file
@@ -0,0 +1,1101 @@
declare namespace API {
  interface RequestConfig {
    [key: string]: any;
  }
  interface APIgetAliyunOSSAcsParams {
    /** 获取阿里云OSS授权信息 */
    request?: GetAliyunOSSAcsQuery;
  }
  interface APIgetCurrentLogierMenusParams {
    /** 获取当前登录用户菜单 */
    request?: GetCurrentLogierMenusQuery;
  }
  interface APIgetMenuParams {
    /** Id */
    id?: string;
    /** 角色Id */
    roleId?: string;
  }
  interface APIgetMenusParams {
    /** 用户类型 */
    userType?: EnumUserType;
    /** 客户端类型 */
    clientType?: EnumClientType;
    /** 角色Id */
    roleId?: string;
  }
  interface APIgetResourceFieldsParams {
    /** Id */
    id?: string;
  }
  interface APIgetResourcesParams {
    /** 请求方式 */
    method?: EnumResourceMethod;
    /** 关键字 */
    keywords?: string;
    /** 角色Id */
    roleId?: string;
  }
  interface APIgetRoleParams {
    /** Id */
    id?: string;
  }
  interface APIgetRoleUserInfosParams {
    /** 角色Id */
    roleId?: string;
  }
  interface APIgetUserInfoRolesParams {
    /** 用户Id */
    userInfoId?: string;
    /** 客户端类型 */
    clientType?: EnumClientType;
  }
  interface DeleteDictionaryCategoryCommand {
    ids: string[];
  }
  interface DeleteMenuCommand {
    ids: string[];
  }
  interface DeleteRoleCommand {
    ids: string[];
  }
  enum EnumClientType {
    /**电脑网页 */
    PcWeb = 10,
    /**微信小程序 */
    Wxmp = 20,
  }
  enum EnumMenuType {
    /**菜单 */
    Menu = 10,
    /**页面 */
    Page = 20,
    /**模态框 */
    Modal = 30,
    /**按钮 */
    Button = 40,
    /**字段 */
    Field = 50,
  }
  enum EnumMenuVisitLevel {
    /**所有人 */
    Everyone = 10,
    /**需要登录 */
    NeedLogin = 20,
    /**需要权限 */
    NeedPower = 30,
  }
  enum EnumPagedListOrder {
    /**升序 */
    Asc = 0,
    /**降序 */
    Desc = 1,
  }
  enum EnumResourceController {
    /**数据字典 */
    Dictionary = 0,
    /**用户认证 */
    Auth = 1,
    /**用户菜单 */
    Menu = 2,
    /**用户资源 */
    Resource = 3,
    /**用户角色 */
    Role = 4,
    /**用户信息 */
    UserInfo = 5,
    /**企业信息 */
    Enterprise = 6,
  }
  enum EnumResourceMethod {
    /**查询 */
    Get = 10,
    /**提交 */
    Post = 20,
    /**修改 */
    Put = 30,
    /**删除 */
    Delete = 40,
  }
  enum EnumRoleWebApiDataPower {
    /**自定义 */
    Custom = 1,
    /**查询个人创建数据 */
    Creator = 10,
    /**查询当前部门数据 */
    CurrentDepartment = 20,
    /**查询当前及下级部门数据 */
    NestingDepartment = 21,
    /**查询当前企业所有数据 */
    CurrentEnterprise = 30,
    /**查询所有 */
    All = 999,
  }
  enum EnumUserInfoStatus {
    /**正常 */
    Normal = 10,
    /**禁用 */
    Disabled = 100,
  }
  enum EnumUserType {
    /**个人 */
    Personal = 10,
    /**企业 */
    Enterprise = 20,
    /**运营 */
    Operation = 100,
  }
  interface FriendlyResultGetAliyunOSSAcsQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetAliyunOSSAcsQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetMenuQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetMenuQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetRoleQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetRoleQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGuid {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: string;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultInt32 {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: number;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetMenusQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetMenusQueryResultItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetResourceFieldsQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetResourceFieldsQueryResultItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetResourcesQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetResourcesQueryResultItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetRoleUserInfosQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetRoleUserInfosQueryResultItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetUserInfoRolesQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetUserInfoRolesQueryResultItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPagedListQueryResultGetDictionaryCategoriesQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PagedListQueryResultGetDictionaryCategoriesQueryResultItem;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPagedListQueryResultGetDictionaryDatasQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PagedListQueryResultGetDictionaryDatasQueryResultItem;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPagedListQueryResultGetEnterprisesQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PagedListQueryResultGetEnterprisesQueryResultItem;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPagedListQueryResultGetOperationUserInfosQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PagedListQueryResultGetOperationUserInfosQueryResultItem;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPagedListQueryResultGetRolesQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PagedListQueryResultGetRolesQueryResultItem;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPasswordLoginCommandCallback {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PasswordLoginCommandCallback;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  type GetAliyunOSSAcsQuery = Record<string, any>;
  interface GetAliyunOSSAcsQueryResult {
    expiration?: string;
    ossAccessSecret?: string;
    ossAccessKeyId?: string;
    securityToken?: string;
    requestId?: string;
  }
  type GetCurrentLogierMenusQuery = Record<string, any>;
  interface GetDictionaryCategoriesQuery {
    pageModel?: PagedListQueryPageModel;
    /** 关键字 */
    keywords?: string;
  }
  interface GetDictionaryCategoriesQueryResultItem {
    /** Id */
    id?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 字段名(逗号隔开) */
    fieldNames?: string;
    /** 排序 */
    sort?: number;
  }
  interface GetDictionaryDatasQuery {
    pageModel?: PagedListQueryPageModel;
    /** 类别Id */
    categoryId?: string;
    /** 关键字 */
    keywords?: string;
  }
  interface GetDictionaryDatasQueryResultItem {
    /** Id */
    id?: string;
    /** 类别Id */
    categoryId?: string;
    /** 上级Id */
    parentId?: string;
    /** 编号 */
    code?: string;
    /** 显示内容 */
    content: string;
    /** 字段1 */
    field1?: string;
    /** 字段2 */
    field2?: string;
    /** 字段3 */
    field3?: string;
    /** 字段4 */
    field4?: string;
    /** 字段5 */
    field5?: string;
    /** 排序 */
    sort?: number;
    /** 是否禁用 */
    isDisabled?: boolean;
  }
  interface GetEnterprisesQuery {
    pageModel?: PagedListQueryPageModel;
    /** 关键字 */
    keywords?: string;
    /** 是否已配置 */
    isConfigured?: boolean;
  }
  interface GetEnterprisesQueryResultItem {
    /** Id */
    id?: string;
    /** 企业全称 */
    enterpriseName?: string;
    /** 法人姓名 */
    legalPerson?: string;
    /** 统一社会信用代码 */
    societyCreditCode?: string;
    /** 联系人 */
    contacts?: string;
    /** 联系电话 */
    contactNumber?: string;
  }
  interface GetMenuQueryResult {
    /** Id */
    id?: string;
    /** 是否选择(用户角色授权) */
    isChecked?: boolean;
    userType?: EnumUserType;
    clientType?: EnumClientType;
    /** 上级Id */
    parentId?: string;
    /** 菜单路径 */
    path?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    type?: EnumMenuType;
    visitLevel?: EnumMenuVisitLevel;
    /** 图标 */
    icon?: string;
    /** 链接地址 */
    url?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否缓存 */
    isCache?: boolean;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
    /** 分组 */
    groups?: GetMenuQueryResultGroup[];
  }
  interface GetMenuQueryResultButton {
    /** Id */
    id?: string;
    /** 是否选择(用户角色授权) */
    isChecked?: boolean;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 图标 */
    icon?: string;
    /** 宽度(用于按钮/列/元素) */
    width?: string;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface GetMenuQueryResultButtonLocation {
    /** 位置(用于按钮) */
    location?: string;
    /** 按钮 */
    buttons?: GetMenuQueryResultButton[];
  }
  interface GetMenuQueryResultField {
    /** Id */
    id?: string;
    /** 是否选择(用户角色授权) */
    isChecked?: boolean;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 宽度(用于按钮/列/元素) */
    width?: string;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface GetMenuQueryResultGroup {
    /** 分组名称(用于按钮/字段) */
    group?: string;
    /** 按钮位置 */
    buttonLocations?: GetMenuQueryResultButtonLocation[];
    /** 字段 */
    fields?: GetMenuQueryResultField[];
  }
  interface GetMenusQueryResultItem {
    /** Id */
    id?: string;
    /** 是否选择(用户角色授权) */
    isChecked?: boolean;
    /** 上级Id */
    parentId?: string;
    /** 下级 */
    children?: GetMenusQueryResultItem[];
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 菜单路径 */
    path?: string;
    type?: EnumMenuType;
    visitLevel?: EnumMenuVisitLevel;
    /** 图标 */
    icon?: string;
    /** 链接地址 */
    url?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否缓存 */
    isCache?: boolean;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface GetOperationUserInfosQuery {
    pageModel?: PagedListQueryPageModel;
    /** 关键字 */
    keywords?: string;
  }
  interface GetOperationUserInfosQueryResultItem {
    /** Id */
    id?: string;
    /** 姓名 */
    name?: string;
    /** 用户名 */
    userName?: string;
    /** 手机号 */
    phoneNumber?: string;
    /** 备注 */
    remark?: string;
    /** 角色 */
    roles?: GetOperationUserInfosQueryResultItemRole[];
    status?: EnumUserInfoStatus;
  }
  interface GetOperationUserInfosQueryResultItemRole {
    /** 用户Id */
    userInfoId?: string;
    /** 角色Id */
    id?: string;
    /** 名称 */
    name?: string;
  }
  interface GetResourceFieldsQueryResultItem {
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
  }
  interface GetResourcesQueryResultItem {
    /** Id */
    id?: string;
    /** 是否选中(用于角色授权) */
    isChecked?: boolean;
    controller?: EnumResourceController;
    /** 委托名称 */
    actionName?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    method?: EnumResourceMethod;
    /** 路由 */
    route?: string;
    /** 请求类型名称 */
    requestTypeName?: string;
    /** 请求类型全名 */
    requestTypeFullName?: string;
    /** 响应类型名称 */
    responseTypeName?: string;
    /** 响应类型全名 */
    responseTypeFullName?: string;
  }
  interface GetRoleQueryResult {
    /** Id */
    id?: string;
    /** 名称 */
    name?: string;
    userType?: EnumUserType;
    clientType?: EnumClientType;
    /** 最低级别 */
    minLevel?: number;
    dataPower?: EnumRoleWebApiDataPower;
    /** 备注 */
    remark?: string;
    /** 菜单Id */
    menuIds?: string[];
    /** 资源 */
    resources?: GetRoleQueryResultResource[];
  }
  interface GetRoleQueryResultResource {
    /** 资源Id */
    resourceId?: string;
    dataPower?: EnumRoleWebApiDataPower;
  }
  interface GetRolesQuery {
    pageModel?: PagedListQueryPageModel;
    userType?: EnumUserType;
    clientType?: EnumClientType;
    /** 关键字 */
    keywords?: string;
  }
  interface GetRolesQueryResultItem {
    /** Id */
    id?: string;
    /** 名称 */
    name?: string;
    userType?: EnumUserType;
    clientType?: EnumClientType;
    /** 最低级别 */
    minLevel?: number;
    dataPower?: EnumRoleWebApiDataPower;
    /** 备注 */
    remark?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 用户数量 */
    userCount?: number;
  }
  interface GetRoleUserInfosQueryResultItem {
    /** 用户Id */
    id?: string;
    /** 姓名 */
    name?: string;
    /** 用户名 */
    userName?: string;
    /** 是否选中 */
    isChecked?: boolean;
  }
  interface GetUserInfoRolesQueryResultItem {
    /** 角色Id */
    id?: string;
    /** 名称 */
    name?: string;
    /** 备注 */
    remark?: string;
    /** 是否选中 */
    isChecked?: boolean;
  }
  interface PagedListQueryPageModel {
    /** 行数 */
    rows?: number;
    /** 页码 */
    page?: number;
    /** 排序 */
    orderInput?: PagedListQueryPageModelOrderInput[];
  }
  interface PagedListQueryPageModelOrderInput {
    /** 属性 */
    property?: string;
    order?: EnumPagedListOrder;
  }
  interface PagedListQueryResultGetDictionaryCategoriesQueryResultItem {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetDictionaryCategoriesQueryResultItem[];
  }
  interface PagedListQueryResultGetDictionaryDatasQueryResultItem {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetDictionaryDatasQueryResultItem[];
  }
  interface PagedListQueryResultGetEnterprisesQueryResultItem {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetEnterprisesQueryResultItem[];
  }
  interface PagedListQueryResultGetOperationUserInfosQueryResultItem {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetOperationUserInfosQueryResultItem[];
  }
  interface PagedListQueryResultGetRolesQueryResultItem {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetRolesQueryResultItem[];
  }
  interface PagedListQueryResultPageModel {
    /** 行数 */
    rows?: number;
    /** 页码 */
    page?: number;
    /** 排序 */
    orderInput?: PagedListQueryPageModelOrderInput[];
    /** 总数 */
    totalCount?: number;
    /** 页数 */
    totalPage?: number;
  }
  interface PasswordLoginCommand {
    /** 账号 */
    userName: string;
    /** 密码 */
    password: string;
    type?: EnumUserType;
    clientType?: EnumClientType;
  }
  interface PasswordLoginCommandCallback {
    /** 用户访问令牌 */
    accessToken?: string;
    /** 刷新令牌 */
    refreshToken?: string;
  }
  interface SaveDictionaryCategoryCommand {
    id?: string;
    /** 编号 */
    code: string;
    /** 名称 */
    name: string;
    /** 字段名(逗号隔开) */
    fieldNames?: string;
    /** 排序 */
    sort?: number;
  }
  interface SaveDictionaryDataCommand {
    id?: string;
    /** 类别Id */
    categoryId?: string;
    /** 上级Id */
    parentId?: string;
    /** 编号 */
    code?: string;
    /** 显示内容 */
    content: string;
    /** 字段1 */
    field1?: string;
    /** 字段2 */
    field2?: string;
    /** 字段3 */
    field3?: string;
    /** 字段4 */
    field4?: string;
    /** 字段5 */
    field5?: string;
    /** 排序 */
    sort?: number;
    /** 是否禁用 */
    isDisabled?: boolean;
  }
  interface SaveMenuButtonCommand {
    /** Id */
    id?: string;
    /** 菜单Id */
    parentId?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 分组名称(用于按钮/字段) */
    group?: string;
    /** 位置(用于按钮) */
    location?: string;
    /** 图标 */
    icon?: string;
    /** 宽度(用于按钮/列/元素) */
    width?: string;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface SaveMenuCommand {
    /** Id */
    id?: string;
    userType?: EnumUserType;
    clientType?: EnumClientType;
    /** 上级Id */
    parentId?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    type?: EnumMenuType;
    visitLevel?: EnumMenuVisitLevel;
    /** 图标 */
    icon?: string;
    /** 链接地址 */
    url?: string;
    /** 是否禁用 */
    isDisabled?: boolean;
    /** 是否缓存 */
    isCache?: boolean;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
    /** 分组 */
    groups?: SaveMenuCommandGroup[];
  }
  interface SaveMenuCommandButton {
    /** Id */
    id?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 图标 */
    icon?: string;
    /** 宽度(用于按钮/列/元素) */
    width?: string;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface SaveMenuCommandButtonLocation {
    /** 位置(用于按钮) */
    location?: string;
    /** 按钮 */
    buttons?: SaveMenuCommandButton[];
  }
  interface SaveMenuCommandField {
    /** Id */
    id?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 宽度(用于按钮/列/元素) */
    width?: string;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface SaveMenuCommandGroup {
    /** 分组名称(用于按钮/字段) */
    group?: string;
    /** 按钮位置 */
    buttonLocations?: SaveMenuCommandButtonLocation[];
    /** 字段 */
    fields?: SaveMenuCommandField[];
  }
  interface SaveMenuFieldCommand {
    /** Id */
    id?: string;
    /** 菜单Id */
    parentId?: string;
    /** 编号 */
    code?: string;
    /** 名称 */
    name?: string;
    /** 分组名称(用于按钮/字段) */
    group?: string;
    /** 位置(用于按钮) */
    location?: string;
    /** 图标 */
    icon?: string;
    /** 宽度(用于按钮/列/元素) */
    width?: string;
    /** 排序 */
    sort?: number;
    /** 备注 */
    remark?: string;
  }
  interface SaveRoleCommand {
    /** Id */
    id?: string;
    /** 名称 */
    name?: string;
    userType?: EnumUserType;
    clientType?: EnumClientType;
    /** 最低级别 */
    minLevel?: number;
    dataPower?: EnumRoleWebApiDataPower;
    /** 备注 */
    remark?: string;
    /** 菜单Id */
    menuIds?: string[];
    /** 资源 */
    resources?: GetRoleQueryResultResource[];
  }
  interface SetDictionaryDataIsDisabledCommand {
    /** Id */
    ids?: string[];
    /** 是否禁用 */
    isDisabled?: boolean;
  }
  interface SetMenuSwitchCommand {
    /** Id */
    ids?: string[];
    type?: EnumMenuType;
    /** 是否禁用(null时不更新) */
    isDisabled?: boolean;
    /** 是否缓存(null时不更新) */
    isCache?: boolean;
  }
  interface SetRoleIsDisabledCommand {
    /** Id */
    ids: string[];
    /** 是否禁用 */
    isDisabled?: boolean;
  }
  interface SetRoleUserInfosCommand {
    /** 角色Id */
    roleId?: string;
    /** 用户Id */
    userInfoIds?: string[];
  }
  interface SetUserInfoRolesCommand {
    /** 用户Id */
    userInfoId?: string;
    /** 角色Id */
    roleIds?: string[];
  }
  interface SetUserInfoStatusCommand {
    /** Id */
    ids?: string[];
    status?: EnumUserInfoStatus;
  }
}
packages/services/apiV2/userInfo.ts
New file
@@ -0,0 +1,66 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 查询运营端用户分页列表数据 POST /api/user/userInfo/getOperationUserInfos */
export async function getOperationUserInfos(
  body: API.GetOperationUserInfosQuery,
  options?: API.RequestConfig
) {
  return request<API.PagedListQueryResultGetOperationUserInfosQueryResultItem>(
    '/api/user/userInfo/getOperationUserInfos',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 查询用户角色列表 GET /api/user/userInfo/getUserInfoRoles */
export async function getUserInfoRoles(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetUserInfoRolesParams,
  options?: API.RequestConfig
) {
  return request<API.GetUserInfoRolesQueryResultItem[]>('/api/user/userInfo/getUserInfoRoles', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 设置用户信息角色 PUT /api/user/userInfo/setUserInfoRoles */
export async function setUserInfoRoles(
  body: API.SetUserInfoRolesCommand,
  options?: API.RequestConfig
) {
  return request<number>('/api/user/userInfo/setUserInfoRoles', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置用户信息状态 PUT /api/user/userInfo/setUserInfoStatus */
export async function setUserInfoStatus(
  body: API.SetUserInfoStatusCommand,
  options?: API.RequestConfig
) {
  return request<number>('/api/user/userInfo/setUserInfoStatus', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
packages/services/tsconfig.json
@@ -7,7 +7,13 @@
      "@12333/*": ["../../packages/*"]
    },
    "composite": true,
    "types": ["node", "./api/typings.d.ts", "./types.d.ts", "./globalType.d.ts"]
    "types": [
      "node",
      "./api/typings.d.ts",
      "./apiV2/typings.d.ts",
      "./types.d.ts",
      "./globalType.d.ts"
    ]
  },
  "exclude": ["node_modules", "dist"]
}
packages/utils/common.ts
@@ -53,6 +53,7 @@
 * @returns
 */
export function addStarForString(str: string, start = 0, end = 0) {
  if (!str) return '';
  return str.substring(0, start) + '*'.repeat(end - start) + str.substring(end);
}
packages/utils/encrypt.ts
New file
@@ -0,0 +1,13 @@
import CryptoJS from 'crypto-js';
/**
 * MD5加密函数
 * @param {string} data - 需要加密的数据
 * @returns {string} 加密后的16进制字符串
 */
export function md5Encrypt(data: string) {
  // 进行MD5加密,返回WordArray对象
  const hash = CryptoJS.MD5(data);
  // 转换为16进制字符串
  return hash.toString(CryptoJS.enc.Hex);
}
packages/utils/index.ts
@@ -13,3 +13,4 @@
export * from './user';
export * from './media';
export * from './location';
export * from './encrypt';
pnpm-lock.yaml
Diff too large
types/api.d.ts
@@ -6,18 +6,6 @@
    customErrorHandler?: (error: any) => boolean;
  }
  interface AreaTreeNode extends AreaInfo {
    children?: AreaTreeNode[];
  }
  type PriceVersionInfoItem = Omit<API.PriceVersionInfo, 'price'> & {
    price: string;
  };
  interface CategoryMenu {
    type?: number;
  }
  interface MyCertificationAuditDto {
    /**
     * 前端用于判断状态的status