update 完善了部分开发文档
This commit is contained in:
15
Web/public/doc-code/api/queue.js
Normal file
15
Web/public/doc-code/api/queue.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/* 使用关键字await */
|
||||
async function doc() {
|
||||
const res1 = await this.$api.apiName1(params1)
|
||||
const res2 = await this.$api.apiName2(params2)
|
||||
}
|
||||
|
||||
/* 使用$queue */
|
||||
this.$api
|
||||
.$queue([
|
||||
this.$api.apiName1Await(params1),
|
||||
this.$api.apiName2Await(params2),
|
||||
])
|
||||
.then(([_res1, _res2]) => {
|
||||
/* ... */
|
||||
})
|
||||
14
Web/public/doc-code/api/setting.js
Normal file
14
Web/public/doc-code/api/setting.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export default {
|
||||
/* 自定义的接口名称 */
|
||||
apiName: [
|
||||
/* 接口地址 */
|
||||
url,
|
||||
/* 请求类型 [get | post] */
|
||||
'get',
|
||||
/* axios所需的设置参数 */
|
||||
options,
|
||||
],
|
||||
|
||||
/* 默认为post的接口 */
|
||||
apiPostName: postUrl
|
||||
}
|
||||
11
Web/public/doc-code/api/usage.js
Normal file
11
Web/public/doc-code/api/usage.js
Normal file
@@ -0,0 +1,11 @@
|
||||
this.$api
|
||||
.apiName(params)
|
||||
.then((res) => {
|
||||
/* ... */
|
||||
})
|
||||
.catch((error) => {
|
||||
/* catch */
|
||||
})
|
||||
.finally(() => {
|
||||
/* finally */
|
||||
})
|
||||
14
Web/public/doc-code/auth/index.vue
Normal file
14
Web/public/doc-code/auth/index.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<section>
|
||||
<!-- 简单的权限标识 -->
|
||||
<Auth auth="sysApp:page">
|
||||
<a-button>按钮1</a-button>
|
||||
</Auth>
|
||||
<!-- 多个并且关系的权限标识 -->
|
||||
<Auth :auth="['sysApp:page', 'sysApp:add']"></Auth>
|
||||
<!-- 多个或者关系的权限标识 -->
|
||||
<Auth :auth="[['sysApp:page'], ['sysApp:add']]"></Auth>
|
||||
<!-- 前缀简化 -->
|
||||
<Auth :auth="{ sysApp: ['page', 'add'] }"></Auth>
|
||||
</section>
|
||||
</template>
|
||||
Reference in New Issue
Block a user