Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
ecf065e8
Commit
ecf065e8
authored
Jun 01, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码结构调整
parent
6e346b7f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
11 deletions
+22
-11
index.ts
src/api/index.ts
+19
-8
file.ts
src/api/modules/file.ts
+0
-0
proof.ts
src/api/modules/proof.ts
+0
-0
template.ts
src/api/modules/template.ts
+0
-0
user.ts
src/api/modules/user.ts
+0
-0
index.ts
src/components/index.ts
+1
-1
main.ts
src/main.ts
+2
-2
No files found.
src/api/index.ts
View file @
ecf065e8
import
file
from
'@/api/file'
;
import
proof
from
'@/api/proof'
;
import
template
from
'@/api/template'
;
import
user
from
'@/api/user'
;
// import file from '@/api/file';
// import proof from '@/api/proof';
// import template from '@/api/template';
// import user from '@/api/user';
// export default {
// file,
// proof,
// template,
// user,
// };
const
apiContext
=
require
.
context
(
'./modules/'
,
true
,
/
\.
ts$/
);
const
apis
:
any
=
{};
apiContext
.
keys
().
forEach
((
key
:
string
)
=>
{
const
apiName
:
string
|
undefined
=
key
.
split
(
'/'
).
pop
()?.
replace
(
/
\.\w
+$/
,
''
);
apis
[(
apiName
as
string
)]
=
apiContext
(
key
).
default
;
});
export
default
{
file
,
proof
,
template
,
user
,
install
(
Vue
:
any
)
{
Vue
.
prototype
.
$api
=
apis
;
},
};
src/api/file.ts
→
src/api/
modules/
file.ts
View file @
ecf065e8
File moved
src/api/proof.ts
→
src/api/
modules/
proof.ts
View file @
ecf065e8
File moved
src/api/template.ts
→
src/api/
modules/
template.ts
View file @
ecf065e8
File moved
src/api/user.ts
→
src/api/
modules/
user.ts
View file @
ecf065e8
File moved
src/components/index.ts
View file @
ecf065e8
...
...
@@ -2,7 +2,7 @@ import { importAll } from '@/utils/utils';
const
components
=
importAll
(
require
.
context
(
'./'
,
true
,
/
\.
vue$/
));
export
default
{
install
(
Vue
:
any
)
{
Object
.
keys
(
components
).
forEach
(
key
=>
{
Object
.
keys
(
components
).
forEach
(
(
key
:
string
)
=>
{
Vue
.
component
(
key
,
components
[
key
]);
});
},
...
...
src/main.ts
View file @
ecf065e8
...
...
@@ -2,9 +2,9 @@ import Vue from 'vue';
import
App
from
'./App.vue'
;
import
router
from
'./router'
;
import
store
from
'./store'
;
import
api
from
'./api'
;
Vue
.
prototype
.
$api
=
api
;
import
apis
from
'./api/index'
;
Vue
.
use
(
apis
);
import
components
from
'@/components'
;
Vue
.
use
(
components
);
import
'@/filter'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment