This commit is contained in:
parent
39ada29f62
commit
c281dbebe9
|
|
@ -4,7 +4,13 @@ import config from '@/config'
|
|||
import { getToken } from '@/utils/auth.js'
|
||||
// import store from '@/store';
|
||||
|
||||
const baseUrl = config.baseUrl
|
||||
let baseUrl = ''
|
||||
if (uni.getStorageSync('jwtToken')) {
|
||||
baseUrl = config.baseUrl
|
||||
} else {
|
||||
baseUrl = config.loginBaseUrl
|
||||
}
|
||||
console.log('baseUrl-请求', baseUrl)
|
||||
|
||||
const http = new Request({
|
||||
// baseURL: "http://172.16.19.33:8081/prod-api", //设置请求的base url
|
||||
|
|
@ -13,12 +19,14 @@ const http = new Request({
|
|||
timeout: 300000, //超时时长5分钟,
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Authorization':getToken()
|
||||
Authorization: getToken()
|
||||
}
|
||||
})
|
||||
|
||||
//请求拦截器
|
||||
http.interceptors.request.use((config) => { // 可使用async await 做异步操作
|
||||
http.interceptors.request.use(
|
||||
config => {
|
||||
// 可使用async await 做异步操作
|
||||
// console.log('请求拦截器');
|
||||
|
||||
// // console.log(config);
|
||||
|
|
@ -40,38 +48,43 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操
|
|||
// // console.log(">>>>>>",getToken());
|
||||
// // config.header.Authorization='Bearer ' +getToken();
|
||||
// // }
|
||||
if(config.data&&!config.data.noShowLoading){
|
||||
if (config.data && !config.data.noShowLoading) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
})
|
||||
}
|
||||
console.log(config.data)
|
||||
|
||||
return config
|
||||
}, error => {
|
||||
},
|
||||
error => {
|
||||
return Promise.resolve(error)
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
// 响应拦截器
|
||||
http.interceptors.response.use((response) => {
|
||||
http.interceptors.response.use(
|
||||
response => {
|
||||
// console.log('响应拦截器');
|
||||
uni.hideLoading();
|
||||
uni.hideLoading()
|
||||
return response
|
||||
}, (error) => {
|
||||
},
|
||||
error => {
|
||||
if (error.statusCode == 302) {
|
||||
uni.clearStorageSync();
|
||||
uni.clearStorageSync()
|
||||
uni.switchTab({
|
||||
url: "/pages/gzt/index"
|
||||
url: '/pages/gzt/index'
|
||||
})
|
||||
}
|
||||
//未登录时清空缓存跳转
|
||||
if (error.statusCode == 401) {
|
||||
uni.clearStorageSync();
|
||||
uni.clearStorageSync()
|
||||
uni.switchTab({
|
||||
// url: "/pages/changguan/subscribe-fill"
|
||||
url: "/pages/gzt/index"
|
||||
url: '/pages/gzt/index'
|
||||
})
|
||||
}
|
||||
return Promise.resolve(error)
|
||||
})
|
||||
export default http;
|
||||
}
|
||||
)
|
||||
export default http
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
// 应用全局配置
|
||||
module.exports = {
|
||||
// baseUrl:'/prod-api',
|
||||
baseUrl:'http://112.29.103.165:1616',
|
||||
loginBaseUrl:'http://112.29.103.165:1616',
|
||||
// baseUrl:'http://192.168.0.14:2900',
|
||||
baseUrl:'http://192.168.0.32:2900',
|
||||
loginUrl: 'http://112.29.103.165:1616',
|
||||
login: 'http://192.168.0.14:19200',
|
||||
// baseUrl:'http://192.168.0.137:2900',
|
||||
login: 'http://192.168.0.32:19200',
|
||||
// 图片展示基础地址
|
||||
fileUrl:'http://192.168.0.137:2909/exam-file/',
|
||||
// 上传文件地址
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name" : "作业管控智慧平台",
|
||||
"appid" : "__UNI__0EB2E47",
|
||||
"appid" : "__UNI__4165875",
|
||||
"description" : "作业管控智慧平台",
|
||||
"versionName" : "1.0.4",
|
||||
"versionCode" : 104,
|
||||
|
|
@ -71,33 +71,33 @@
|
|||
"icons" : {
|
||||
"ios" : {
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
"app@2x" : "",
|
||||
"app@3x" : "",
|
||||
"spotlight@2x" : "",
|
||||
"notification@2x" : "",
|
||||
"notification@3x" : "",
|
||||
"settings@2x" : "",
|
||||
"settings@3x" : "",
|
||||
"spotlight@3x" : ""
|
||||
},
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"appstore" : "",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
"app" : "",
|
||||
"app@2x" : "",
|
||||
"notification" : "",
|
||||
"notification@2x" : "",
|
||||
"proapp@2x" : "",
|
||||
"settings" : "",
|
||||
"settings@2x" : "",
|
||||
"spotlight" : "",
|
||||
"spotlight@2x" : ""
|
||||
}
|
||||
},
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
"hdpi" : "",
|
||||
"xhdpi" : "",
|
||||
"xxhdpi" : "",
|
||||
"xxxhdpi" : ""
|
||||
}
|
||||
},
|
||||
"splashscreen" : {
|
||||
|
|
|
|||
14
pages.json
14
pages.json
|
|
@ -201,6 +201,20 @@
|
|||
{
|
||||
"navigationBarTitleText" : "人脸识别"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/YNEduApp/user/myMsg",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "消息通知"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/YNEduApp/user/msgDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "消息详情"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<uni-icons type="scan" size="24" style="margin-right: 2vw; color: #bababa" @click="toggleScan"></uni-icons>
|
||||
<uni-easyinput
|
||||
suffixIcon="search"
|
||||
v-model="searchIpt"
|
||||
v-model="keyword"
|
||||
placeholder="请输入搜索关键词"
|
||||
@iconClick="toggleSearch"
|
||||
></uni-easyinput>
|
||||
|
|
@ -28,18 +28,33 @@
|
|||
scrollable
|
||||
color="#808080"
|
||||
background-color="transparent"
|
||||
text="uni-app 版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。"
|
||||
:text="msgList.length > 0 ? msgList[0].noticeName : '暂无消息'"
|
||||
@click="handleMsg"
|
||||
/>
|
||||
<view class="my-task">
|
||||
<h3 style="margin-bottom: 1vh">我的任务</h3>
|
||||
<view class="task-list">
|
||||
<div class="task-list">
|
||||
<div class="list-item" v-for="(item, index) in taskList" :key="index" @click="toggleDetail(item.id)">
|
||||
<div class="item-title">{{ item.name }}</div>
|
||||
<div>{{ item.userName }}</div>
|
||||
<div>{{ item.validityDate }}</div>
|
||||
<div class="item-progress">
|
||||
<u-line-progress
|
||||
:percentage="Number(item.trainPercentage)"
|
||||
:showText="false"
|
||||
height="8"
|
||||
activeColor="#579AF8"
|
||||
/>
|
||||
<div>{{ item.trainPercentage }}%</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="no-task" v-show="taskList.length === 0">
|
||||
<view class="no-task-img">
|
||||
<image src="/static/eduImg/no-task.png"></image>
|
||||
<span>可联系管理员发布</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
</view>
|
||||
<m-tabbar fixed fill :current="0" :tabbar="tabbar"></m-tabbar>
|
||||
</view>
|
||||
|
|
@ -48,12 +63,14 @@
|
|||
<script>
|
||||
import TabbarConfig from '@/tabbar.js'
|
||||
// import face from '../../../uni_modules/mcc-face/index'
|
||||
import { getNoticeAnnoByUserId } from '@/api/eduApp/index.js'
|
||||
import { getNoticeAnnoByUserId, getStudentStudyWorkList } from '@/api/eduApp'
|
||||
import config from '@/config'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
tabbar: TabbarConfig,
|
||||
searchIpt: '',
|
||||
keyword: '',
|
||||
opts: [
|
||||
{ name: '学习项目', src: '/static/eduImg/learnProj.png', url: 'learnProj' },
|
||||
// { name: '学习', src: '/static/eduImg/learn.png', url: 'learn' },
|
||||
|
|
@ -74,10 +91,11 @@ export default {
|
|||
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
|
||||
}
|
||||
],
|
||||
taskList: []
|
||||
taskList: [],
|
||||
msgList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
mounted() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -101,14 +119,58 @@ export default {
|
|||
console.log('🚀 ~ getUserInfo ~ req:', req, req.data.access_token)
|
||||
uni.setStorageSync('App-Token', req.data.access_token)
|
||||
uni.setStorageSync('userId', req.data.loginUser.userId)
|
||||
setTimeout(() => {
|
||||
// this.getList()
|
||||
}, 1000)
|
||||
this.getMsgList()
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
toggleSearch() {
|
||||
console.log(this.searchIpt)
|
||||
async getList() {
|
||||
this.taskList = []
|
||||
let params = {
|
||||
userId: this.userId,
|
||||
status: '0'
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
this.taskList = res.data
|
||||
},
|
||||
// 搜索
|
||||
async toggleSearch() {
|
||||
this.taskList = []
|
||||
console.log('开始搜索', this.keyword)
|
||||
let params = {
|
||||
userId: this.userId,
|
||||
status: '0',
|
||||
name: this.keyword
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
this.taskList = res.data
|
||||
},
|
||||
// 获取消息列表
|
||||
async getMsgList() {
|
||||
uni.request({
|
||||
url: config.bmwUrl + '/studentUsers/getNoticeList',
|
||||
method: 'post',
|
||||
data: {},
|
||||
header: {
|
||||
Authorization: this.token
|
||||
},
|
||||
success: res => {
|
||||
console.log('🚀 ~ getMsgList ~ res:', res)
|
||||
this.msgList = res.data
|
||||
console.log('🚀 ~ getMsgList ~ this.msgList:', this.msgList)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击消息
|
||||
handleMsg() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/YNEduApp/user/myMsg'
|
||||
})
|
||||
},
|
||||
toggleScan() {
|
||||
uni.scanCode({
|
||||
|
|
@ -126,7 +188,12 @@ export default {
|
|||
face.open(['a', 'c'], function (e) {
|
||||
face.close()
|
||||
})
|
||||
}
|
||||
},
|
||||
toggleDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/YNEduApp/learnProj/learnProjDetail?id=${id}`
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
/* getNoticeAnnoByUserId({
|
||||
|
|
@ -211,6 +278,27 @@ export default {
|
|||
flex: 1;
|
||||
overflow-y: auto;
|
||||
|
||||
.list-item {
|
||||
margin: 10px 0;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
font-size: 13px;
|
||||
.item-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.item-progress {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.u-line-progress {
|
||||
width: 80%;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-task {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
:isLink="true"
|
||||
:border="false"
|
||||
style="border-bottom: 1px solid #E9E9E9"
|
||||
@click="handleAvatar"
|
||||
>
|
||||
<image
|
||||
:src="infos.avatar"
|
||||
|
|
@ -57,17 +58,25 @@
|
|||
return {
|
||||
infos: {
|
||||
avatar: '',
|
||||
username: '马晓峰',
|
||||
unit: '测试单位'
|
||||
username: '',
|
||||
unit: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(opt) {
|
||||
console.log('🚀 ~ onLoad')
|
||||
opt = JSON.parse(opt.params)
|
||||
this.infos.username = opt.userName
|
||||
this.infos.unit = opt.className
|
||||
this.infos.avatar = uni.getStorageSync('facePath')
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 点击头像
|
||||
handleAvatar() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/YNEduApp/user/faceScan'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
<template>
|
||||
<view>
|
||||
<div class="msg-wrapper">
|
||||
<div class="msg-title">{{ noticeName }}</div>
|
||||
<div class="msg-content" v-html="noticeContent"></div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
noticeName: '',
|
||||
noticeContent: ''
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
opt = JSON.parse(opt.params)
|
||||
console.log('🚀 ~ onLoad ~ opt:', opt)
|
||||
this.noticeName = opt.noticeName
|
||||
this.noticeContent = opt.noticeContent
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.msg-wrapper {
|
||||
margin: 10px;
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
.msg-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.msg-content {
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<template>
|
||||
<view>
|
||||
<div class="msg-list" v-for="(item, index) in msgList" :key="index" @click="handleDetail(item)">
|
||||
<div class="msg-title">{{ item.noticeName }}</div>
|
||||
<div class="msg-time">{{ item.createTime }}</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
token: uni.getStorageSync('App-Token'),
|
||||
// 消息列表
|
||||
msgList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getMsgList()
|
||||
},
|
||||
methods: {
|
||||
// 获取消息列表
|
||||
async getMsgList() {
|
||||
uni.request({
|
||||
url: config.bmwUrl + '/studentUsers/getNoticeList',
|
||||
method: 'post',
|
||||
data: {},
|
||||
header: {
|
||||
Authorization: this.token
|
||||
},
|
||||
success: res => {
|
||||
console.log('🚀 ~ getMsgList ~ res:', res)
|
||||
this.msgList = res.data
|
||||
console.log('🚀 ~ getMsgList ~ this.msgList:', this.msgList)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 跳转消息详情
|
||||
handleDetail(item) {
|
||||
const params = {
|
||||
noticeName: item.noticeName,
|
||||
noticeContent: item.noticeContent,
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/YNEduApp/user/msgDetail?params=${JSON.stringify(params)}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.msg-list {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
.msg-title {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
.msg-time {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<span style="font-size: 12px; color: #8a8a8b">{{ className }}</span>
|
||||
</view>
|
||||
<view class="edit-btn">
|
||||
<view @click="jumpUrl('editProfile')">修改资料</view>
|
||||
<view @click="handleEdit">修改资料</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="learn-infos">
|
||||
|
|
@ -63,11 +63,12 @@ export default {
|
|||
{ id: 3, title: '我的消息', src: '/static/eduImg/myMsg.png', path: 'myMsg' },
|
||||
{ id: 4, title: '设置', src: '/static/eduImg/settings.png', path: 'settings' }
|
||||
],
|
||||
token: ''
|
||||
token: uni.getStorageSync('App-Token')
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.token = uni.getStorageSync('App-Token')
|
||||
// this.token = uni.getStorageSync('App-Token')
|
||||
console.log('🚀 ~ onLoad ~ this.token:', this.token)
|
||||
this.getUserInfo()
|
||||
this.getLearnStats()
|
||||
},
|
||||
|
|
@ -112,16 +113,25 @@ export default {
|
|||
url: config.baseUrl + '/exam-student/personalCenter/getStudyAndCer',
|
||||
method: 'post',
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
Authorization: this.token
|
||||
},
|
||||
data: {},
|
||||
success: res => {
|
||||
console.log('🚀 ~ getLearnStats ~ res:', res)
|
||||
this.allDuration = res.data.data.allDuration
|
||||
this.value = res.data.data.value
|
||||
this.allDuration = (res.data && res.data.data.allDuration) || 0
|
||||
this.value = (res.data && res.data.data.value) || 0
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改资料
|
||||
handleEdit() {
|
||||
const params = {
|
||||
userName: this.userName,
|
||||
className: this.className
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/YNEduApp/user/editProfile?params=' + JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
import store from '@/store'
|
||||
import config from '@/config'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { getToken, setToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import { toast, showConfirm, tansParams } from '@/utils/common'
|
||||
|
||||
let timeout = 10000
|
||||
const baseUrl = config.baseUrl
|
||||
let baseUrl = ''
|
||||
if (uni.getStorageSync('jwtToken')) {
|
||||
baseUrl = config.baseUrl
|
||||
} else {
|
||||
baseUrl = config.loginBaseUrl
|
||||
}
|
||||
console.log('baseUrl-请求', baseUrl)
|
||||
|
||||
const request = config => {
|
||||
// 是否需要设置 token
|
||||
|
|
@ -13,6 +19,15 @@ const request = config => {
|
|||
config.header = config.header || {}
|
||||
if (getToken() && !isToken) {
|
||||
config.header['Authorization'] = 'Bearer ' + getToken()
|
||||
} else {
|
||||
// 没有token - 去登录
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// uni.reLaunch({ url: '/pages/login' })
|
||||
// })
|
||||
// const token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjozMSwidXNlcl9rZXkiOiJiZmJmOGEzZC1hYTc1LTQ4MzQtOGM3NC0yZmQzOTEwZDllYzAiLCJ1c2VybmFtZSI6IuaWueS6riJ9.kv1WmthbgTrqapbsGLvevk-nwbWbYJMniyjj8DC3BSnQjCwm8csQ5GaNpfsLFFFYIHBYa8CrN_sBxXhDKOfR_A'
|
||||
// const userId = 31
|
||||
// setUserId(userId)
|
||||
// setToken(token)
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.params) {
|
||||
|
|
@ -20,7 +35,7 @@ const request = config => {
|
|||
url = url.slice(0, -1)
|
||||
config.url = url
|
||||
}
|
||||
if (config.method === 'post' ) {
|
||||
if (config.method === 'post') {
|
||||
config.header = {
|
||||
...config.header,
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
|
|
@ -28,14 +43,16 @@ const request = config => {
|
|||
// config.data = JSON.stringify(config.data);
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
uni
|
||||
.request({
|
||||
method: config.method || 'get',
|
||||
timeout: config.timeout || timeout,
|
||||
url: config.baseUrl || baseUrl + config.url,
|
||||
url: baseUrl + config.url,
|
||||
data: config.data,
|
||||
header: config.header,
|
||||
dataType: 'json'
|
||||
}).then(response => {
|
||||
})
|
||||
.then(response => {
|
||||
// console.log(response)
|
||||
let [error, res] = response
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue