中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

貴陽(yáng)建設(shè)工程招投標(biāo)網(wǎng)站谷歌推廣代理商

貴陽(yáng)建設(shè)工程招投標(biāo)網(wǎng)站,谷歌推廣代理商,wordpress添加超鏈接,什么是百度推廣1 關(guān)于統(tǒng)一集中管理API的一些思考 1、統(tǒng)一集中管理是保證工程性項(xiàng)目得保質(zhì)、保量、成功實(shí)施,并對(duì)后期維護(hù)提供數(shù)據(jù)支撐的最有效,最節(jié)省資源和時(shí)間的技能和做法,軟件做為一種特殊的工程性項(xiàng)目,也符合上述特性。 2、由于在前臺(tái)實(shí)現(xiàn)中…

1 關(guān)于統(tǒng)一集中管理API的一些思考

??? 1、統(tǒng)一集中管理是保證工程性項(xiàng)目得保質(zhì)、保量、成功實(shí)施,并對(duì)后期維護(hù)提供數(shù)據(jù)支撐的最有效,最節(jié)省資源和時(shí)間的技能和做法,軟件做為一種特殊的工程性項(xiàng)目,也符合上述特性。

??? 2、由于在前臺(tái)實(shí)現(xiàn)中一個(gè)URL可能需要多次被調(diào)用,如果把一個(gè)URL封裝到一個(gè)實(shí)例的指定方法中,同一個(gè)項(xiàng)目以大量減少重復(fù)性的代碼。

??? 3、統(tǒng)一集中管理API的另外一個(gè)好處是,如果后臺(tái)的API方法發(fā)生變更,需要把該AIP所對(duì)應(yīng)的封裝方法中的URL修改即可以,不再需要對(duì)大量的同一個(gè)URL進(jìn)行修改操作。

??? 4、有些開發(fā)者習(xí)慣于把統(tǒng)一集中管理API與Axios攔截守同時(shí)定義在同一個(gè)JS文件中,但這種實(shí)踐方案在本人看來(lái)是不好的,最好的實(shí)事是把統(tǒng)一集中管理API與Axios攔截守分開定義在兩個(gè)不同的JS文件中,API JS文件引用Axios JS文件中的攔截守實(shí)例,從而實(shí)現(xiàn)對(duì)一個(gè)URL封裝,這也是本人會(huì)先在前面章節(jié)中會(huì)先講述Axios攔截守的原理和抽離的實(shí)現(xiàn)。

2 抽離定義API集中管理:src\common\http.api.js

import axiosInterceptor from './http.interceptor.js';

/****************************API集中管理--后臺(tái)首頁(yè)************************************/

export const getHomeAdminIndex = async () => {

? ? return await axiosInterceptor.get('/HomeAdmin/Index');

};

/****************************API集中管理--用戶模塊************************************/

//1個(gè)指定用戶的登錄操作。

export const postCustomerLogin = async params => {

? ? return await axiosInterceptor.post('/Customer/Login', params);

};

//獲取1個(gè)指定用戶的信息。

export const getCustomerInfo = async params => {

? ? return await axiosInterceptor.get('/Customer/Info', {

? ? ? ? params: params

? ? });

};

//1個(gè)指定用戶實(shí)例持久化到用戶表中。

export const postCustomerAdd = async params => {

? ? return await axiosInterceptor.post('/Customer/CreatePost', params);

};

//1個(gè)指定用戶實(shí)例持久化更新到用戶表中。

export const putCustomerEdit = async params => {

? ? return await axiosInterceptor.put('/Customer/EditPut', params);

};

//1個(gè)指定用戶實(shí)例從用戶表中物理刪除。

export const deleteCustomer = async params => {

? ? return await axiosInterceptor.delete('/Customer/Delete', {

? ? ? ? params: params

? ? });

};

//所有用戶實(shí)例的分頁(yè)渲染顯示。

export const postCustomerIndex = async params => {

? ? return await axiosInterceptor.post('/Customer/Index', params);

};

3 重構(gòu)端管理首頁(yè):src\views\WelcomeView.vue

<template>

? ? <h1>WelcomeView-----Amin</h1>

</template>

<script>

? ? import {

? ? ? ? getHomeAdminIndex,

? ? ? ? getCustomerInfo,

? ? ? ? postCustomerAdd,

? ? ? ? putCustomerEdit,

? ? ? ? deleteCustomer,

? ? ? ? postCustomerIndex

? ? } from '../common/http.api.js';

? ? export default {

? ? ? ? data() {

? ? ? ? ? ? return {};

? ? ? ? },

? ? ? ? methods: {

? ? ? ? ? ? async getHomeAdminIndex() {

? ? ? ? ? ? ? ? let res = await getHomeAdminIndex();

? ? ? ? ? ? ? ? console.log(res.data);

? ? ? ? ? ? ? ? let customerIdParam = {

? ? ? ? ? ? ? ? ? ? customerId: 1,

? ? ? ? ? ? ? ? };

? ? ? ? ? ? ? ? res = await getCustomerInfo(customerIdParam);

? ? ? ? ? ? ? ? console.log(res.data);

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? let customer = {

? ? ? ? ? ? ? ? ? ? Name: "AAAAA@yourStore.com",

? ? ? ? ? ? ? ? ? ? Email: "AAAAA@yourStore.com",

? ? ? ? ? ? ? ? ? ? CreatedDateTime: new Date(),

? ? ? ? ? ? ? ? ? ? UpdatedDateTime: new Date()

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? res = await postCustomerAdd(JSON.stringify(customer));

? ? ? ? ? ? ? ? console.log(res.data);

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? let customerPut = {

? ? ? ? ? ? ? ? ? ? Id: 3,

? ? ? ? ? ? ? ? ? ? Name: "AAAAAcustomerPut@yourStore.com",

? ? ? ? ? ? ? ? ? ? Email: "AAAAAcustomerPut@yourStore.com",

? ? ? ? ? ? ? ? ? ? CreatedDateTime: new Date(),

? ? ? ? ? ? ? ? ? ? UpdatedDateTime: new Date()

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? res = await putCustomerEdit(JSON.stringify(customerPut));

? ? ? ? ? ? ? ? console.log(res.data);

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? let customerIdDelete = {

? ? ? ? ? ? ? ? ? ? customerId: 3,

? ? ? ? ? ? ? ? };

? ? ? ? ? ? ? ? res = await deleteCustomer(customerIdDelete);

? ? ? ? ? ? ? ? console.log(res.data);

? ? ? ? ? ? ? ? let pagination = {

? ? ? ? ? ? ? ? ? ? pageIndex: 1, //初始化當(dāng)前頁(yè),即第1頁(yè)。

? ? ? ? ? ? ? ? ? ? pageSize: 15, //初始化每頁(yè)最多所包含的項(xiàng)數(shù)值,即每頁(yè)最多所包含15項(xiàng)。

? ? ? ? ? ? ? ? ? ? totalCount: 0, //初始化數(shù)據(jù)源的總計(jì)項(xiàng)數(shù)值,由于還沒(méi)有加載數(shù)據(jù)源所以該值為:0。

? ? ? ? ? ? ? ? ? ? //初始化排序字段及其方式。

? ? ? ? ? ? ? ? ? ? OrderByFiled: JSON.stringify({

? ? ? ? ? ? ? ? ? ? ? ? filed: 'id',

? ? ? ? ? ? ? ? ? ? ? ? type: 'descending',

? ? ? ? ? ? ? ? ? ? }),

? ? ? ? ? ? ? ? ? ? QueryCondition: ""

? ? ? ? ? ? ? ? };

? ? ? ? ? ? ? ? res = await postCustomerIndex(JSON.stringify(pagination));

? ? ? ? ? ? ? ? console.log(res.data);

? ? ? ? ? ? },

? ? ? ? },

? ? ? ? async mounted() {

? ? ? ? ? ? await this.getHomeAdminIndex();

? ? ? ? },

? ? };


</script>

對(duì)以上功能更為具體實(shí)現(xiàn)和注釋見(jiàn):230222_011shopvue(API統(tǒng)一集中管理)。

http://www.risenshineclean.com/news/22957.html

相關(guān)文章:

  • 網(wǎng)站建設(shè)中圖標(biāo)網(wǎng)絡(luò)營(yíng)銷方式方法
  • 西安做企業(yè)網(wǎng)站網(wǎng)站點(diǎn)擊軟件排名
  • 婚慶攝影企業(yè)網(wǎng)站企業(yè)seo顧問(wèn)服務(wù)
  • 電腦視頻制作軟件搜索引擎優(yōu)化的定義
  • 優(yōu)惠券網(wǎng)站開發(fā)哪家好軟件推廣的渠道是哪里找的
  • 標(biāo)題設(shè)計(jì)網(wǎng)站培訓(xùn)網(wǎng)站
  • 徐州做英文網(wǎng)站的公司廣告營(yíng)銷留電話網(wǎng)站
  • 網(wǎng)站開發(fā)的流程圖和原型圖百度關(guān)鍵詞優(yōu)化怎么做
  • wordpress 前端傳文件廣州seo優(yōu)化推廣
  • 網(wǎng)站優(yōu)化哪家好網(wǎng)絡(luò)營(yíng)銷做的好的企業(yè)
  • 模板板網(wǎng)站關(guān)鍵詞生成器在線
  • 硬件開發(fā)工資高嗎重慶排名seo公司
  • 計(jì)算機(jī)網(wǎng)站的開發(fā)流程湖南百度推廣
  • 門戶網(wǎng)站建設(shè)美麗李守洪
  • 房屋自建設(shè)計(jì)哪個(gè)網(wǎng)站好網(wǎng)絡(luò)推廣seo教程
  • 怎么制作網(wǎng)站彈出廣告湖人最新消息
  • 營(yíng)銷網(wǎng)站建設(shè)公司哪家好域名注冊(cè)商怎么查
  • 東營(yíng)做網(wǎng)站m0536企業(yè)網(wǎng)站推廣注意事項(xiàng)
  • 深圳市公司網(wǎng)站建設(shè)價(jià)格先做后付費(fèi)的代運(yùn)營(yíng)
  • 網(wǎng)站搜索排名優(yōu)化軟件鄭州百度快照優(yōu)化排名
  • 網(wǎng)站開發(fā)規(guī)劃seo運(yùn)營(yíng)做什么
  • asp.net做網(wǎng)站教程百度seo外包
  • wordpress 漂浮窗口seog
  • 西安政府網(wǎng)站制作百度自動(dòng)搜索關(guān)鍵詞軟件
  • 自己動(dòng)手做一個(gè)網(wǎng)頁(yè)seo型網(wǎng)站
  • 西昌手機(jī)網(wǎng)站疫情最新動(dòng)態(tài)
  • 西安哪個(gè)公司可以做網(wǎng)站城市分站seo
  • 網(wǎng)站建設(shè) 鴻商品關(guān)鍵詞怎么優(yōu)化
  • 企業(yè)網(wǎng)站建設(shè)服務(wù)熱線百度q3財(cái)報(bào)減虧170億
  • 企業(yè)注冊(cè)登記seo對(duì)網(wǎng)店推廣的作用