Browse Source

注释巡检记录获取组织树报错,token拼接

dev
mk 1 month ago
parent
commit
6ed53f9815
  1. 3
      common/http.js
  2. 2
      pagesA/xjPage/xj.vue

3
common/http.js

@ -1,4 +1,5 @@
const baseUrl = 'http://219.146.91.110:30801/mz-api'; const baseUrl = 'http://219.146.91.110:30801/mz-api';
const token = uni.getStorageSync('token') || store.state.user.token;
export const request = (options) => { export const request = (options) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
@ -7,7 +8,7 @@ export const request = (options) => {
data: options.data || {}, // 请求参数 data: options.data || {}, // 请求参数
header: { header: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Authorization: uni.getStorageSync('token') || '', // 携带 Token Authorization: token ? `Bearer ${token}` : "", // 携带 Token
}, },
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {

2
pagesA/xjPage/xj.vue

@ -287,7 +287,7 @@ export default {
2 2
); );
console.log(this.deptOptions, "this.deptOptions"); console.log(this.deptOptions, "this.deptOptions");
const deptInfo = this.deptOptions[0].children[0]; // const deptInfo = this.deptOptions[0].children[0];
const newArr = this.deptOptions.map((item) => ({ const newArr = this.deptOptions.map((item) => ({
name: item.deptName, name: item.deptName,
})); }));

Loading…
Cancel
Save