-
Notifications
You must be signed in to change notification settings - Fork 7
SensecCAP Demo Website (English)
Jancee JX | 王静茜 edited this page Jan 6, 2020
·
1 revision
- Install node
- Install npm
- Download the project, extract it, import it into IDE, and execute it in the project directory
npm install
- Execute startup command after compilation
npm run dev
- build Pack
npm run build
#API configurationapi.js
#API invoke address
let apiHost = (window.location.protocol.indexOf('https') !== -1 ? 'https://' : 'http://') + ip+port(Your Java project access address)
#api
let apiUrl = {
****
}
views/index/index.vue homepage
-- / -- /components/control.vue
/warning.vue
/chart.vue
/history.vue
/range.vue
/run.vue
/soil.vue
/meteorology.vue
/video.vue
services/ajax.js Encapsulating Ajax files is convenient for unified management of Ajax calls
services/api.js ncapsulate all APIs for multi page calling
config/index.js Parameter configuration (update data time)
assets/lang/cn.js CN
assets/lang/en.js EN
main.js Configurable language in
get方式
(```)
ajax.getData(api_url, {
params: {
id: 001
}
}).then(res => {
if (res.code == 0) {
} else {
}
}).catch(err => {
})
(```)
post方式(patch/patchData、delete/deleteData、put/putData)
(```)
ajax.postData(api_url, {
id: 001
}).then(res => {
if (res.code == 0) {
} else {
}
}).catch(err => {
})
(```)