提交 614b3fbd 编写于 作者: 小刘28's avatar 小刘28 💬

feat:完善请求库中的Token配置;

上级 776f0400
<script>
export default {
onLaunch: function() {
onLaunch: function () {
console.log('App Launch');
},
onShow: function() {
onShow: function () {
console.log('App Show');
},
onHide: function() {
onHide: function () {
console.log('App Hide');
}
}
......@@ -14,5 +14,4 @@
<style>
/*每个页面公共css */
</style>
......@@ -42,9 +42,10 @@
name:'张三',
sex:''
};
this.$store.commit('updateUser',obj);
this.$store.commit('M_updateUser',obj);
},
async clickUserLogin(){
// console.log(this.$store.getters.getToken);
const res = await xzRequest.post({
url:'/user/login',
data:{
......
......@@ -41,4 +41,5 @@ const store = new Vuex.Store({
}
});
export default store;
......@@ -50,7 +50,7 @@ export default {
return uni.uploadFile({
url: `${this.baseURL}${options.url}`, //仅为示例,并非真实接口地址。
header: {
[this.tokenName]: store.getters.getToken()
[this.tokenName]: store.getters.getToken
},
filePath: options.file,
name: 'file',
......@@ -75,7 +75,7 @@ export default {
method: options.method,
header: {
'Content-Type': options.contentType ? options.contentType : 'application/json',
[this.tokenName]: ''
[this.tokenName]: store.getters.getToken
},
success:(res)=>{
if(res.statusCode === 200){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册