|
|
@@ -2,10 +2,9 @@ import md5 from '@/common/md5.js'
|
|
|
|
|
|
// 与1.0保持一致的签名规则:md5(method=xxx×tamp=xxx&secret=xxx)
|
|
|
export function apiUrl(method, action, source) {
|
|
|
- const timestamp = getApp().globalData.globalTimestamp
|
|
|
+ const timestamp = Date.now().toString()
|
|
|
const sign = md5('method=' + method + '×tamp=' + timestamp + '&secret=' + getApp().globalData.secret)
|
|
|
- let url = getApp().globalData.shareUrl + 'api/api.php' + '?method=' + method + '×tamp=' + timestamp + '&sign=' + sign
|
|
|
- if (source) url += '&source=' + source
|
|
|
+ let url = getApp().globalData.shareUrl + 'api/api.php' + '?method=' + method + '&source=' + (source || method) + '×tamp=' + timestamp + '&sign=' + sign
|
|
|
if (action) url += '&action=' + action
|
|
|
return url
|
|
|
}
|