@gx-design-vue/create-gx-cli 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/main.js +9 -3
- package/template-mobile-vant-cli/.editorconfig +0 -19
- package/template-mobile-vant-cli/.env.development +0 -19
- package/template-mobile-vant-cli/.env.pro +0 -19
- package/template-mobile-vant-cli/.env.production +0 -19
- package/template-mobile-vant-cli/.eslintignore +0 -16
- package/template-mobile-vant-cli/.eslintrc.js +0 -64
- package/template-mobile-vant-cli/.prettierignore +0 -9
- package/template-mobile-vant-cli/.stylelintignore +0 -3
- package/template-mobile-vant-cli/build/cdn.ts +0 -5
- package/template-mobile-vant-cli/build/generateModifyVars.ts +0 -7
- package/template-mobile-vant-cli/build/optimizer.ts +0 -18
- package/template-mobile-vant-cli/build/plugin/autoImport.ts +0 -26
- package/template-mobile-vant-cli/build/plugin/html.ts +0 -26
- package/template-mobile-vant-cli/build/plugin/index.ts +0 -50
- package/template-mobile-vant-cli/build/plugin/mock.ts +0 -20
- package/template-mobile-vant-cli/build/script/postBuild.ts +0 -14
- package/template-mobile-vant-cli/index.html +0 -24
- package/template-mobile-vant-cli/mock/_createProductionServer.ts +0 -19
- package/template-mobile-vant-cli/mock/api/index.ts +0 -66
- package/template-mobile-vant-cli/mock/utils.ts +0 -9
- package/template-mobile-vant-cli/package.json +0 -64
- package/template-mobile-vant-cli/postcss.config.js +0 -8
- package/template-mobile-vant-cli/prettier.config.js +0 -18
- package/template-mobile-vant-cli/public/favicon.ico +0 -0
- package/template-mobile-vant-cli/public/js/flexible.js +0 -44
- package/template-mobile-vant-cli/src/App.vue +0 -5
- package/template-mobile-vant-cli/src/components/PageContainer/ProSkeleton.tsx +0 -30
- package/template-mobile-vant-cli/src/components/PageContainer/index.tsx +0 -114
- package/template-mobile-vant-cli/src/components/PageContainer/style.module.less +0 -14
- package/template-mobile-vant-cli/src/core/gx-design/index.ts +0 -7
- package/template-mobile-vant-cli/src/core/index.ts +0 -12
- package/template-mobile-vant-cli/src/core/vant-design/index.ts +0 -4
- package/template-mobile-vant-cli/src/design/config.less +0 -0
- package/template-mobile-vant-cli/src/design/index.less +0 -3
- package/template-mobile-vant-cli/src/design/reset.less +0 -155
- package/template-mobile-vant-cli/src/design/root.less +0 -3
- 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/hooks/web/index.ts +0 -5
- package/template-mobile-vant-cli/src/hooks/web/usePageLoading.ts +0 -55
- package/template-mobile-vant-cli/src/layout/BasicLayout.vue +0 -16
- package/template-mobile-vant-cli/src/layout/basicLayout.less +0 -11
- package/template-mobile-vant-cli/src/main.ts +0 -27
- package/template-mobile-vant-cli/src/pages/home.vue +0 -71
- package/template-mobile-vant-cli/src/router/index.ts +0 -24
- 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/services/index.ts +0 -31
- package/template-mobile-vant-cli/src/settings/index.ts +0 -10
- package/template-mobile-vant-cli/src/store/index.ts +0 -17
- package/template-mobile-vant-cli/src/store/modules/global.ts +0 -30
- package/template-mobile-vant-cli/src/utils/cryptoJS.ts +0 -39
- package/template-mobile-vant-cli/src/utils/env.ts +0 -52
- package/template-mobile-vant-cli/src/utils/pageTitle.ts +0 -12
- package/template-mobile-vant-cli/src/utils/request/XHR.ts +0 -131
- package/template-mobile-vant-cli/src/utils/request/axiosCancel.ts +0 -60
- package/template-mobile-vant-cli/src/utils/request/checkStatus.ts +0 -11
- package/template-mobile-vant-cli/src/utils/request/index.ts +0 -143
- package/template-mobile-vant-cli/src/utils/request/typings.ts +0 -114
- package/template-mobile-vant-cli/src/utils/storage.ts +0 -191
- package/template-mobile-vant-cli/src/utils/util.ts +0 -32
- package/template-mobile-vant-cli/src/utils/validate.ts +0 -28
- package/template-mobile-vant-cli/stylelint.config.js +0 -106
- package/template-mobile-vant-cli/tsconfig.json +0 -43
- package/template-mobile-vant-cli/types/auto-imports.d.ts +0 -61
- package/template-mobile-vant-cli/types/components.d.ts +0 -15
- package/template-mobile-vant-cli/types/global.d.ts +0 -36
- package/template-mobile-vant-cli/types/gx-components.d.ts +0 -13
- package/template-mobile-vant-cli/types/module.d.ts +0 -7
- package/template-mobile-vant-cli/types/response.d.ts +0 -12
- package/template-mobile-vant-cli/vite.config.ts +0 -113
- package/template-mobile-vant-html/css/global.css +0 -293
- package/template-mobile-vant-html/css/global.css.map +0 -1
- package/template-mobile-vant-html/css/global.less +0 -293
- package/template-mobile-vant-html/css/index.css +0 -20
- package/template-mobile-vant-html/css/index.css.map +0 -1
- package/template-mobile-vant-html/css/index.less +0 -21
- package/template-mobile-vant-html/image/disconnected.svg +0 -60
- package/template-mobile-vant-html/image/empty.svg +0 -52
- package/template-mobile-vant-html/image/error.svg +0 -53
- package/template-mobile-vant-html/image/loading.svg +0 -1
- package/template-mobile-vant-html/index.html +0 -91
- package/template-mobile-vant-html/js/index.js +0 -29
- package/template-mobile-vant-html/js/plugin/day.min.js +0 -1
- package/template-mobile-vant-html/js/plugin/fastclick.js +0 -730
- package/template-mobile-vant-html/js/plugin/jquery.min.js +0 -2
- package/template-mobile-vant-html/js/plugin/rem.js +0 -28
- package/template-mobile-vant-html/js/utils/appUtil.js +0 -70
- package/template-mobile-vant-html/js/utils/config.js +0 -3
- package/template-mobile-vant-html/js/utils/request.js +0 -61
- package/template-mobile-vant-html/js/utils/utils.js +0 -65
- package/template-mobile-vant-html/js/utils/validate.js +0 -292
@@ -1,191 +0,0 @@
|
|
1
|
-
import dayjs from 'dayjs'
|
2
|
-
import { isPro } from '@/utils/env'
|
3
|
-
import { Decrypt, Encrypt } from '@/utils/cryptoJS'
|
4
|
-
import { isJSONStr } from '@/utils/validate'
|
5
|
-
import { isObject } from '@gx-design-vue/pro-utils'
|
6
|
-
|
7
|
-
function isEncryption(status: boolean) {
|
8
|
-
return isPro() ? status : false
|
9
|
-
}
|
10
|
-
|
11
|
-
function handleStorageValue(value: string) {
|
12
|
-
if (isJSONStr(value)) return JSON.parse(value)
|
13
|
-
return value
|
14
|
-
}
|
15
|
-
|
16
|
-
/**
|
17
|
-
* @Author gx12358
|
18
|
-
* @DateTime 2019/12/3
|
19
|
-
* @lastTime 2019/12/3
|
20
|
-
* @description 设置Local-key的规则
|
21
|
-
*/
|
22
|
-
export function getStorageKey(key: string, originKey?: boolean) {
|
23
|
-
const { pkg } = __APP_INFO__
|
24
|
-
const { VITE_USE_MODE, VITE_APP_ENV } = import.meta.env
|
25
|
-
return originKey ? key : `live_${pkg.version}_${VITE_APP_ENV === 'dev'
|
26
|
-
? 'development'
|
27
|
-
: VITE_USE_MODE}_${key}`
|
28
|
-
}
|
29
|
-
|
30
|
-
/**
|
31
|
-
* @Author gx12358
|
32
|
-
* @DateTime 2019/12/3
|
33
|
-
* @lastTime 2019/12/3
|
34
|
-
* @description 获取Storage
|
35
|
-
*/
|
36
|
-
export function getStorage({
|
37
|
-
key,
|
38
|
-
encryption = true,
|
39
|
-
type = 'local',
|
40
|
-
originKey
|
41
|
-
}: { key: string, encryption?: boolean, type?: string, originKey?: boolean }) {
|
42
|
-
const storageValue = type === 'local' ?
|
43
|
-
localStorage.getItem(getStorageKey(key, originKey))
|
44
|
-
: sessionStorage.getItem(getStorageKey(key, originKey))
|
45
|
-
const result: string | LocalResult = storageValue ?
|
46
|
-
isEncryption(encryption) ? Decrypt(storageValue) : handleStorageValue(storageValue)
|
47
|
-
: ''
|
48
|
-
if (result && isObject(result)) {
|
49
|
-
if (result.expired) {
|
50
|
-
const expiredStatus = dayjs().diff(dayjs(result.time)) >= result.expired
|
51
|
-
if (expiredStatus) {
|
52
|
-
removeStorage(key, type)
|
53
|
-
return ''
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
return result?.['value'] || result || ''
|
58
|
-
}
|
59
|
-
|
60
|
-
/**
|
61
|
-
* @Author gx12358
|
62
|
-
* @DateTime 2019/12/3
|
63
|
-
* @lastTime 2019/12/3
|
64
|
-
* @description 设置Storage
|
65
|
-
*/
|
66
|
-
export function setStorage({
|
67
|
-
key,
|
68
|
-
value,
|
69
|
-
expired,
|
70
|
-
originKey,
|
71
|
-
encryption = true,
|
72
|
-
type = 'local'
|
73
|
-
}: {
|
74
|
-
key: string;
|
75
|
-
value: any;
|
76
|
-
originKey?: boolean;
|
77
|
-
expired?: number;
|
78
|
-
encryption?: boolean;
|
79
|
-
type?: string;
|
80
|
-
}) {
|
81
|
-
const result: LocalResult = originKey ? value : {
|
82
|
-
value,
|
83
|
-
time: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
84
|
-
expired: expired || 0
|
85
|
-
}
|
86
|
-
const storageValue = isEncryption(encryption) ? Encrypt(JSON.stringify(result)) : JSON.stringify(result)
|
87
|
-
if (type === 'local') localStorage.setItem(getStorageKey(key, originKey), storageValue)
|
88
|
-
sessionStorage.setItem(getStorageKey(key, originKey), storageValue)
|
89
|
-
}
|
90
|
-
|
91
|
-
/**
|
92
|
-
* @Author gx12358
|
93
|
-
* @DateTime 2019/12/3
|
94
|
-
* @lastTime 2019/12/3
|
95
|
-
* @description 删除Storage
|
96
|
-
*/
|
97
|
-
export function removeStorage(key: string, type = 'local', originKey?: boolean) {
|
98
|
-
if (type === 'local') localStorage.removeItem(getStorageKey(key, originKey))
|
99
|
-
sessionStorage.removeItem(getStorageKey(key, originKey))
|
100
|
-
}
|
101
|
-
|
102
|
-
/**
|
103
|
-
* @Author gx12358
|
104
|
-
* @DateTime 2019-09-24
|
105
|
-
* @lastTime 2019-09-24
|
106
|
-
* @description 获取Cookie-name
|
107
|
-
*/
|
108
|
-
function getCookies(cname: string) {
|
109
|
-
const name = `${cname}=`
|
110
|
-
const decodedCookie = decodeURIComponent(document.cookie)
|
111
|
-
const ca = decodedCookie.split(';')
|
112
|
-
for (let i = 0; i < ca.length; i += 1) {
|
113
|
-
let c = ca[i]
|
114
|
-
while (c.charAt(0) === ' ') {
|
115
|
-
c = c.substring(1)
|
116
|
-
}
|
117
|
-
if (c.indexOf(name) === 0) {
|
118
|
-
return decodeURIComponent(c.substring(name.length, c.length))
|
119
|
-
}
|
120
|
-
}
|
121
|
-
return ''
|
122
|
-
}
|
123
|
-
|
124
|
-
/**
|
125
|
-
* @Author gx12358
|
126
|
-
* @DateTime 2019-09-24
|
127
|
-
* @lastTime 2019-09-24
|
128
|
-
* @description 获取Cookiedomin
|
129
|
-
*/
|
130
|
-
function GetCookieDomain() {
|
131
|
-
let host = location.hostname
|
132
|
-
const ip = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
|
133
|
-
if (ip.test(host) === true || host === 'localhost') return host
|
134
|
-
const regex = /([^]*).*/
|
135
|
-
const match = host.match(regex)
|
136
|
-
if (typeof match !== 'undefined' && match !== null) {
|
137
|
-
const someIndex = 1
|
138
|
-
host = match[someIndex]
|
139
|
-
}
|
140
|
-
if (typeof host !== 'undefined' && host !== null) {
|
141
|
-
const strAry = host.split('.')
|
142
|
-
if (strAry.length > 1) {
|
143
|
-
host = `${strAry[strAry.length - 2]}.${strAry[strAry.length - 1]}`
|
144
|
-
}
|
145
|
-
}
|
146
|
-
return `.${host}`
|
147
|
-
}
|
148
|
-
|
149
|
-
/**
|
150
|
-
* @Author gx12358
|
151
|
-
* @DateTime 2019-09-24
|
152
|
-
* @lastTime 2019-09-24
|
153
|
-
* @description 设置Cookie
|
154
|
-
*/
|
155
|
-
export function setCookie(cname: string, cvalue: string, exdays?: number) {
|
156
|
-
const d = new Date()
|
157
|
-
d.setTime(d.getTime() + (exdays || 365) * 24 * 60 * 60 * 1000)
|
158
|
-
const expires = `=${d.toUTCString()}`
|
159
|
-
document.cookie = `${cname}=${encodeURIComponent(
|
160
|
-
cvalue
|
161
|
-
)}; expires=${expires}; domain=${GetCookieDomain()}; path=/`
|
162
|
-
}
|
163
|
-
|
164
|
-
/**
|
165
|
-
* @Author gx12358
|
166
|
-
* @DateTime 2019-09-24
|
167
|
-
* @lastTime 2019-09-24
|
168
|
-
* @description 获取Cookie
|
169
|
-
*/
|
170
|
-
export function getCookie(cname: string) {
|
171
|
-
const result = getCookies(cname)
|
172
|
-
if (result === '') {
|
173
|
-
return ''
|
174
|
-
}
|
175
|
-
return decodeURIComponent(result)
|
176
|
-
}
|
177
|
-
|
178
|
-
/**
|
179
|
-
* @Author gx12358
|
180
|
-
* @DateTime 2019-09-24
|
181
|
-
* @lastTime 2019-09-24
|
182
|
-
* @description 删除Cookie
|
183
|
-
*/
|
184
|
-
export function delCookie(name: string) {
|
185
|
-
const exp = new Date()
|
186
|
-
exp.setTime(exp.getTime() - 1)
|
187
|
-
const cval = getCookies(name)
|
188
|
-
if (cval !== null) {
|
189
|
-
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; domain=${GetCookieDomain()}; path=/`
|
190
|
-
}
|
191
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
export function deepCopy(data) {
|
2
|
-
return JSON.parse(JSON.stringify(data))
|
3
|
-
}
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @Author gx12358
|
7
|
-
* @DateTime 2021/11/3
|
8
|
-
* @lastTime 2021/11/3
|
9
|
-
* @description get参数处理
|
10
|
-
*/
|
11
|
-
export function tansParams(params) {
|
12
|
-
let result = ''
|
13
|
-
for (const propName of Object.keys(params)) {
|
14
|
-
const value = params[propName]
|
15
|
-
const part = encodeURIComponent(propName) + '='
|
16
|
-
if (value !== null && typeof (value) !== 'undefined' && value !== '') {
|
17
|
-
if (typeof value === 'object') {
|
18
|
-
for (const key of Object.keys(value)) {
|
19
|
-
if (value[key] !== null && typeof (value[key]) !== 'undefined') {
|
20
|
-
const params = propName + '[' + key + ']'
|
21
|
-
const subPart = encodeURIComponent(params) + '='
|
22
|
-
result += subPart + encodeURIComponent(value[key]) + '&'
|
23
|
-
}
|
24
|
-
}
|
25
|
-
} else {
|
26
|
-
result += part + encodeURIComponent(value) + '&'
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
return result
|
31
|
-
}
|
32
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @Author gaoxiang
|
3
|
-
* @DateTime 2020/11/4
|
4
|
-
* @lastTime 2020/11/4
|
5
|
-
* @description 判断是否是JSON字符串
|
6
|
-
*/
|
7
|
-
export function isJSONStr(str: any) {
|
8
|
-
if (typeof str === 'string') {
|
9
|
-
try {
|
10
|
-
const obj = JSON.parse(str)
|
11
|
-
if (typeof obj === 'object' && obj) {
|
12
|
-
return true
|
13
|
-
} else {
|
14
|
-
return false
|
15
|
-
}
|
16
|
-
} catch (e) {
|
17
|
-
return false
|
18
|
-
}
|
19
|
-
}
|
20
|
-
return false
|
21
|
-
}
|
22
|
-
|
23
|
-
export function checkURL(URL) {
|
24
|
-
const str = URL,
|
25
|
-
Expression = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/,
|
26
|
-
objExp = new RegExp(Expression)
|
27
|
-
return objExp.test(str)
|
28
|
-
}
|
@@ -1,106 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
root: true,
|
3
|
-
plugins: [ 'stylelint-order' ],
|
4
|
-
extends: [ 'stylelint-config-standard', 'stylelint-config-prettier' ],
|
5
|
-
customSyntax: 'postcss-html',
|
6
|
-
rules: {
|
7
|
-
'number-leading-zero': false,
|
8
|
-
'alpha-value-notation': false,
|
9
|
-
'color-function-notation': false,
|
10
|
-
'no-eol-whitespace': false,
|
11
|
-
'function-no-unknown': null,
|
12
|
-
'selector-class-pattern': null,
|
13
|
-
'selector-pseudo-class-no-unknown': [
|
14
|
-
true,
|
15
|
-
{
|
16
|
-
ignorePseudoClasses: [ 'global' ]
|
17
|
-
}
|
18
|
-
],
|
19
|
-
'selector-pseudo-element-no-unknown': [
|
20
|
-
true,
|
21
|
-
{
|
22
|
-
ignorePseudoElements: [ 'v-deep' ]
|
23
|
-
}
|
24
|
-
],
|
25
|
-
'at-rule-no-unknown': [
|
26
|
-
true,
|
27
|
-
{
|
28
|
-
ignoreAtRules: [
|
29
|
-
'tailwind',
|
30
|
-
'apply',
|
31
|
-
'variants',
|
32
|
-
'responsive',
|
33
|
-
'screen',
|
34
|
-
'function',
|
35
|
-
'if',
|
36
|
-
'each',
|
37
|
-
'include',
|
38
|
-
'mixin'
|
39
|
-
]
|
40
|
-
}
|
41
|
-
],
|
42
|
-
'no-empty-source': null,
|
43
|
-
'font-family-name-quotes': null,
|
44
|
-
'declaration-colon-newline-after': null,
|
45
|
-
'selector-pseudo-element-colon-notation': null,
|
46
|
-
'string-quotes': null,
|
47
|
-
'named-grid-areas-no-invalid': null,
|
48
|
-
'unicode-bom': 'never',
|
49
|
-
'no-descending-specificity': null,
|
50
|
-
'font-family-no-missing-generic-family-keyword': null,
|
51
|
-
'declaration-colon-space-after': 'always-single-line',
|
52
|
-
'declaration-colon-space-before': 'never',
|
53
|
-
'rule-empty-line-before': [
|
54
|
-
'always',
|
55
|
-
{
|
56
|
-
ignore: [ 'after-comment', 'first-nested' ]
|
57
|
-
}
|
58
|
-
],
|
59
|
-
'unit-no-unknown': [ true, { ignoreUnits: [ 'rpx' ] } ],
|
60
|
-
'order/order': [
|
61
|
-
[
|
62
|
-
'dollar-variables',
|
63
|
-
'custom-properties',
|
64
|
-
'at-rules',
|
65
|
-
'declarations',
|
66
|
-
{
|
67
|
-
type: 'at-rule',
|
68
|
-
name: 'supports'
|
69
|
-
},
|
70
|
-
{
|
71
|
-
type: 'at-rule',
|
72
|
-
name: 'media'
|
73
|
-
},
|
74
|
-
'rules'
|
75
|
-
],
|
76
|
-
{ severity: 'warning' }
|
77
|
-
]
|
78
|
-
},
|
79
|
-
ignoreFiles: [ '**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts' ],
|
80
|
-
overrides: [
|
81
|
-
{
|
82
|
-
files: [ '*.vue', '**/*.vue', '**/*.ts', '**/*.tsx', '*.html', '**/*.html' ],
|
83
|
-
extends: [ 'stylelint-config-recommended', 'stylelint-config-html' ],
|
84
|
-
rules: {
|
85
|
-
'keyframes-name-pattern': null,
|
86
|
-
'selector-pseudo-class-no-unknown': [
|
87
|
-
true,
|
88
|
-
{
|
89
|
-
ignorePseudoClasses: [ 'deep', 'global' ]
|
90
|
-
}
|
91
|
-
],
|
92
|
-
'selector-pseudo-element-no-unknown': [
|
93
|
-
true,
|
94
|
-
{
|
95
|
-
ignorePseudoElements: [ 'v-deep', 'v-global', 'v-slotted' ]
|
96
|
-
}
|
97
|
-
]
|
98
|
-
}
|
99
|
-
},
|
100
|
-
{
|
101
|
-
files: [ '*.less', '**/*.less' ],
|
102
|
-
customSyntax: 'postcss-less',
|
103
|
-
extends: [ 'stylelint-config-standard', 'stylelint-config-recommended-vue' ]
|
104
|
-
}
|
105
|
-
]
|
106
|
-
}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"target": "esnext",
|
4
|
-
"module": "esnext",
|
5
|
-
"moduleResolution": "node",
|
6
|
-
"forceConsistentCasingInFileNames": true,
|
7
|
-
"allowSyntheticDefaultImports": true,
|
8
|
-
"strictFunctionTypes": false,
|
9
|
-
"jsx": "preserve",
|
10
|
-
"baseUrl": "./",
|
11
|
-
"scripts": false,
|
12
|
-
"noEmit": true,
|
13
|
-
"allowJs": true,
|
14
|
-
"sourceMap": true,
|
15
|
-
"esModuleInterop": true,
|
16
|
-
"resolveJsonModule": true,
|
17
|
-
"experimentalDecorators": true,
|
18
|
-
"lib": ["dom", "esnext"],
|
19
|
-
"types": ["vite/client"],
|
20
|
-
"typeRoots": ["./node_modules/@types/", "./types"],
|
21
|
-
"skipLibCheck": true,
|
22
|
-
"paths": {
|
23
|
-
"@/*": ["src/*"],
|
24
|
-
"@gx-mobile/hooks/*": ["src/hooks/*"],
|
25
|
-
"@gx-vuex": ["src/store/index.ts"]
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"include": [
|
29
|
-
"tests/**/*.ts",
|
30
|
-
"src/**/*.ts",
|
31
|
-
"src/**/*.less",
|
32
|
-
"src/**/*.d.ts",
|
33
|
-
"src/**/*.tsx",
|
34
|
-
"src/**/*.vue",
|
35
|
-
"types/**/*.d.ts",
|
36
|
-
"types/**/*.ts",
|
37
|
-
"build/**/*.ts",
|
38
|
-
"build/**/*.d.ts",
|
39
|
-
"mock/**/*.ts",
|
40
|
-
"vite.config.ts"
|
41
|
-
],
|
42
|
-
"exclude": ["node_modules", "tests/server/**/*.ts", "dist", "**/*.js", ".history"]
|
43
|
-
}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
// Generated by 'unplugin-auto-import'
|
2
|
-
export {}
|
3
|
-
declare global {
|
4
|
-
const EffectScope: typeof import('vue')['EffectScope']
|
5
|
-
const computed: typeof import('vue')['computed']
|
6
|
-
const createApp: typeof import('vue')['createApp']
|
7
|
-
const customRef: typeof import('vue')['customRef']
|
8
|
-
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
9
|
-
const defineComponent: typeof import('vue')['defineComponent']
|
10
|
-
const effectScope: typeof import('vue')['effectScope']
|
11
|
-
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
12
|
-
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
13
|
-
const h: typeof import('vue')['h']
|
14
|
-
const inject: typeof import('vue')['inject']
|
15
|
-
const isProxy: typeof import('vue')['isProxy']
|
16
|
-
const isReactive: typeof import('vue')['isReactive']
|
17
|
-
const isReadonly: typeof import('vue')['isReadonly']
|
18
|
-
const isRef: typeof import('vue')['isRef']
|
19
|
-
const markRaw: typeof import('vue')['markRaw']
|
20
|
-
const nextTick: typeof import('vue')['nextTick']
|
21
|
-
const onActivated: typeof import('vue')['onActivated']
|
22
|
-
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
23
|
-
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
24
|
-
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
25
|
-
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
26
|
-
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
27
|
-
const onDeactivated: typeof import('vue')['onDeactivated']
|
28
|
-
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
29
|
-
const onMounted: typeof import('vue')['onMounted']
|
30
|
-
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
31
|
-
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
32
|
-
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
33
|
-
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
34
|
-
const onUnmounted: typeof import('vue')['onUnmounted']
|
35
|
-
const onUpdated: typeof import('vue')['onUpdated']
|
36
|
-
const provide: typeof import('vue')['provide']
|
37
|
-
const reactive: typeof import('vue')['reactive']
|
38
|
-
const readonly: typeof import('vue')['readonly']
|
39
|
-
const ref: typeof import('vue')['ref']
|
40
|
-
const resolveComponent: typeof import('vue')['resolveComponent']
|
41
|
-
const resolveDirective: typeof import('vue')['resolveDirective']
|
42
|
-
const shallowReactive: typeof import('vue')['shallowReactive']
|
43
|
-
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
44
|
-
const shallowRef: typeof import('vue')['shallowRef']
|
45
|
-
const toRaw: typeof import('vue')['toRaw']
|
46
|
-
const toRef: typeof import('vue')['toRef']
|
47
|
-
const toRefs: typeof import('vue')['toRefs']
|
48
|
-
const triggerRef: typeof import('vue')['triggerRef']
|
49
|
-
const unref: typeof import('vue')['unref']
|
50
|
-
const useAttrs: typeof import('vue')['useAttrs']
|
51
|
-
const useCssModule: typeof import('vue')['useCssModule']
|
52
|
-
const useCssVars: typeof import('vue')['useCssVars']
|
53
|
-
const useLink: typeof import('vue-router')['useLink']
|
54
|
-
const useRoute: typeof import('vue-router')['useRoute']
|
55
|
-
const useRouter: typeof import('vue-router')['useRouter']
|
56
|
-
const useSlots: typeof import('vue')['useSlots']
|
57
|
-
const watch: typeof import('vue')['watch']
|
58
|
-
const watchEffect: typeof import('vue')['watchEffect']
|
59
|
-
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
60
|
-
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
61
|
-
}
|
@@ -1,15 +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
|
-
VanCell: typeof import('vant/es')['Cell']
|
14
|
-
}
|
15
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import type { PropType as VuePropType } from 'vue'
|
2
|
-
|
3
|
-
declare global {
|
4
|
-
const __APP_INFO__: {
|
5
|
-
pkg: {
|
6
|
-
name: string;
|
7
|
-
version: string;
|
8
|
-
dependencies: RecordType;
|
9
|
-
devDependencies: RecordType;
|
10
|
-
};
|
11
|
-
lastBuildTime: string;
|
12
|
-
}
|
13
|
-
|
14
|
-
declare type LocalResult = {
|
15
|
-
value: any;
|
16
|
-
time: string;
|
17
|
-
expired: number;
|
18
|
-
}
|
19
|
-
|
20
|
-
declare type PropType<T> = VuePropType<T>;
|
21
|
-
|
22
|
-
declare type RecordType<T = string, K = any> = Record<T, K>;
|
23
|
-
|
24
|
-
declare interface ViteEnv {
|
25
|
-
VITE_USE_MODE: string;
|
26
|
-
VITE_USE_CDN: boolean;
|
27
|
-
VITE_USE_MOCK: boolean;
|
28
|
-
VITE_USE_V_CONSOLE: boolean;
|
29
|
-
VITE_NODE_ENV: string;
|
30
|
-
VITE_BASE_URL: string;
|
31
|
-
VITE_APP_ENV: string;
|
32
|
-
VITE_DROP_CONSOLE: boolean;
|
33
|
-
}
|
34
|
-
|
35
|
-
declare type ViteEnvKey = keyof ViteEnv
|
36
|
-
}
|
@@ -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/vue-next/pull/3399
|
4
|
-
import '@vue/runtime-core'
|
5
|
-
|
6
|
-
export {}
|
7
|
-
|
8
|
-
declare module '@vue/runtime-core' {
|
9
|
-
export interface GlobalComponents {
|
10
|
-
GProPageContainer: typeof import('./../src/components/PageContainer')['default']
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|
@@ -1,113 +0,0 @@
|
|
1
|
-
import type { UserConfig, ConfigEnv, ProxyOptions } from 'vite'
|
2
|
-
import { loadEnv } from 'vite'
|
3
|
-
import { resolve } from 'path'
|
4
|
-
import dayjs from 'dayjs'
|
5
|
-
|
6
|
-
import { configManualChunk } from './build/optimizer'
|
7
|
-
import { createVitePlugins } from './build/plugin'
|
8
|
-
import { generateModifyVars } from './build/generateModifyVars'
|
9
|
-
|
10
|
-
import pkg from './package.json'
|
11
|
-
|
12
|
-
const { dependencies, devDependencies, name, version } = pkg
|
13
|
-
|
14
|
-
const __APP_INFO__ = {
|
15
|
-
pkg: { dependencies, devDependencies, name, version },
|
16
|
-
lastBuildTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
17
|
-
}
|
18
|
-
|
19
|
-
function pathResolve(dir: string) {
|
20
|
-
return resolve(process.cwd(), '.', dir)
|
21
|
-
}
|
22
|
-
|
23
|
-
function createProxy(prefix) {
|
24
|
-
const ret: RecordType = {}
|
25
|
-
const proxy: ProxyOptions = {
|
26
|
-
target: 'https://127.0.0.1',
|
27
|
-
changeOrigin: true,
|
28
|
-
ws: true,
|
29
|
-
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), `${prefix}`)
|
30
|
-
}
|
31
|
-
ret[prefix] = proxy
|
32
|
-
return ret
|
33
|
-
}
|
34
|
-
|
35
|
-
function wrapperEnv(envConf: RecordType): ViteEnv {
|
36
|
-
const ret: any = {}
|
37
|
-
|
38
|
-
for (const envName of Object.keys(envConf)) {
|
39
|
-
let realName = envConf[envName].replace(/\\n/g, '\n')
|
40
|
-
realName = realName === 'true' ? true : realName === 'false' ? false : realName
|
41
|
-
|
42
|
-
ret[envName] = realName
|
43
|
-
process.env[envName] = realName
|
44
|
-
}
|
45
|
-
return ret
|
46
|
-
}
|
47
|
-
|
48
|
-
export default ({ mode, command }: ConfigEnv): UserConfig => {
|
49
|
-
const root = process.cwd()
|
50
|
-
|
51
|
-
const env = loadEnv(mode, root)
|
52
|
-
|
53
|
-
// The boolean type read by loadEnv is a string. This function can be converted to boolean type
|
54
|
-
const viteEnv = wrapperEnv(env)
|
55
|
-
|
56
|
-
const { VITE_BASE_URL, VITE_DROP_CONSOLE } = viteEnv
|
57
|
-
|
58
|
-
const isBuild = command === 'build'
|
59
|
-
|
60
|
-
return {
|
61
|
-
base: './',
|
62
|
-
resolve: {
|
63
|
-
alias: [
|
64
|
-
{
|
65
|
-
find: '@',
|
66
|
-
replacement: pathResolve('src') + '/'
|
67
|
-
},
|
68
|
-
{
|
69
|
-
find: '@gx-vuex',
|
70
|
-
replacement: pathResolve('src/store') + '/index.ts'
|
71
|
-
},
|
72
|
-
{
|
73
|
-
find: '@gx-mobile/hooks',
|
74
|
-
replacement: pathResolve('src/hooks')
|
75
|
-
},
|
76
|
-
{ find: /^~/, replacement: '' }
|
77
|
-
]
|
78
|
-
},
|
79
|
-
server: {
|
80
|
-
host: true,
|
81
|
-
port: 9260,
|
82
|
-
proxy: createProxy(VITE_BASE_URL)
|
83
|
-
},
|
84
|
-
plugins: createVitePlugins(viteEnv, isBuild),
|
85
|
-
define: {
|
86
|
-
__INTLIFY_PROD_DEVTOOLS__: false,
|
87
|
-
__APP_INFO__: JSON.stringify(__APP_INFO__)
|
88
|
-
},
|
89
|
-
esbuild: {
|
90
|
-
drop: VITE_DROP_CONSOLE ? [ 'console', 'debugger' ] : []
|
91
|
-
},
|
92
|
-
build: {
|
93
|
-
assetsDir: 'assets',
|
94
|
-
chunkSizeWarningLimit: 2500,
|
95
|
-
rollupOptions: {
|
96
|
-
output: {
|
97
|
-
manualChunks: configManualChunk
|
98
|
-
}
|
99
|
-
}
|
100
|
-
},
|
101
|
-
css: {
|
102
|
-
modules: {
|
103
|
-
generateScopedName: 'gx-mobile-[local]-[hash:base64:5]'
|
104
|
-
},
|
105
|
-
preprocessorOptions: {
|
106
|
-
less: {
|
107
|
-
modifyVars: generateModifyVars(),
|
108
|
-
javascriptEnabled: true
|
109
|
-
}
|
110
|
-
}
|
111
|
-
}
|
112
|
-
}
|
113
|
-
}
|