@gx-design-vue/create-gx-cli 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +7 -4
- package/src/main.js +7 -7
- package/template-mobile-vant-cli/.env +3 -0
- package/template-mobile-vant-cli/.env.development +4 -6
- package/template-mobile-vant-cli/.env.pro +16 -7
- package/template-mobile-vant-cli/.env.production +21 -9
- package/template-mobile-vant-cli/commitlint.config.cjs +32 -0
- package/template-mobile-vant-cli/config/default/defaultSettings.ts +70 -0
- package/template-mobile-vant-cli/config/default/network.ts +10 -0
- package/template-mobile-vant-cli/config/default/proxy.ts +50 -0
- package/template-mobile-vant-cli/config/default/theme.ts +3 -0
- package/template-mobile-vant-cli/config/index.ts +11 -0
- package/template-mobile-vant-cli/eslint.config.js +10 -2
- package/template-mobile-vant-cli/index.html +22 -21
- package/template-mobile-vant-cli/{build → internal/vite-config/generate}/generateModifyVars.ts +1 -1
- package/template-mobile-vant-cli/internal/vite-config/rollupOptions/index.ts +22 -0
- package/template-mobile-vant-cli/internal/vite-config/util/hash.ts +17 -0
- package/template-mobile-vant-cli/internal/vite-config/util/index.ts +132 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/cdn.ts +65 -0
- package/template-mobile-vant-cli/{build → internal/vite-config/vite}/optimizer.ts +9 -1
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/appConfig.ts +91 -0
- package/template-mobile-vant-cli/{build → internal/vite-config/vite}/plugin/autoImport.ts +7 -3
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/compress.ts +31 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/html.ts +32 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/index.ts +74 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/visualizer.ts +14 -0
- package/template-mobile-vant-cli/internal/vite-config/vite/plugin/viteNotice.ts +40 -0
- package/template-mobile-vant-cli/mock/config/permissions.ts +15 -0
- package/template-mobile-vant-cli/mock/config/user/id.ts +5 -0
- package/template-mobile-vant-cli/mock/config/user/index.ts +96 -0
- package/template-mobile-vant-cli/mock/index.ts +55 -0
- package/template-mobile-vant-cli/mock/routers/table/index.fake.ts +22 -0
- package/template-mobile-vant-cli/mock/routers/user/account.fake.ts +52 -0
- package/template-mobile-vant-cli/mock/routers/user/index.fake.ts +46 -0
- package/template-mobile-vant-cli/mock/utils/crypto.ts +21 -0
- package/template-mobile-vant-cli/mock/utils/table.ts +96 -0
- package/template-mobile-vant-cli/mock/utils/util.ts +91 -0
- package/template-mobile-vant-cli/package.json +51 -34
- package/template-mobile-vant-cli/public/css/default.css +54 -0
- package/template-mobile-vant-cli/src/App.vue +6 -2
- package/template-mobile-vant-cli/src/assets/logo.png +0 -0
- package/template-mobile-vant-cli/src/components/PageContainer/ProSkeleton.tsx +1 -1
- package/template-mobile-vant-cli/src/components/PageContainer/index.tsx +108 -16
- package/template-mobile-vant-cli/src/components/PageContainer/style.module.less +5 -2
- package/template-mobile-vant-cli/src/components/TabsMenu/index.vue +45 -0
- package/template-mobile-vant-cli/src/core/gx-design/index.ts +1 -1
- package/template-mobile-vant-cli/src/core/index.ts +0 -7
- package/template-mobile-vant-cli/src/design/color.less +1 -0
- package/template-mobile-vant-cli/src/design/config.less +5 -0
- package/template-mobile-vant-cli/src/design/index.less +1 -1
- package/template-mobile-vant-cli/src/design/mixin.less +65 -0
- package/template-mobile-vant-cli/src/design/reset.less +16 -132
- package/template-mobile-vant-cli/src/hooks/web/usePageLoading.ts +7 -9
- package/template-mobile-vant-cli/src/layout/{BasicLayout.vue → BasicLayout/index.vue} +3 -1
- package/template-mobile-vant-cli/src/layout/BasicLayout/style.less +3 -0
- package/template-mobile-vant-cli/src/layout/UserLayout/index.vue +18 -0
- package/template-mobile-vant-cli/src/layout/UserLayout/style.module.less +36 -0
- package/template-mobile-vant-cli/src/main.ts +16 -9
- package/template-mobile-vant-cli/src/pages/Account/details.vue +13 -0
- package/template-mobile-vant-cli/src/pages/Account/index.vue +102 -0
- package/template-mobile-vant-cli/src/pages/{home.vue → Home/index.vue} +5 -5
- package/template-mobile-vant-cli/src/pages/user/login/index.vue +74 -0
- package/template-mobile-vant-cli/src/plugins/dayjs/index.ts +3 -0
- package/template-mobile-vant-cli/src/plugins/index.ts +2 -0
- package/template-mobile-vant-cli/src/router/guard/index.ts +18 -0
- package/template-mobile-vant-cli/src/router/guard/permissions.ts +41 -0
- package/template-mobile-vant-cli/src/router/guard/stateGuard.ts +10 -0
- package/template-mobile-vant-cli/src/router/index.ts +21 -15
- package/template-mobile-vant-cli/src/router/routes/index.ts +46 -0
- package/template-mobile-vant-cli/src/router/routes/modules/dataSource.ts +32 -0
- package/template-mobile-vant-cli/src/services/userCenter/account.ts +42 -0
- package/template-mobile-vant-cli/src/services/userCenter/index.ts +28 -0
- package/template-mobile-vant-cli/src/store/index.ts +4 -1
- package/template-mobile-vant-cli/src/store/modules/global.ts +6 -13
- package/template-mobile-vant-cli/src/store/modules/user.ts +107 -0
- package/template-mobile-vant-cli/src/utils/accessToken.ts +97 -0
- package/template-mobile-vant-cli/src/utils/crypto/index.ts +3 -4
- package/template-mobile-vant-cli/src/utils/env.ts +2 -2
- package/template-mobile-vant-cli/src/utils/pageTitle.ts +12 -6
- package/template-mobile-vant-cli/src/utils/request/XHR.ts +9 -11
- package/template-mobile-vant-cli/src/utils/request/axiosCancel.ts +5 -5
- package/template-mobile-vant-cli/src/utils/request/checkStatus.ts +18 -2
- package/template-mobile-vant-cli/src/utils/request/index.ts +36 -23
- package/template-mobile-vant-cli/src/utils/storage.ts +49 -32
- package/template-mobile-vant-cli/src/utils/validate.ts +31 -36
- package/template-mobile-vant-cli/tsconfig.json +17 -9
- package/template-mobile-vant-cli/types/auto-imports.d.ts +18 -2
- package/template-mobile-vant-cli/types/components.d.ts +2 -7
- package/template-mobile-vant-cli/types/config.d.ts +56 -0
- package/template-mobile-vant-cli/types/global.d.ts +62 -21
- package/template-mobile-vant-cli/types/mock.d.ts +34 -0
- package/template-mobile-vant-cli/types/module.d.ts +33 -0
- package/template-mobile-vant-cli/types/response.d.ts +3 -1
- package/template-mobile-vant-cli/types/system.d.ts +58 -0
- package/template-mobile-vant-cli/types/vant-import.d.ts +16 -5
- package/template-mobile-vant-cli/unocss.config.ts +120 -66
- package/template-mobile-vant-cli/vite.config.ts +78 -81
- package/template-mobile-vant-cli/build/cdn.ts +0 -5
- package/template-mobile-vant-cli/build/plugin/html.ts +0 -26
- package/template-mobile-vant-cli/build/plugin/index.ts +0 -42
- package/template-mobile-vant-cli/build/plugin/mock.ts +0 -14
- package/template-mobile-vant-cli/build/plugin/viteMock/client.ts +0 -88
- package/template-mobile-vant-cli/build/plugin/viteMock/createMockServer.ts +0 -271
- package/template-mobile-vant-cli/build/plugin/viteMock/index.ts +0 -69
- package/template-mobile-vant-cli/build/plugin/viteMock/types.ts +0 -48
- package/template-mobile-vant-cli/build/plugin/viteMock/utils.ts +0 -48
- package/template-mobile-vant-cli/build/script/postBuild.ts +0 -14
- package/template-mobile-vant-cli/mock/_createProductionServer.ts +0 -19
- package/template-mobile-vant-cli/mock/utils.ts +0 -9
- package/template-mobile-vant-cli/postcss.config.cjs +0 -8
- package/template-mobile-vant-cli/prettier.config.cjs +0 -18
- package/template-mobile-vant-cli/public/js/flexible.js +0 -44
- package/template-mobile-vant-cli/src/core/vant-design/index.ts +0 -4
- package/template-mobile-vant-cli/src/design/vant.less +0 -2
- package/template-mobile-vant-cli/src/global.less +0 -1
- package/template-mobile-vant-cli/src/layout/basicLayout.less +0 -11
- package/template-mobile-vant-cli/src/router/routes.ts +0 -20
- package/template-mobile-vant-cli/src/router/typings.ts +0 -8
- package/template-mobile-vant-cli/src/settings/index.ts +0 -10
- package/template-mobile-vant-cli/src/utils/crypto/base64.ts +0 -101
- package/template-mobile-vant-cli/types/ant-design-import.d.ts +0 -13
- package/template-mobile-vant-cli/types/plugins-auto-import.d.ts +0 -14
- /package/template-mobile-vant-cli/{mock/datasSource/api/index.ts → src/design/vant/index.less} +0 -0
@@ -1,69 +0,0 @@
|
|
1
|
-
(async () => {
|
2
|
-
try {
|
3
|
-
await import('mockjs')
|
4
|
-
} catch (e) {
|
5
|
-
throw new Error('vite-plugin-vue-mock requires mockjs to be present in the dependency tree.')
|
6
|
-
}
|
7
|
-
})()
|
8
|
-
|
9
|
-
import type { Plugin, ResolvedConfig } from 'vite'
|
10
|
-
import { normalizePath } from 'vite'
|
11
|
-
import path from 'node:path'
|
12
|
-
import type { ViteMockOptions } from './types'
|
13
|
-
import { fileExists } from './utils'
|
14
|
-
import { createMockServer, requestMiddleware } from './createMockServer'
|
15
|
-
|
16
|
-
function getDefaultPath(supportTs = true) {
|
17
|
-
return path.resolve(process.cwd(), `src/main.${supportTs ? 'ts' : 'js'}`)
|
18
|
-
}
|
19
|
-
|
20
|
-
export function viteMockServe(opt: ViteMockOptions = {}): Plugin {
|
21
|
-
let isDev = false
|
22
|
-
let needSourcemap = false
|
23
|
-
let config: ResolvedConfig
|
24
|
-
let defaultPath = getDefaultPath()
|
25
|
-
if (!fileExists(defaultPath)) {
|
26
|
-
defaultPath = getDefaultPath(false)
|
27
|
-
if (!fileExists(defaultPath)) {
|
28
|
-
defaultPath = ''
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
const defaultEnter = normalizePath(defaultPath)
|
33
|
-
|
34
|
-
const { injectFile = defaultEnter } = opt
|
35
|
-
|
36
|
-
return {
|
37
|
-
name: 'vite:mock',
|
38
|
-
enforce: 'pre' as const,
|
39
|
-
configResolved(resolvedConfig) {
|
40
|
-
config = resolvedConfig
|
41
|
-
isDev = config.command === 'serve'
|
42
|
-
needSourcemap = !!resolvedConfig.build.sourcemap
|
43
|
-
isDev && createMockServer(opt, config)
|
44
|
-
},
|
45
|
-
|
46
|
-
configureServer: async ({ middlewares }) => {
|
47
|
-
const { enable = isDev } = opt
|
48
|
-
if (!enable) {
|
49
|
-
return
|
50
|
-
}
|
51
|
-
const middleware = await requestMiddleware(opt)
|
52
|
-
middlewares.use(middleware)
|
53
|
-
},
|
54
|
-
transform: (code, id) => {
|
55
|
-
if (isDev || !injectFile || !id.endsWith(injectFile)) {
|
56
|
-
return null
|
57
|
-
}
|
58
|
-
|
59
|
-
const { injectCode = '' } = opt
|
60
|
-
|
61
|
-
return {
|
62
|
-
map: needSourcemap ? this.getCombinedSourcemap() : null,
|
63
|
-
code: `${code}\n${injectCode}`
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
|
69
|
-
export * from './types'
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import { IncomingMessage, ServerResponse } from 'http'
|
2
|
-
|
3
|
-
export interface ViteMockOptions {
|
4
|
-
mockPath?: string;
|
5
|
-
configPath?: string;
|
6
|
-
injectFile?: string;
|
7
|
-
injectCode?: string;
|
8
|
-
ignore?: RegExp | ((fileName: string) => boolean);
|
9
|
-
watchFiles?: boolean;
|
10
|
-
enable?: boolean;
|
11
|
-
cors?: boolean;
|
12
|
-
/**
|
13
|
-
* Automatic recognition, no need to configure again
|
14
|
-
* @deprecated Deprecated after 2.8.0
|
15
|
-
*/
|
16
|
-
supportTs?: boolean;
|
17
|
-
logger?: boolean;
|
18
|
-
}
|
19
|
-
|
20
|
-
export interface RespThisType {
|
21
|
-
req: IncomingMessage
|
22
|
-
res: ServerResponse
|
23
|
-
parseJson: () => any
|
24
|
-
}
|
25
|
-
|
26
|
-
export type MethodType = 'get' | 'post' | 'put' | 'delete' | 'patch'
|
27
|
-
|
28
|
-
export type Recordable<T = any> = Record<string, T>
|
29
|
-
|
30
|
-
export declare interface MockMethod {
|
31
|
-
url: string
|
32
|
-
method?: MethodType
|
33
|
-
timeout?: number
|
34
|
-
statusCode?: number
|
35
|
-
response?:
|
36
|
-
| ((
|
37
|
-
this: RespThisType,
|
38
|
-
opt: { url: Recordable; body: Recordable; query: Recordable; headers: Recordable },
|
39
|
-
) => any)
|
40
|
-
| any
|
41
|
-
rawResponse?: (this: RespThisType, req: IncomingMessage, res: ServerResponse) => void
|
42
|
-
}
|
43
|
-
|
44
|
-
export interface MockConfig {
|
45
|
-
env: Record<string, any>
|
46
|
-
mode: string
|
47
|
-
command: 'build' | 'serve'
|
48
|
-
}
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import fs from 'node:fs'
|
2
|
-
|
3
|
-
const toString = Object.prototype.toString
|
4
|
-
|
5
|
-
export function is(val: unknown, type: string) {
|
6
|
-
return toString.call(val) === `[object ${type}]`
|
7
|
-
}
|
8
|
-
|
9
|
-
export function fileExists(f: string) {
|
10
|
-
try {
|
11
|
-
fs.accessSync(f, fs.constants.W_OK);
|
12
|
-
return true;
|
13
|
-
} catch (error) {
|
14
|
-
return false;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
export function isFunction<T = Function>(val: unknown): val is T {
|
19
|
-
return is(val, 'Function') || is(val, 'AsyncFunction')
|
20
|
-
}
|
21
|
-
|
22
|
-
export function isArray(val: any): val is Array<any> {
|
23
|
-
return val && Array.isArray(val)
|
24
|
-
}
|
25
|
-
|
26
|
-
export function isRegExp(val: unknown): val is RegExp {
|
27
|
-
return is(val, 'RegExp')
|
28
|
-
}
|
29
|
-
|
30
|
-
export function isAbsPath(path: string | undefined) {
|
31
|
-
if (!path) {
|
32
|
-
return false
|
33
|
-
}
|
34
|
-
// Windows 路径格式:C:\ 或 \\ 开头,或已含盘符(D:\path\to\file)
|
35
|
-
if (/^([a-zA-Z]:\\|\\\\|(?:\/|\uFF0F){2,})/.test(path)) {
|
36
|
-
return true
|
37
|
-
}
|
38
|
-
// Unix/Linux 路径格式:/ 开头
|
39
|
-
return /^\/[^/]/.test(path)
|
40
|
-
}
|
41
|
-
|
42
|
-
export function sleep(time: number) {
|
43
|
-
return new Promise((resolve) => {
|
44
|
-
setTimeout(() => {
|
45
|
-
resolve('')
|
46
|
-
}, time)
|
47
|
-
})
|
48
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// #!/usr/bin/env node
|
2
|
-
import chalk from 'chalk'
|
3
|
-
|
4
|
-
import pkg from '../../package.json'
|
5
|
-
|
6
|
-
export const runBuild = async () => {
|
7
|
-
try {
|
8
|
-
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!')
|
9
|
-
} catch (error) {
|
10
|
-
console.log(chalk.red('vite build error:\n' + error))
|
11
|
-
process.exit(1)
|
12
|
-
}
|
13
|
-
}
|
14
|
-
runBuild()
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { createProdMockServer } from '../build/plugin/viteMock/client'
|
2
|
-
|
3
|
-
const modules = import.meta.glob('./datasSource/**/*.ts', { eager: true })
|
4
|
-
|
5
|
-
const mockModules: any[] = []
|
6
|
-
Object.keys(modules).forEach((key) => {
|
7
|
-
if (key.includes('/_')) {
|
8
|
-
return
|
9
|
-
}
|
10
|
-
if (modules[key] && modules[key]['default'])
|
11
|
-
mockModules.push(...modules[key]['default'])
|
12
|
-
})
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Used in a production environment. Need to manually import all modules
|
16
|
-
*/
|
17
|
-
export function setupProdMockServer() {
|
18
|
-
createProdMockServer(mockModules)
|
19
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
printWidth: 100,
|
3
|
-
useTabs: false,
|
4
|
-
semi: false,
|
5
|
-
singleQuote: true,
|
6
|
-
quoteProps: 'as-needed',
|
7
|
-
bracketSpacing: true,
|
8
|
-
trailingComma: 'none',
|
9
|
-
jsxBracketSameLine: false,
|
10
|
-
jsxSingleQuote: false,
|
11
|
-
arrowParens: 'always',
|
12
|
-
insertPragma: false,
|
13
|
-
requirePragma: false,
|
14
|
-
proseWrap: 'never',
|
15
|
-
htmlWhitespaceSensitivity: 'strict',
|
16
|
-
endOfLine: 'auto',
|
17
|
-
rangeStart: 0,
|
18
|
-
};
|
@@ -1,44 +0,0 @@
|
|
1
|
-
(function flexible (window, document) {
|
2
|
-
var docEl = document.documentElement
|
3
|
-
var dpr = window.devicePixelRatio || 1
|
4
|
-
|
5
|
-
// adjust body font size
|
6
|
-
function setBodyFontSize () {
|
7
|
-
if (document.body) {
|
8
|
-
document.body.style.fontSize = (12 * dpr) + 'px'
|
9
|
-
}
|
10
|
-
else {
|
11
|
-
document.addEventListener('DOMContentLoaded', setBodyFontSize)
|
12
|
-
}
|
13
|
-
}
|
14
|
-
setBodyFontSize();
|
15
|
-
|
16
|
-
// set 1rem = viewWidth / 10
|
17
|
-
function setRemUnit () {
|
18
|
-
var rem = (docEl.clientWidth < 600 ? docEl.clientWidth : 600) / 10
|
19
|
-
docEl.style.fontSize = rem + 'px'
|
20
|
-
}
|
21
|
-
|
22
|
-
setRemUnit()
|
23
|
-
|
24
|
-
// reset rem unit on page resize
|
25
|
-
window.addEventListener('resize', setRemUnit)
|
26
|
-
window.addEventListener('pageshow', function (e) {
|
27
|
-
if (e.persisted) {
|
28
|
-
setRemUnit()
|
29
|
-
}
|
30
|
-
})
|
31
|
-
|
32
|
-
// detect 0.5px supports
|
33
|
-
if (dpr >= 2) {
|
34
|
-
var fakeBody = document.createElement('body')
|
35
|
-
var testElement = document.createElement('div')
|
36
|
-
testElement.style.border = '.5px solid transparent'
|
37
|
-
fakeBody.appendChild(testElement)
|
38
|
-
docEl.appendChild(fakeBody)
|
39
|
-
if (testElement.offsetHeight === 1) {
|
40
|
-
docEl.classList.add('hairlines')
|
41
|
-
}
|
42
|
-
docEl.removeChild(fakeBody)
|
43
|
-
}
|
44
|
-
}(window, document))
|
@@ -1 +0,0 @@
|
|
1
|
-
@import './design/index';
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import type { AppRouteModule } from './typings'
|
2
|
-
import BasicLayout from '@/layout/BasicLayout.vue'
|
3
|
-
|
4
|
-
export const constantRoutes: AppRouteModule[] = [
|
5
|
-
{
|
6
|
-
path: '/',
|
7
|
-
component: BasicLayout,
|
8
|
-
redirect: '/home',
|
9
|
-
children: [
|
10
|
-
{
|
11
|
-
path: '/home',
|
12
|
-
name: 'Home',
|
13
|
-
meta: {
|
14
|
-
title: '首页'
|
15
|
-
},
|
16
|
-
component: () => import('@/pages/home.vue')
|
17
|
-
}
|
18
|
-
]
|
19
|
-
}
|
20
|
-
]
|
@@ -1,101 +0,0 @@
|
|
1
|
-
export default class Base64 {
|
2
|
-
_keyStr: string
|
3
|
-
|
4
|
-
constructor() {
|
5
|
-
this._keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
6
|
-
}
|
7
|
-
|
8
|
-
_utf8_encode(string: string) {
|
9
|
-
string = string.replace(/\r\n/g, '\n')
|
10
|
-
let utftext = ''
|
11
|
-
for (let n = 0; n < string.length; n++) {
|
12
|
-
const c = string.charCodeAt(n)
|
13
|
-
if (c < 128) {
|
14
|
-
utftext += String.fromCharCode(c)
|
15
|
-
} else if ((c > 127) && (c < 2048)) {
|
16
|
-
utftext += String.fromCharCode((c >> 6) | 192)
|
17
|
-
utftext += String.fromCharCode((c & 63) | 128)
|
18
|
-
} else {
|
19
|
-
utftext += String.fromCharCode((c >> 12) | 224)
|
20
|
-
utftext += String.fromCharCode(((c >> 6) & 63) | 128)
|
21
|
-
utftext += String.fromCharCode((c & 63) | 128)
|
22
|
-
}
|
23
|
-
}
|
24
|
-
return utftext
|
25
|
-
}
|
26
|
-
|
27
|
-
_utf8_decode(utftext: string) {
|
28
|
-
let string = ''
|
29
|
-
let i = 0
|
30
|
-
let c = 0
|
31
|
-
let c1 = 0
|
32
|
-
let c2 = 0
|
33
|
-
while (i < utftext.length) {
|
34
|
-
c = utftext.charCodeAt(i)
|
35
|
-
if (c < 128) {
|
36
|
-
string += String.fromCharCode(c)
|
37
|
-
i++
|
38
|
-
} else if ((c > 191) && (c < 224)) {
|
39
|
-
c1 = utftext.charCodeAt(i + 1)
|
40
|
-
string += String.fromCharCode(((c & 31) << 6) | (c1 & 63))
|
41
|
-
i += 2
|
42
|
-
} else {
|
43
|
-
c1 = utftext.charCodeAt(i + 1)
|
44
|
-
c2 = utftext.charCodeAt(i + 2)
|
45
|
-
string += String.fromCharCode(((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63))
|
46
|
-
i += 3
|
47
|
-
}
|
48
|
-
}
|
49
|
-
return string
|
50
|
-
}
|
51
|
-
|
52
|
-
encode(input: string) {
|
53
|
-
let output = ''
|
54
|
-
let chr1, chr2, chr3, enc1, enc2, enc3, enc4
|
55
|
-
let i = 0
|
56
|
-
input = this._utf8_encode(input)
|
57
|
-
while (i < input.length) {
|
58
|
-
chr1 = input.charCodeAt(i++)
|
59
|
-
chr2 = input.charCodeAt(i++)
|
60
|
-
chr3 = input.charCodeAt(i++)
|
61
|
-
enc1 = chr1 >> 2
|
62
|
-
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)
|
63
|
-
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)
|
64
|
-
enc4 = chr3 & 63
|
65
|
-
if (Number.isNaN(chr2)) {
|
66
|
-
enc3 = enc4 = 64
|
67
|
-
} else if (Number.isNaN(chr3)) {
|
68
|
-
enc4 = 64
|
69
|
-
}
|
70
|
-
output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(
|
71
|
-
enc3) + this._keyStr.charAt(enc4)
|
72
|
-
}
|
73
|
-
return output
|
74
|
-
}
|
75
|
-
|
76
|
-
decode(input: string) {
|
77
|
-
let output = ''
|
78
|
-
let chr1, chr2, chr3
|
79
|
-
let enc1, enc2, enc3, enc4
|
80
|
-
let i = 0
|
81
|
-
input = input.replace(/[^A-Za-z0-9+/=]/g, '')
|
82
|
-
while (i < input.length) {
|
83
|
-
enc1 = this._keyStr.indexOf(input.charAt(i++))
|
84
|
-
enc2 = this._keyStr.indexOf(input.charAt(i++))
|
85
|
-
enc3 = this._keyStr.indexOf(input.charAt(i++))
|
86
|
-
enc4 = this._keyStr.indexOf(input.charAt(i++))
|
87
|
-
chr1 = (enc1 << 2) | (enc2 >> 4)
|
88
|
-
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2)
|
89
|
-
chr3 = ((enc3 & 3) << 6) | enc4
|
90
|
-
output = output + String.fromCharCode(chr1)
|
91
|
-
if (enc3 !== 64) {
|
92
|
-
output = output + String.fromCharCode(chr2)
|
93
|
-
}
|
94
|
-
if (enc4 !== 64) {
|
95
|
-
output = output + String.fromCharCode(chr3)
|
96
|
-
}
|
97
|
-
}
|
98
|
-
output = this._utf8_decode(output)
|
99
|
-
return output
|
100
|
-
}
|
101
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// generated by unplugin-vue-components
|
2
|
-
// We suggest you to commit this file into source control
|
3
|
-
// Read more: https://github.com/vuejs/core/pull/3399
|
4
|
-
import '@vue/runtime-core'
|
5
|
-
|
6
|
-
export {}
|
7
|
-
|
8
|
-
declare module '@vue/runtime-core' {
|
9
|
-
export interface GlobalComponents {
|
10
|
-
RouterLink: typeof import('vue-router')['RouterLink']
|
11
|
-
RouterView: typeof import('vue-router')['RouterView']
|
12
|
-
}
|
13
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// generated by unplugin-vue-components
|
2
|
-
// We suggest you to commit this file into source control
|
3
|
-
// Read more: https://github.com/vuejs/core/pull/3399
|
4
|
-
import '@vue/runtime-core'
|
5
|
-
|
6
|
-
export {}
|
7
|
-
|
8
|
-
declare module '@vue/runtime-core' {
|
9
|
-
export interface GlobalComponents {
|
10
|
-
RouterLink: typeof import('vue-router')['RouterLink']
|
11
|
-
RouterView: typeof import('vue-router')['RouterView']
|
12
|
-
VanButton: typeof import('vant/es')['Button']
|
13
|
-
}
|
14
|
-
}
|
/package/template-mobile-vant-cli/{mock/datasSource/api/index.ts → src/design/vant/index.less}
RENAMED
File without changes
|