相关接口配置修改
This commit is contained in:
parent
d772f9728d
commit
48f70bd46d
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import Http from './request'
|
||||
import HttpConfig from './http'
|
||||
|
||||
const login = {
|
||||
async loginApp (data = {} , header = {}){
|
||||
return await Http.post(
|
||||
HttpConfig.baseUrl,
|
||||
HttpConfig.serviceUrl.login.loginApp,
|
||||
data,
|
||||
header
|
||||
)
|
||||
},
|
||||
async registerApp (data = {} , header = {}){
|
||||
return await Http.post(
|
||||
HttpConfig.baseUrl,
|
||||
HttpConfig.serviceUrl.login.registerApp,
|
||||
data,
|
||||
header
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
login
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
class HttpConfig {
|
||||
// #ifdef H5
|
||||
baseUrl = "/h5-test"
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
baseUrl = "http://112.29.103.165:1616/ynuw"
|
||||
// #endif
|
||||
// 短链
|
||||
serviceUrl = {
|
||||
login: {
|
||||
loginApp: '/app/login/appUserLogin', // app登录
|
||||
registerApp: '/register',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new HttpConfig()
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
// 我的消息
|
||||
export function getNoticeAnnoByUserId(data) {
|
||||
return request({
|
||||
'url': '/app/index/getNoticeAnnoByUserId',
|
||||
'method': 'post',
|
||||
'data': data
|
||||
})
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
class Http{
|
||||
get(baseUrl= '', url, data= {}, header= {}){
|
||||
return new Promise((resolve, reject)=>{
|
||||
uni.request({
|
||||
url: baseUrl + url,
|
||||
data: data,
|
||||
method: "GET",
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Authorization': uni.getStorageSync('token') || '',
|
||||
...header
|
||||
},
|
||||
// 成功的回调
|
||||
success(res) {
|
||||
resolve(res)
|
||||
},
|
||||
fail(err) {
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
post(baseUrl= '', url, data= {}, header= {}){
|
||||
return new Promise((resolve, reject)=>{
|
||||
uni.request({
|
||||
url: baseUrl + url,
|
||||
data: data,
|
||||
method: "POST",
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Authorization': uni.getStorageSync('token') || '',
|
||||
...header
|
||||
},
|
||||
// 成功的回调
|
||||
success(res) {
|
||||
resolve(res)
|
||||
},
|
||||
fail(err) {
|
||||
// console.log(err);
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
put(baseUrl= '', url, data= {}, header= {}){
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: baseUrl + url,
|
||||
data: data,
|
||||
method: "PUT",
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Authorization': uni.getStorageSync('token') || '',
|
||||
...header
|
||||
},
|
||||
// 成功的回调
|
||||
success(res) {
|
||||
resolve(res)
|
||||
},
|
||||
fail(err) {
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
delete(baseUrl= '', url, data= {}, header= {}){
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: baseUrl + url,
|
||||
data: data,
|
||||
method: "DELETE",
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Authorization': uni.getStorageSync('token') || '',
|
||||
...header
|
||||
},
|
||||
// 成功的回调
|
||||
success(res) {
|
||||
resolve(res)
|
||||
},
|
||||
fail(err) {
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
upload(baseUrl= '', url, data= {}, header= {}){
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: baseUrl + url,
|
||||
filePath: data,
|
||||
header: {
|
||||
'Authorization': uni.getStorageSync('token') || '',
|
||||
...header
|
||||
},
|
||||
name: 'file',
|
||||
// 成功的回调
|
||||
success(res) {
|
||||
resolve(res)
|
||||
},
|
||||
fail(err) {
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default new Http()
|
||||
6
main.js
6
main.js
|
|
@ -1,11 +1,11 @@
|
|||
import App from './App'
|
||||
import store from './store'
|
||||
import $api from './api/eduApp/api.js'
|
||||
// import $api from './api/eduApp/api.js'
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$api = $api
|
||||
// Vue.prototype.$api = $api
|
||||
Vue.prototype.$store = store
|
||||
Vue.prototype.$adpid = "1111111111"
|
||||
Vue.prototype.$backgroundAudioData = {
|
||||
|
|
@ -17,7 +17,7 @@ Vue.prototype.$backgroundAudioData = {
|
|||
import uView from '@/uni_modules/uview-ui'
|
||||
Vue.use(uView)
|
||||
// import Vconsole from 'vconsole'
|
||||
|
||||
|
||||
// let vConsole = new Vconsole()
|
||||
// Vue.use(vConsole)
|
||||
// const vconsole = require('./api/vconsole.min')
|
||||
|
|
|
|||
|
|
@ -59,7 +59,10 @@
|
|||
|
||||
<script>
|
||||
import TabbarConfig from '@/tabbar.js'
|
||||
import face from '../../../uni_modules/mcc-face/index'
|
||||
// import face from '../../../uni_modules/mcc-face/index'
|
||||
import {
|
||||
getNoticeAnnoByUserId
|
||||
} from '@/api/eduApp/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -114,13 +117,20 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
uni.showModal({
|
||||
getNoticeAnnoByUserId({
|
||||
status: 0
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
/*uni.showModal({
|
||||
title: '人脸识别',
|
||||
content: '开启人脸识别?',
|
||||
success:(res) => {
|
||||
if(res.confirm) this.openFaceScan()
|
||||
}
|
||||
})
|
||||
})*/
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -500,4 +500,4 @@
|
|||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -36,7 +36,7 @@ const request = config => {
|
|||
header: config.header,
|
||||
dataType: 'json'
|
||||
}).then(response => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
let [error, res] = response
|
||||
if (error) {
|
||||
toast('后端接口连接异常')
|
||||
|
|
|
|||
Loading…
Reference in New Issue