fix: ci
This commit is contained in:
parent
3fd193eb8b
commit
a95ba47b74
|
|
@ -73,7 +73,7 @@ async function createAppConfigPlugin({
|
||||||
* Get the configuration file variable name
|
* Get the configuration file variable name
|
||||||
* @param env
|
* @param env
|
||||||
*/
|
*/
|
||||||
const getVariableName = (title: string) => {
|
export const getVariableName = (title: string) => {
|
||||||
function strToHex(str: string) {
|
function strToHex(str: string) {
|
||||||
const result: string[] = [];
|
const result: string[] = [];
|
||||||
for (let i = 0; i < str.length; ++i) {
|
for (let i = 0; i < str.length; ++i) {
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,6 @@
|
||||||
import type { GlobEnvConfig } from '/#/config';
|
import type { GlobEnvConfig } from '/#/config';
|
||||||
import pkg from '../../package.json';
|
import pkg from '../../package.json';
|
||||||
|
import { getVariableName } from '@vben/vite-config/src/plugins/appConfig';
|
||||||
const getVariableName = (title: string) => {
|
|
||||||
function strToHex(str: string) {
|
|
||||||
const result: string[] = [];
|
|
||||||
for (let i = 0; i < str.length; ++i) {
|
|
||||||
const hex = str.charCodeAt(i).toString(16);
|
|
||||||
result.push(('000' + hex).slice(-4));
|
|
||||||
}
|
|
||||||
return result.join('').toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
return `__PRODUCTION__${strToHex(title) || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '');
|
|
||||||
};
|
|
||||||
|
|
||||||
export function getCommonStoragePrefix() {
|
export function getCommonStoragePrefix() {
|
||||||
const { VITE_GLOB_APP_TITLE } = getAppEnvConfig();
|
const { VITE_GLOB_APP_TITLE } = getAppEnvConfig();
|
||||||
|
|
@ -26,7 +14,7 @@ export function getStorageShortName() {
|
||||||
|
|
||||||
export function getAppEnvConfig() {
|
export function getAppEnvConfig() {
|
||||||
console.log(import.meta.env.VITE_GLOB_APP_TITLE);
|
console.log(import.meta.env.VITE_GLOB_APP_TITLE);
|
||||||
// __PRODUCTION__005600620065006E002000410064006D0069006E__CONF__
|
|
||||||
const ENV_NAME = getVariableName(import.meta.env.VITE_GLOB_APP_TITLE);
|
const ENV_NAME = getVariableName(import.meta.env.VITE_GLOB_APP_TITLE);
|
||||||
console.log(ENV_NAME);
|
console.log(ENV_NAME);
|
||||||
const ENV = import.meta.env.DEV
|
const ENV = import.meta.env.DEV
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue