63 lines
1.2 KiB
Vue
63 lines
1.2 KiB
Vue
<template>
|
|
<view class="content">
|
|
<signInput ref="sign" :header="header" :action="action" @signToUrl="signToUrl">
|
|
</signInput>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import signInput from "@/components/am-sign-input/am-sign-input.vue"
|
|
import {
|
|
|
|
HTTP_REQUEST_URL
|
|
} from '@/config/app.js';
|
|
import store from '@/store';
|
|
export default {
|
|
components: {
|
|
signInput
|
|
},
|
|
data() {
|
|
return {
|
|
action: "", //上传服务器的地址
|
|
header: {
|
|
|
|
}, //图片上传携带头部信息
|
|
|
|
}
|
|
},
|
|
mounted() {
|
|
this.header={
|
|
// #ifdef MP
|
|
"Content-Type": "multipart/form-data",
|
|
// #endif
|
|
'Authori-Zation': store.state.app.token
|
|
}
|
|
let pid =0
|
|
this.action= HTTP_REQUEST_URL + '/api/front/upload/image64?model=maintain&pid=0'
|
|
},
|
|
methods: {
|
|
/**
|
|
* @param {Object} e
|
|
* 返回的签名地址
|
|
*/
|
|
signToUrl(e) {
|
|
if (e.error_code && e.error_code === '201') {
|
|
uni.showToast({
|
|
title: e.msg,
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
},
|
|
|
|
},
|
|
}
|
|
</script>
|
|
<style lang="scss">
|
|
.content {
|
|
min-height: 100vh;
|
|
background: #ffffff;
|
|
padding: 60px 0px;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
</style> |