|
|
@@ -354,6 +354,7 @@ tools.getDateYM = ()=>{
|
|
|
* @param type
|
|
|
*/
|
|
|
tools.setLoginData = function (data) {
|
|
|
+ uni.setStorageSync('user_id', data.user_id)
|
|
|
uni.setStorageSync('token', data.access_token)
|
|
|
uni.setStorageSync('tokenType', data.token_type)
|
|
|
uni.setStorageSync('refreshToken', data.access_token)
|
|
|
@@ -431,5 +432,17 @@ tools.getCosToken=function (){
|
|
|
return undefined
|
|
|
}
|
|
|
}
|
|
|
+tools.setFileObj=function (url,type){
|
|
|
+ url= url.replace('https://','')
|
|
|
+ url= url.replace('http://','')
|
|
|
+ url= url.replace('icoco-1317650740.cos.ap-guangzhou.myqcloud.com/','')
|
|
|
+ return {
|
|
|
+ "location":url,
|
|
|
+ "hash":"abc123",
|
|
|
+ "version":"1.0",
|
|
|
+ "type":type===1?"PHOTO":"V",
|
|
|
+ "serverSideEncryption":"AES256"
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
export default tools
|