mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Format file format from Windows/dos to Unix (#1949)
### What problem does this PR solve? Related source file is in Windows/DOS format, they are format to Unix format. ### Type of change - [x] Refactoring Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@ -1,20 +1,20 @@
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export function today() {
|
||||
return formatDate(dayjs());
|
||||
}
|
||||
|
||||
export function lastDay() {
|
||||
return formatDate(dayjs().subtract(1, 'days'));
|
||||
}
|
||||
|
||||
export function lastWeek() {
|
||||
return formatDate(dayjs().subtract(1, 'weeks'));
|
||||
}
|
||||
|
||||
export function formatDate(date: any) {
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
return dayjs(date).format('DD/MM/YYYY HH:mm:ss');
|
||||
}
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export function today() {
|
||||
return formatDate(dayjs());
|
||||
}
|
||||
|
||||
export function lastDay() {
|
||||
return formatDate(dayjs().subtract(1, 'days'));
|
||||
}
|
||||
|
||||
export function lastWeek() {
|
||||
return formatDate(dayjs().subtract(1, 'weeks'));
|
||||
}
|
||||
|
||||
export function formatDate(date: any) {
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
return dayjs(date).format('DD/MM/YYYY HH:mm:ss');
|
||||
}
|
||||
|
||||
@ -1,30 +1,30 @@
|
||||
/**
|
||||
* @param {String} url
|
||||
* @param {Boolean} isNoCaseSensitive 是否区分大小写
|
||||
* @return {Object}
|
||||
*/
|
||||
// import numeral from 'numeral';
|
||||
|
||||
import { Base64 } from 'js-base64';
|
||||
import JSEncrypt from 'jsencrypt';
|
||||
|
||||
export const getWidth = () => {
|
||||
return { width: window.innerWidth };
|
||||
};
|
||||
export const rsaPsw = (password: string) => {
|
||||
const pub =
|
||||
'-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB-----END PUBLIC KEY-----';
|
||||
const encryptor = new JSEncrypt();
|
||||
|
||||
encryptor.setPublicKey(pub);
|
||||
|
||||
return encryptor.encrypt(Base64.encode(password));
|
||||
};
|
||||
|
||||
export default {
|
||||
getWidth,
|
||||
rsaPsw,
|
||||
};
|
||||
|
||||
export const getFileExtension = (filename: string) =>
|
||||
filename.slice(filename.lastIndexOf('.') + 1).toLowerCase();
|
||||
/**
|
||||
* @param {String} url
|
||||
* @param {Boolean} isNoCaseSensitive 是否区分大小写
|
||||
* @return {Object}
|
||||
*/
|
||||
// import numeral from 'numeral';
|
||||
|
||||
import { Base64 } from 'js-base64';
|
||||
import JSEncrypt from 'jsencrypt';
|
||||
|
||||
export const getWidth = () => {
|
||||
return { width: window.innerWidth };
|
||||
};
|
||||
export const rsaPsw = (password: string) => {
|
||||
const pub =
|
||||
'-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB-----END PUBLIC KEY-----';
|
||||
const encryptor = new JSEncrypt();
|
||||
|
||||
encryptor.setPublicKey(pub);
|
||||
|
||||
return encryptor.encrypt(Base64.encode(password));
|
||||
};
|
||||
|
||||
export default {
|
||||
getWidth,
|
||||
rsaPsw,
|
||||
};
|
||||
|
||||
export const getFileExtension = (filename: string) =>
|
||||
filename.slice(filename.lastIndexOf('.') + 1).toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user