相关接口配置修改
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()
|
|
||||||
4
main.js
4
main.js
|
|
@ -1,11 +1,11 @@
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import $api from './api/eduApp/api.js'
|
// import $api from './api/eduApp/api.js'
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.prototype.$api = $api
|
// Vue.prototype.$api = $api
|
||||||
Vue.prototype.$store = store
|
Vue.prototype.$store = store
|
||||||
Vue.prototype.$adpid = "1111111111"
|
Vue.prototype.$adpid = "1111111111"
|
||||||
Vue.prototype.$backgroundAudioData = {
|
Vue.prototype.$backgroundAudioData = {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TabbarConfig from '@/tabbar.js'
|
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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -114,13 +117,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
uni.showModal({
|
getNoticeAnnoByUserId({
|
||||||
|
status: 0
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
/*uni.showModal({
|
||||||
title: '人脸识别',
|
title: '人脸识别',
|
||||||
content: '开启人脸识别?',
|
content: '开启人脸识别?',
|
||||||
success:(res) => {
|
success:(res) => {
|
||||||
if(res.confirm) this.openFaceScan()
|
if(res.confirm) this.openFaceScan()
|
||||||
}
|
}
|
||||||
})
|
})*/
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -36,7 +36,7 @@ const request = config => {
|
||||||
header: config.header,
|
header: config.header,
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
console.log(response)
|
// console.log(response)
|
||||||
let [error, res] = response
|
let [error, res] = response
|
||||||
if (error) {
|
if (error) {
|
||||||
toast('后端接口连接异常')
|
toast('后端接口连接异常')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue