Commit 7079ba13 authored by 和慭琛's avatar 和慭琛

问题解决

parent ed8eb0d2
...@@ -19,10 +19,7 @@ ...@@ -19,10 +19,7 @@
"navigationBarTitleText": "完工信息" "navigationBarTitleText": "完工信息"
} }
}, },
{ {
"path": "pages/take/detail", "path": "pages/take/detail",
......
...@@ -161,23 +161,25 @@ ...@@ -161,23 +161,25 @@
this.getToken() this.getToken()
}, },
async getToken () {
await uni.getStorage({
key: 'token',
success: function (res) {
console.log('本地获取token成功')
console.log(res.data);
getApp().globalData.token = res.data
}
})
await this.getData()
},
methods: { methods: {
async getToken () {
await uni.getStorage({
key: 'token',
success: function (res) {
console.log('本地获取token成功')
console.log(res.data);
getApp().globalData.token = res.data
}
})
await this.getData()
},
//获取数据 //获取数据
getData: function () { getData: function () {
......
...@@ -293,22 +293,24 @@ __webpack_require__.r(__webpack_exports__); ...@@ -293,22 +293,24 @@ __webpack_require__.r(__webpack_exports__);
this.getToken(); this.getToken();
}, },
getToken: function getToken() {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
uni.getStorage({
key: 'token',
success: function success(res) {
console.log('本地获取token成功');
console.log(res.data);
getApp().globalData.token = res.data;
} }));case 2:_context.next = 4;return ( methods: {
getToken: function getToken() {var _this = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
uni.getStorage({
key: 'token',
success: function success(res) {
console.log('本地获取token成功');
console.log(res.data);
getApp().globalData.token = res.data;
_this.getData());case 4:case "end":return _context.stop();}}}, _callee);}))();
},
methods: { } }));case 2:_context.next = 4;return (
_this.getData());case 4:case "end":return _context.stop();}}}, _callee);}))();
},
//获取数据 //获取数据
getData: function getData() { getData: function getData() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment