feat:syncBook增加sign签名参数(与仓库列表一致的算法)
This commit is contained in:
parent
50f70c25a1
commit
4c66c8b85f
@ -843,7 +843,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getWarehouseList, getLocationList, searchBookByIsbn } from '@/utils/api.js'
|
import { getWarehouseList, getLocationList, searchBookByIsbn, calculateSign } from '@/utils/api.js'
|
||||||
import { login as kongfzLogin, searchProducts, searchFacet } from '@/utils/kongfz.js'
|
import { login as kongfzLogin, searchProducts, searchFacet } from '@/utils/kongfz.js'
|
||||||
import { uploadImages } from '@/utils/minio.js'
|
import { uploadImages } from '@/utils/minio.js'
|
||||||
|
|
||||||
@ -2132,7 +2132,8 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const token = uni.getStorageSync('token') || ''
|
const token = uni.getStorageSync('token') || ''
|
||||||
|
|
||||||
// 构建参数
|
// 构建参数(用于计算签名)
|
||||||
|
var timestamp = String(Math.floor(Date.now() / 1000))
|
||||||
const params = {
|
const params = {
|
||||||
app_key: 'psi',
|
app_key: 'psi',
|
||||||
client_id: 'psi',
|
client_id: 'psi',
|
||||||
@ -2150,9 +2151,15 @@ export default {
|
|||||||
page_count: '0',
|
page_count: '0',
|
||||||
word_count: this.noIsbnWordCount || '',
|
word_count: this.noIsbnWordCount || '',
|
||||||
book_format: '',
|
book_format: '',
|
||||||
live_image: imageUrls.join(',')
|
live_image: imageUrls.join(','),
|
||||||
|
timestamp: timestamp,
|
||||||
|
sign_method: 'md5'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 计算签名(与仓库列表一致的签名算法)
|
||||||
|
var sign = calculateSign(params)
|
||||||
|
params.sign = sign
|
||||||
|
|
||||||
const apiUrl = 'https://psi.api.buzhiyushu.cn/api/syncBook'
|
const apiUrl = 'https://psi.api.buzhiyushu.cn/api/syncBook'
|
||||||
console.log('【syncBook】请求地址:', apiUrl)
|
console.log('【syncBook】请求地址:', apiUrl)
|
||||||
console.log('【syncBook】请求参数:', params)
|
console.log('【syncBook】请求参数:', params)
|
||||||
|
|||||||
@ -330,6 +330,7 @@ export function searchBookByIsbn(isbn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
calculateSign,
|
||||||
getWarehouseList,
|
getWarehouseList,
|
||||||
getLocationList,
|
getLocationList,
|
||||||
psiLogin,
|
psiLogin,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user