<filename>node_modules/.cache/vue-loader/d69835473c03c063a5bd37978bfa06c7.json<gh_stars>0
{"remainingRequest":"E:\\new2019\\vue-element-admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\new2019\\vue-element-admin\\src\\components\\Upload\\SingleImage3.vue?vue&type=script&lang=js&","dependencies":[{"path":"E:\\new2019\\vue-element-admin\\src\\components\\Upload\\SingleImage3.vue","mtime":1557403764406},{"path":"E:\\new2019\\vue-element-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\new2019\\vue-element-admin\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"E:\\new2019\\vue-element-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\new2019\\vue-element-admin\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport { getToken } from '@/api/qiniu'\r\n\r\nexport default {\r\n  name: 'SingleImageUpload3',\r\n  props: {\r\n    value: {\r\n      type: String,\r\n      default: ''\r\n    }\r\n  },\r\n  data() {\r\n    return {\r\n      tempUrl: '',\r\n      dataObj: { token: '', key: '' }\r\n    }\r\n  },\r\n  computed: {\r\n    imageUrl() {\r\n      return this.value\r\n    }\r\n  },\r\n  methods: {\r\n    rmImage() {\r\n      this.emitInput('')\r\n    },\r\n    emitInput(val) {\r\n      this.$emit('input', val)\r\n    },\r\n    handleImageSuccess(file) {\r\n      this.emitInput(file.files.file)\r\n    },\r\n    beforeUpload() {\r\n      const _self = this\r\n      return new Promise((resolve, reject) => {\r\n        getToken().then(response => {\r\n          const key = response.data.qiniu_key\r\n          const token = response.data.qiniu_token\r\n          _self._data.dataObj.token = token\r\n          _self._data.dataObj.key = key\r\n          this.tempUrl = response.data.qiniu_url\r\n          resolve(true)\r\n        }).catch(err => {\r\n          console.log(err)\r\n          reject(false)\r\n        })\r\n      })\r\n    }\r\n  }\r\n}\r\n",null]}